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 org.json.JSONException;
|
6
|
import org.springframework.http.MediaType;
|
7
|
import org.springframework.web.bind.annotation.*;
|
8
|
|
9
|
import java.io.IOException;
|
10
|
import java.util.List;
|
11
|
import java.util.Map;
|
12
|
|
13
|
@RestController
|
14
|
@RequestMapping(value = "/broker")
|
15
|
public interface BrokerApi {
|
16
|
|
17
|
@RequestMapping(value = "/getDatasourcesOfUser" , method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
18
|
DatasourcesBroker getDatasourcesOfUser(@RequestBody String params) throws BrokerException, JSONException;
|
19
|
|
20
|
@RequestMapping(value = "/getTopicsForDatasource/{datasourceName}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
21
|
List<BrowseEntry> getTopicsForDatasource(String datasourceName) throws BrokerException;
|
22
|
|
23
|
@RequestMapping(value = "/advancedShowEvents" , method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
24
|
EventsPage advancedShowEvents(@RequestBody String params) throws BrokerException, JSONException ,IOException;
|
25
|
|
26
|
@RequestMapping(value = "/showEvents" , method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
27
|
EventsPage showEvents(@RequestBody String params) throws BrokerException, JSONException;
|
28
|
|
29
|
@RequestMapping(value = "/getSubscriptionsOfUser/{userEmail}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
30
|
@ResponseBody
|
31
|
Map<String, List<SimpleSubscriptionDesc>> getSubscriptionsOfUser(String userEmail) throws BrokerException;
|
32
|
|
33
|
@RequestMapping(value = "/subscribe" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
34
|
@ResponseBody
|
35
|
Subscription subscribe(@RequestBody OpenaireSubscription obj) throws BrokerException;
|
36
|
|
37
|
@RequestMapping(value = "/unsubscribe/{subscriptionId}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
38
|
@ResponseBody
|
39
|
void unsubscribe(String subscriptionId) throws BrokerException;
|
40
|
|
41
|
@RequestMapping(value = "/getSubscription/{subscriptionId}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
42
|
@ResponseBody
|
43
|
Subscription getSubscription(@PathVariable("subscriptionId") String subscriptionId) throws BrokerException;
|
44
|
}
|