Refs #11902: Use new REST interface in Resource Registry Client

Task-Url: https://support.d4science.org/issues/11902

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@169037 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2018-06-12 09:23:15 +00:00
parent 2925ef950a
commit 33ee498c81
1 changed files with 6 additions and 0 deletions

View File

@ -22,6 +22,7 @@ import org.gcube.informationsystem.resourceregistry.api.rest.AccessPath;
import org.gcube.informationsystem.resourceregistry.api.rest.ContextPath;
import org.gcube.informationsystem.resourceregistry.api.rest.httputils.HTTPCall.HTTPMETHOD;
import org.gcube.informationsystem.resourceregistry.context.ContextManagement;
import org.gcube.informationsystem.resourceregistry.context.ContextUtility;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -78,7 +79,12 @@ public class ContextManager {
logger.info("Requested to read {} with id {} ", Context.NAME, uuid);
setCalledMethod(HTTPMETHOD.GET, uuid);
ContextManagement contextManagement = new ContextManagement();
if(uuid.compareTo(AccessPath.CURRENT_CONTEXT)==0){
uuid = ContextUtility.getCurrentSecurityContext().getUUID().toString();
}
contextManagement.setUUID(UUID.fromString(uuid));
return contextManagement.read();
}