40 lines
1.1 KiB
Java
40 lines
1.1 KiB
Java
package org.gcube.portal.social_networking_client_library;
|
|
|
|
import javax.ws.rs.core.GenericType;
|
|
|
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
|
import org.gcube.portal.social_networking_client_library.utils.HttpClient;
|
|
import org.gcube.portal.socialnetworking.model.output.ResponseBean;
|
|
import org.json.JSONArray;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
/**
|
|
* Vres client.
|
|
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
|
*/
|
|
public class VREsClient extends BaseClient{
|
|
|
|
private static final String SUB_SERVICE_PATH = "2/vres/";
|
|
private static Logger logger = LoggerFactory.getLogger(VREsClient.class);
|
|
|
|
|
|
public VREsClient() throws Exception {
|
|
super(SUB_SERVICE_PATH);
|
|
}
|
|
|
|
/**
|
|
* Get my Vres
|
|
* @return my vres
|
|
*/
|
|
public JSONArray getMyVRES(){
|
|
|
|
logger.debug("Request for writing new message");
|
|
String thisMethodSignature = "get-my-vres";
|
|
String request = getServiceEndpoint() + thisMethodSignature + "?";
|
|
return HttpClient.get(new GenericType<ResponseBean<JSONArray>>(){}, request, SecurityTokenProvider.instance.get());
|
|
|
|
}
|
|
|
|
}
|