2018-02-19 16:35:01 +01:00
|
|
|
package org.gcube.social_networking.social_networking_client_library;
|
2017-10-21 22:35:21 +02:00
|
|
|
|
2018-02-19 16:27:09 +01:00
|
|
|
import java.util.List;
|
|
|
|
|
2018-02-16 19:22:14 +01:00
|
|
|
import javax.ws.rs.core.GenericType;
|
|
|
|
|
2018-02-19 16:35:01 +01:00
|
|
|
import org.gcube.social_networking.social_networking_client_library.utils.HttpClient;
|
|
|
|
import org.gcube.social_networking.socialnetworking.model.beans.MyVRE;
|
|
|
|
import org.gcube.social_networking.socialnetworking.model.output.ResponseBean;
|
2017-10-21 22:35:21 +02:00
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Vres client.
|
|
|
|
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
|
|
|
*/
|
2018-02-19 16:27:09 +01:00
|
|
|
public class VREClient extends BaseClient{
|
2017-10-21 22:35:21 +02:00
|
|
|
|
|
|
|
private static final String SUB_SERVICE_PATH = "2/vres/";
|
2018-02-19 16:27:09 +01:00
|
|
|
private static Logger logger = LoggerFactory.getLogger(VREClient.class);
|
2017-10-21 22:35:21 +02:00
|
|
|
|
|
|
|
|
2018-02-19 16:27:09 +01:00
|
|
|
public VREClient() throws Exception {
|
2017-10-21 22:35:21 +02:00
|
|
|
super(SUB_SERVICE_PATH);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get my Vres
|
|
|
|
* @return my vres
|
|
|
|
*/
|
2018-02-19 16:27:09 +01:00
|
|
|
public List<MyVRE> getMyVRES(boolean retrieveManagers){
|
2017-10-21 22:35:21 +02:00
|
|
|
|
|
|
|
logger.debug("Request for writing new message");
|
|
|
|
String thisMethodSignature = "get-my-vres";
|
2018-02-19 16:27:09 +01:00
|
|
|
String request = getServiceEndpoint() + thisMethodSignature + "?" + "getManagers=" + retrieveManagers;
|
|
|
|
return HttpClient.get(new GenericType<ResponseBean<List<MyVRE>>>(){}, request);
|
2017-10-21 22:35:21 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|