1
|
package eu.dnetlib.repo.manager.service.controllers;
|
2
|
|
3
|
import eu.dnetlib.repo.manager.shared.BrokerException;
|
4
|
import eu.dnetlib.repo.manager.shared.Term;
|
5
|
import eu.dnetlib.repo.manager.shared.broker.*;
|
6
|
import io.swagger.annotations.Api;
|
7
|
import io.swagger.annotations.ApiParam;
|
8
|
import org.json.JSONException;
|
9
|
import org.springframework.http.MediaType;
|
10
|
import org.springframework.web.bind.annotation.*;
|
11
|
|
12
|
import java.io.IOException;
|
13
|
import java.util.List;
|
14
|
import java.util.Map;
|
15
|
|
16
|
@RestController
|
17
|
@RequestMapping(value = "/broker")
|
18
|
@Api(description = "Broker API", tags = {"broker"})
|
19
|
public interface BrokerApi {
|
20
|
|
21
|
@RequestMapping(value = "/getDatasourcesOfUser" , method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
22
|
DatasourcesBroker getDatasourcesOfUser(@RequestBody String params) throws BrokerException, JSONException;
|
23
|
|
24
|
@RequestMapping(value = "/getTopicsForDatasource/{datasourceName}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
25
|
List<BrowseEntry> getTopicsForDatasource(String datasourceName) throws BrokerException;
|
26
|
|
27
|
@RequestMapping(value = "/advancedShowEvents/{page}/{size}" , method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
28
|
EventsPage advancedShowEvents(@PathVariable("page") String page,
|
29
|
@PathVariable("size") String size,
|
30
|
@RequestBody AdvQueryObject advQueryObject) throws BrokerException, JSONException ,IOException;
|
31
|
|
32
|
@RequestMapping(value = "/showEvents/{datasourceName}/{topic}/{page}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
33
|
EventsPage showEvents(@PathVariable("datasourceName") String datasourceName,
|
34
|
@PathVariable("topic") String topic,
|
35
|
@PathVariable("page") String page) throws BrokerException, JSONException;
|
36
|
|
37
|
@RequestMapping(value = "/getSimpleSubscriptionsOfUser/{userEmail}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
38
|
@ResponseBody
|
39
|
Map<String, List<SimpleSubscriptionDesc>> getSimpleSubscriptionsOfUser(String userEmail) throws BrokerException;
|
40
|
|
41
|
@RequestMapping(value = "/subscribe" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
42
|
@ResponseBody
|
43
|
Subscription subscribe(@RequestBody OpenaireSubscription obj) throws BrokerException;
|
44
|
|
45
|
@RequestMapping(value = "/unsubscribe/{subscriptionId}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
46
|
@ResponseBody
|
47
|
void unsubscribe(String subscriptionId) throws BrokerException;
|
48
|
|
49
|
@RequestMapping(value = "/getSubscription/{subscriptionId}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
50
|
@ResponseBody
|
51
|
Subscription getSubscription(@PathVariable("subscriptionId") String subscriptionId) throws BrokerException;
|
52
|
|
53
|
|
54
|
@RequestMapping(value = "/getDnetTopics" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
55
|
@ResponseBody
|
56
|
Map<String, Term> getDnetTopics() throws BrokerException;
|
57
|
|
58
|
@RequestMapping(value = "/getNotificationsBySubscriptionId/{subscriptionId}/{page}/{size}" , method = RequestMethod.GET
|
59
|
,produces = MediaType.APPLICATION_JSON_VALUE)
|
60
|
@ResponseBody
|
61
|
EventsPage getNotificationsBySubscriptionId(String subscriptionId,String page,String size) throws BrokerException;
|
62
|
|
63
|
@RequestMapping(value = "/getSubscriptionsOfUser/{userEmail}" , method = RequestMethod.GET
|
64
|
,produces = MediaType.APPLICATION_JSON_VALUE)
|
65
|
@ResponseBody
|
66
|
Map<String, List<Subscription>> getSubscriptionsOfUser(String userEmail) throws BrokerException;
|
67
|
}
|