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(@RequestBody JobForValidation jobForValidation);
25

    
26
    @RequestMapping(value = "/reSubmitJobForValidation/",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE )
27
    @ResponseBody
28
    void reSubmitJobForValidation(@RequestBody 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(@RequestBody String url);
37

    
38
    @RequestMapping(value = "/identifyRepository/{url}" , 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, String jobType, Integer offset, Integer limit, String dateFrom,
49
                                     String dateTo, String validationStatus) throws ValidatorServiceException;
50

    
51

    
52
    @RequestMapping(value = "/getStoredJobsTotalNumberNew" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
53
    @ResponseBody
54
    int getStoredJobsTotalNumberNew(String user, String jobType, String validationStatus) throws ValidatorServiceException;
55

    
56
    @RequestMapping(value = "/getInterfaceInformation/{baseUrl}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
57
    @ResponseBody
58
    InterfaceInformation getInterfaceInformation(String baseUrl) throws ValidationServiceException;
59
}
(11-11/12)