1 |
49362
|
panagiotis
|
package eu.dnetlib.repo.manager.service.controllers;
|
2 |
49236
|
panagiotis
|
|
3 |
49763
|
panagiotis
|
import eu.dnetlib.repo.manager.shared.BrokerException;
|
4 |
50319
|
panagiotis
|
import eu.dnetlib.repo.manager.shared.Term;
|
5 |
49868
|
panagiotis
|
import eu.dnetlib.repo.manager.shared.broker.*;
|
6 |
50372
|
panagiotis
|
import io.swagger.annotations.Api;
|
7 |
50614
|
panagiotis
|
import io.swagger.annotations.ApiParam;
|
8 |
49362
|
panagiotis
|
import org.json.JSONException;
|
9 |
49236
|
panagiotis
|
import org.springframework.http.MediaType;
|
10 |
49868
|
panagiotis
|
import org.springframework.web.bind.annotation.*;
|
11 |
49236
|
panagiotis
|
|
12 |
49868
|
panagiotis
|
import java.io.IOException;
|
13 |
49245
|
panagiotis
|
import java.util.List;
|
14 |
49868
|
panagiotis
|
import java.util.Map;
|
15 |
49245
|
panagiotis
|
|
16 |
49236
|
panagiotis
|
@RestController
|
17 |
|
|
@RequestMapping(value = "/broker")
|
18 |
50003
|
panagiotis
|
@Api(description = "Broker API", tags = {"broker"})
|
19 |
49236
|
panagiotis
|
public interface BrokerApi {
|
20 |
|
|
|
21 |
|
|
@RequestMapping(value = "/getDatasourcesOfUser" , method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
22 |
50686
|
panagiotis
|
DatasourcesBroker getDatasourcesOfUser(String user,String includeShared,String includeByOthers) throws BrokerException, JSONException;
|
23 |
49236
|
panagiotis
|
|
24 |
49245
|
panagiotis
|
@RequestMapping(value = "/getTopicsForDatasource/{datasourceName}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
25 |
|
|
List<BrowseEntry> getTopicsForDatasource(String datasourceName) throws BrokerException;
|
26 |
|
|
|
27 |
50614
|
panagiotis
|
@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 |
49852
|
panagiotis
|
|
32 |
50614
|
panagiotis
|
@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 |
49868
|
panagiotis
|
|
37 |
50409
|
panagiotis
|
@RequestMapping(value = "/getSimpleSubscriptionsOfUser/{userEmail}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
38 |
49868
|
panagiotis
|
@ResponseBody
|
39 |
50686
|
panagiotis
|
Map<String, List<SimpleSubscriptionDesc>> getSimpleSubscriptionsOfUser(@PathVariable("userEmail") String userEmail) throws BrokerException;
|
40 |
49868
|
panagiotis
|
|
41 |
50686
|
panagiotis
|
@RequestMapping(value = "/subscribe" , method = RequestMethod.POST,consumes = MediaType.APPLICATION_JSON_VALUE,
|
42 |
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
43 |
49868
|
panagiotis
|
@ResponseBody
|
44 |
|
|
Subscription subscribe(@RequestBody OpenaireSubscription obj) throws BrokerException;
|
45 |
|
|
|
46 |
50686
|
panagiotis
|
@RequestMapping(value = "/unsubscribe/{subscriptionId}" , method = RequestMethod.POST,consumes = MediaType.APPLICATION_JSON_VALUE,
|
47 |
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
48 |
49868
|
panagiotis
|
@ResponseBody
|
49 |
|
|
void unsubscribe(String subscriptionId) throws BrokerException;
|
50 |
|
|
|
51 |
|
|
@RequestMapping(value = "/getSubscription/{subscriptionId}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
52 |
|
|
@ResponseBody
|
53 |
|
|
Subscription getSubscription(@PathVariable("subscriptionId") String subscriptionId) throws BrokerException;
|
54 |
50319
|
panagiotis
|
|
55 |
|
|
|
56 |
|
|
@RequestMapping(value = "/getDnetTopics" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
57 |
|
|
@ResponseBody
|
58 |
|
|
Map<String, Term> getDnetTopics() throws BrokerException;
|
59 |
50383
|
panagiotis
|
|
60 |
|
|
@RequestMapping(value = "/getNotificationsBySubscriptionId/{subscriptionId}/{page}/{size}" , method = RequestMethod.GET
|
61 |
|
|
,produces = MediaType.APPLICATION_JSON_VALUE)
|
62 |
|
|
@ResponseBody
|
63 |
|
|
EventsPage getNotificationsBySubscriptionId(String subscriptionId,String page,String size) throws BrokerException;
|
64 |
50409
|
panagiotis
|
|
65 |
|
|
@RequestMapping(value = "/getSubscriptionsOfUser/{userEmail}" , method = RequestMethod.GET
|
66 |
|
|
,produces = MediaType.APPLICATION_JSON_VALUE)
|
67 |
|
|
@ResponseBody
|
68 |
|
|
Map<String, List<Subscription>> getSubscriptionsOfUser(String userEmail) throws BrokerException;
|
69 |
49236
|
panagiotis
|
}
|