Project

General

Profile

1
package eu.dnetlib.repo.manager.service.controllers;
2

    
3
import eu.dnetlib.api.functionality.ValidatorServiceException;
4
import eu.dnetlib.domain.functionality.validator.JobForValidation;
5
import eu.dnetlib.domain.functionality.validator.RuleSet;
6
import eu.dnetlib.domain.functionality.validator.StoredJob;
7
import eu.dnetlib.repo.manager.shared.InterfaceInformation;
8
import eu.dnetlib.repo.manager.shared.ValidationServiceException;
9
import io.swagger.annotations.Api;
10
import org.json.JSONException;
11
import org.springframework.http.MediaType;
12
import org.springframework.web.bind.annotation.*;
13

    
14
import java.util.List;
15

    
16

    
17
@RestController
18
@RequestMapping(value = "/validator")
19
@Api(description = "Validator API",  tags = {"validator"})
20
public interface ValidatorApi {
21

    
22
    @RequestMapping(value = "/submitJobForValidation",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE )
23
    @ResponseBody
24
    void submitJobForValidation(JobForValidation jobForValidation);
25

    
26
    @RequestMapping(value = "/reSubmitJobForValidation/{jobId}",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE )
27
    @ResponseBody
28
    void reSubmitJobForValidation(String jobId) throws JSONException;
29

    
30
    @RequestMapping(value = "/getRuleSets/{mode}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
31
    @ResponseBody
32
    List<RuleSet> getRuleSets(String mode);
33

    
34
    @RequestMapping(value = "/getSetsOfRepository" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
35
    @ResponseBody
36
    List<String> getSetsOfRepository(String url);
37

    
38
    @RequestMapping(value = "/identifyRepository" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
39
    @ResponseBody
40
    boolean identifyRepo(String url);
41

    
42
    @RequestMapping(value = "/getRuleSet/{acronym}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
43
    @ResponseBody
44
    RuleSet getRuleSet(String acronym);
45

    
46
    @RequestMapping(value = "/getStoredJobsNew" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
47
    @ResponseBody
48
    List<StoredJob> getStoredJobsNew(String user,
49
                                     String jobType,
50
                                     String offset,
51
                                     String limit,
52
                                     String dateFrom,
53
                                     String dateTo,
54
                                     String validationStatus) throws ValidatorServiceException;
55

    
56

    
57
    @RequestMapping(value = "/getStoredJobsTotalNumberNew" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
58
    @ResponseBody
59
    int getStoredJobsTotalNumberNew(String user, String jobType, String validationStatus) throws ValidatorServiceException;
60

    
61
    @RequestMapping(value = "/getInterfaceInformation/" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
62
    @ResponseBody
63
    InterfaceInformation getInterfaceInformation(String baseUrl) throws ValidationServiceException;
64
}
(11-11/12)