Revision 50756
Added by Panagiotis Kanakakis about 6 years ago
BrokerApiImpl.java | ||
---|---|---|
22 | 22 |
import org.springframework.util.LinkedMultiValueMap; |
23 | 23 |
import org.springframework.util.MultiValueMap; |
24 | 24 |
import org.springframework.web.bind.annotation.PathVariable; |
25 |
import org.springframework.web.bind.annotation.RequestBody; |
|
25 | 26 |
import org.springframework.web.bind.annotation.RequestParam; |
26 | 27 |
import org.springframework.web.client.RestClientException; |
27 | 28 |
import org.springframework.web.client.RestTemplate; |
... | ... | |
132 | 133 |
} |
133 | 134 |
|
134 | 135 |
@Override |
135 |
public EventsPage advancedShowEvents(String page,String size,AdvQueryObject advQueryObject) throws BrokerException, JSONException ,IOException { |
|
136 |
/*JSONObject json_params = new JSONObject(params); |
|
136 |
public EventsPage advancedShowEvents(@PathVariable("page") String page, |
|
137 |
@PathVariable("size") String size, |
|
138 |
@RequestBody AdvQueryObject advQueryObject) throws BrokerException, JSONException ,IOException { |
|
137 | 139 |
|
138 |
String page = json_params.getString("page"); |
|
139 |
String pagesize = json_params.getString("pagesize"); |
|
140 |
String json_advQueryObject = json_params.getString("advQueryObject"); |
|
141 |
|
|
142 |
ObjectMapper mapper = new ObjectMapper(); |
|
143 |
AdvQueryObject advQueryObject = mapper.readValue(json_advQueryObject, AdvQueryObject.class);*/ |
|
144 |
|
|
145 | 140 |
final String service = "/events/{page}/{pageSize}"; |
146 | 141 |
|
147 | 142 |
Map<String, Long> uriParams = new HashMap<>(); |
... | ... | |
219 | 214 |
} |
220 | 215 |
|
221 | 216 |
@Override |
222 |
public EventsPage showEvents(String datasourceName,String topic,String page) throws BrokerException, JSONException { |
|
217 |
public EventsPage showEvents(@PathVariable("datasourceName") String datasourceName, |
|
218 |
@PathVariable("topic") String topic, |
|
219 |
@PathVariable("page") String page) throws BrokerException, JSONException { |
|
223 | 220 |
|
224 | 221 |
/*JSONObject json_params = new JSONObject(params); |
225 | 222 |
|
... | ... | |
251 | 248 |
} |
252 | 249 |
|
253 | 250 |
@Override |
254 |
public Map<String, List<SimpleSubscriptionDesc>> getSimpleSubscriptionsOfUser( String userEmail) |
|
251 |
public Map<String, List<SimpleSubscriptionDesc>> getSimpleSubscriptionsOfUser(@PathVariable("userEmail") String userEmail)
|
|
255 | 252 |
throws BrokerException { |
256 | 253 |
|
257 | 254 |
final String service = "/subscriptions"; |
... | ... | |
276 | 273 |
} |
277 | 274 |
|
278 | 275 |
@Override |
279 |
public Subscription subscribe(OpenaireSubscription obj) throws BrokerException { |
|
276 |
public Subscription subscribe(@RequestBody OpenaireSubscription obj) throws BrokerException {
|
|
280 | 277 |
final String service = "/subscribe"; |
281 | 278 |
|
282 | 279 |
//build the uri params |
Also available in: Unified diff
1. Bug fixes on parameters for BrokerApi