diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/Access.java b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/Access.java index 1b687cc..81b15d0 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/Access.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/Access.java @@ -29,6 +29,7 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.er.ERNotFound import org.gcube.informationsystem.resourceregistry.api.exceptions.query.InvalidQueryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException; 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.er.ERManagement; @@ -273,10 +274,15 @@ public class Access { @Produces(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8) public String getContext(@PathParam(ID_PATH_PARAM) String uuid) throws ContextNotFoundException, ResourceRegistryException { - logger.info("Requested to read {} with id {} ", org.gcube.informationsystem.model.entity.Context.NAME, uuid); ContextManagement contextManagement = new ContextManagement(); - contextManagement.setUUID(UUID.fromString(uuid)); - return contextManagement.read(); + if(uuid.compareTo(ContextPath.ALL_PATH_PART)==0) { + logger.info("Requested to read all {}s", org.gcube.informationsystem.model.entity.Context.NAME); + return contextManagement.all(false); + }else { + logger.info("Requested to read {} with id {} ", org.gcube.informationsystem.model.entity.Context.NAME, uuid); + contextManagement.setUUID(UUID.fromString(uuid)); + return contextManagement.read(); + } } } \ No newline at end of file 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 b624f9f..c5cd91d 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ContextManager.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ContextManager.java @@ -67,6 +67,7 @@ public class ContextManager { throws ContextNotFoundException, ResourceRegistryException { ContextManagement contextManagement = new ContextManagement(); if(uuid.compareTo(ContextPath.ALL_PATH_PART)==0) { + logger.info("Requested to read all {}s", Context.NAME); return contextManagement.all(false); }else { logger.info("Requested to read {} with id {} ", Context.NAME, uuid);