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.http.ResponseEntity;
13
import org.springframework.web.bind.annotation.*;
14

    
15
import java.util.List;
16

    
17

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

    
23
    @RequestMapping(value = "/submitJobForValidation",method = RequestMethod.POST,
24
            consumes = MediaType.APPLICATION_JSON_VALUE,
25
            produces = MediaType.APPLICATION_JSON_VALUE)
26
    @ResponseBody
27
    JobForValidation submitJobForValidation(JobForValidation jobForValidation) throws ValidatorServiceException;
28

    
29
    @RequestMapping(value = "/reSubmitJobForValidation/{email}/{jobId}",method = RequestMethod.POST,
30
            consumes = MediaType.APPLICATION_JSON_VALUE,
31
            produces = MediaType.APPLICATION_JSON_VALUE)
32
    @ResponseBody
33
    ResponseEntity<Object> reSubmitJobForValidation(String email,String jobId) throws JSONException, ValidatorServiceException;
34

    
35
    @RequestMapping(value = "/getRuleSets/{mode}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
36
    @ResponseBody
37
    List<RuleSet> getRuleSets(String mode);
38

    
39
    @RequestMapping(value = "/getSetsOfRepository" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
40
    @ResponseBody
41
    List<String> getSetsOfRepository(String url);
42

    
43
    @RequestMapping(value = "/identifyRepository" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
44
    @ResponseBody
45
    boolean identifyRepo(String url);
46

    
47
    @RequestMapping(value = "/getRuleSet/{acronym}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
48
    @ResponseBody
49
    RuleSet getRuleSet(String acronym);
50

    
51
    @RequestMapping(value = "/getStoredJobsNew" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
52
    @ResponseBody
53
    List<StoredJob> getStoredJobsNew(String user,
54
                                     String jobType,
55
                                     String offset,
56
                                     String limit,
57
                                     String dateFrom,
58
                                     String dateTo,
59
                                     String validationStatus) throws ValidatorServiceException;
60

    
61

    
62
    @RequestMapping(value = "/getStoredJobsTotalNumberNew" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
63
    @ResponseBody
64
    int getStoredJobsTotalNumberNew(String user, String jobType, String validationStatus) throws ValidatorServiceException;
65

    
66
    @RequestMapping(value = "/getInterfaceInformation" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
67
    @ResponseBody
68
    InterfaceInformation getInterfaceInformation(String baseUrl) throws ValidationServiceException;
69
}
(14-14/15)