Project

General

Profile

« Previous | Next » 

Revision 52781

1. Dockerize service
2. Add authorization checks
3. Handle exceptions ( controller advice, exception package)
4. Login-logout operations bug fixes

View differences:

BrokerApi.java
4 4
import eu.dnetlib.repo.manager.shared.Term;
5 5
import eu.dnetlib.repo.manager.shared.broker.*;
6 6
import io.swagger.annotations.Api;
7
import io.swagger.annotations.ApiParam;
8 7
import org.json.JSONException;
9 8
import org.springframework.http.MediaType;
9
import org.springframework.http.ResponseEntity;
10
import org.springframework.security.access.prepost.PostAuthorize;
11
import org.springframework.security.access.prepost.PreAuthorize;
10 12
import org.springframework.web.bind.annotation.*;
11 13

  
12 14
import java.io.IOException;
......
23 25
    @ResponseBody
24 26
    DatasourcesBroker getDatasourcesOfUser(String user,String includeShared,String includeByOthers) throws BrokerException, JSONException;
25 27

  
26
    @RequestMapping(value = "/getTopicsForDatasource/{datasourceName}" , method = RequestMethod.GET,
28
    @RequestMapping(value = "/getTopicsForDatasource/{datasourceName:.+}" , method = RequestMethod.GET,
27 29
            produces = MediaType.APPLICATION_JSON_VALUE)
28 30
    @ResponseBody
29 31
    List<BrowseEntry> getTopicsForDatasource(String datasourceName) throws BrokerException;
......
35 37
                                  String size,
36 38
                                  AdvQueryObject advQueryObject) throws BrokerException, JSONException ,IOException;
37 39

  
38
    @RequestMapping(value = "/showEvents/{datasourceName}/{topic}/{page}" , method = RequestMethod.GET,
40
    @RequestMapping(value = "/showEvents/{datasourceName:.+}/{topic}/{page}" , method = RequestMethod.GET,
39 41
            produces = MediaType.APPLICATION_JSON_VALUE)
40 42
    @ResponseBody
41 43
    EventsPage showEvents(String datasourceName,
......
56 58
    @RequestMapping(value = "/unsubscribe/{subscriptionId}" , method = RequestMethod.POST,consumes = MediaType.APPLICATION_JSON_VALUE,
57 59
            produces = MediaType.APPLICATION_JSON_VALUE)
58 60
    @ResponseBody
59
    void unsubscribe(String subscriptionId) throws BrokerException;
61
    ResponseEntity<Object> unsubscribe(String subscriptionId) throws BrokerException;
60 62

  
61 63
    @RequestMapping(value = "/getSubscription/{subscriptionId}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
62 64
    @ResponseBody

Also available in: Unified diff