Project

General

Profile

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

    
3
import eu.dnetlib.repo.manager.shared.BrokerException;
4
import eu.dnetlib.repo.manager.shared.broker.*;
5
import io.swagger.annotations.*;
6
import org.json.JSONException;
7
import org.springframework.http.MediaType;
8
import org.springframework.web.bind.annotation.*;
9

    
10
import java.io.IOException;
11
import java.util.List;
12
import java.util.Map;
13

    
14
@RestController
15
@RequestMapping(value = "/broker")
16
@Api(description = "Broker API",  tags = {"broker"})
17
public interface BrokerApi {
18

    
19
    @RequestMapping(value = "/getDatasourcesOfUser" , method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
20
    DatasourcesBroker getDatasourcesOfUser(@RequestBody String params) throws BrokerException, JSONException;
21

    
22
    @RequestMapping(value = "/getTopicsForDatasource/{datasourceName}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
23
    List<BrowseEntry> getTopicsForDatasource(String datasourceName) throws BrokerException;
24

    
25
    @RequestMapping(value = "/advancedShowEvents" , method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
26
    EventsPage advancedShowEvents(@RequestBody String params) throws BrokerException, JSONException ,IOException;
27

    
28
    @RequestMapping(value = "/showEvents" , method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
29
    EventsPage showEvents(@RequestBody String params) throws BrokerException, JSONException;
30

    
31
    @RequestMapping(value = "/getSubscriptionsOfUser/{userEmail}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
32
    @ResponseBody
33
    Map<String, List<SimpleSubscriptionDesc>> getSubscriptionsOfUser(String userEmail) throws BrokerException;
34

    
35
    @RequestMapping(value = "/subscribe" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
36
    @ResponseBody
37
    Subscription subscribe(@RequestBody OpenaireSubscription obj) throws BrokerException;
38

    
39
    @RequestMapping(value = "/unsubscribe/{subscriptionId}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
40
    @ResponseBody
41
    void unsubscribe(String subscriptionId) throws BrokerException;
42

    
43
    @RequestMapping(value = "/getSubscription/{subscriptionId}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
44
    @ResponseBody
45
    Subscription getSubscription(@PathVariable("subscriptionId") String subscriptionId) throws BrokerException;
46
}
(1-1/10)