From 33ee498c818f5c1960a3b4ad997f9582f0ebd93f Mon Sep 17 00:00:00 2001 From: "luca.frosini" Date: Tue, 12 Jun 2018 09:23:15 +0000 Subject: [PATCH] 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 --- .../resourceregistry/rest/ContextManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ContextManager.java b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ContextManager.java index b2e29af..353ea25 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ContextManager.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ContextManager.java @@ -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(); }