From df1bce7a729f3b1384b4b621185f40f4c2838a1a Mon Sep 17 00:00:00 2001 From: "luca.frosini" Date: Thu, 27 Oct 2016 15:51:02 +0000 Subject: [PATCH] Switched api from string to UUID git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry-api@133660 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../api/ContextManagement.java | 12 +++++---- .../api/EntityManagement.java | 26 ++++++++++--------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/api/ContextManagement.java b/src/main/java/org/gcube/informationsystem/resourceregistry/api/ContextManagement.java index 959cfde..ab92338 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/api/ContextManagement.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/api/ContextManagement.java @@ -3,6 +3,8 @@ */ package org.gcube.informationsystem.resourceregistry.api; +import java.util.UUID; + import org.gcube.informationsystem.resourceregistry.api.exceptions.InternalException; import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextCreationException; import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException; @@ -13,14 +15,14 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.context.Conte */ public interface ContextManagement { - public String create(String parentContextUUID, String name) throws ContextCreationException, InternalException; + public String create(UUID parentContext, String name) throws ContextCreationException, InternalException; - public String read(String contextUUID) throws ContextNotFoundException, ContextException; + public String read(UUID context) throws ContextNotFoundException, ContextException; - public String rename(String contextUUID, String newName) throws ContextNotFoundException, ContextException; + public String rename(UUID context, String newName) throws ContextNotFoundException, ContextException; - public String move(String newParentUUID, String contextToMoveUUID) throws ContextNotFoundException, ContextException; + public String move(UUID newParent, UUID contextToMove) throws ContextNotFoundException, ContextException; - public String delete(String uuid) throws ContextNotFoundException, ContextException; + public boolean delete(UUID context) throws ContextNotFoundException, ContextException; } \ No newline at end of file diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/api/EntityManagement.java b/src/main/java/org/gcube/informationsystem/resourceregistry/api/EntityManagement.java index 3b4e4b6..623e7c8 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/api/EntityManagement.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/api/EntityManagement.java @@ -3,6 +3,8 @@ */ package org.gcube.informationsystem.resourceregistry.api; +import java.util.UUID; + import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.EntityException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.FacetNotFoundException; @@ -19,16 +21,16 @@ public interface EntityManagement { public String createFacet(String facetType, String jsonRepresentation) throws EntityException, ResourceRegistryException; - public String readFacet(String uuid) throws FacetNotFoundException, + public String readFacet(UUID uuid) throws FacetNotFoundException, ResourceRegistryException; - public String readFacet(String uuid, String facetType) + public String readFacet(UUID uuid, String facetType) throws FacetNotFoundException, ResourceRegistryException; - public String updateFacet(String uuid, String jsonRepresentation) + public String updateFacet(UUID uuid, String jsonRepresentation) throws FacetNotFoundException, ResourceRegistryException; - public boolean deleteFacet(String uuid) throws FacetNotFoundException, + public boolean deleteFacet(UUID uuid) throws FacetNotFoundException, ResourceRegistryException; /* Resources Methods */ @@ -36,32 +38,32 @@ public interface EntityManagement { public String createResource(String resourceType, String jsonRepresentation) throws ResourceRegistryException; - public String readResource(String uuid) throws ResourceNotFoundException, + public String readResource(UUID uuid) throws ResourceNotFoundException, ResourceRegistryException; - public String readResource(String uuid, String resourceType) + public String readResource(UUID uuid, String resourceType) throws ResourceNotFoundException, ResourceRegistryException; - public boolean deleteResource(String uuid) + public boolean deleteResource(UUID uuid) throws ResourceNotFoundException, ResourceRegistryException, ResourceRegistryException; /* Relations Methods */ - public String attachFacet(String resourceUUID, String facetUUID, + public String attachFacet(UUID resourceUUID, UUID facetUUID, String consistOfType, String jsonRepresentation) throws FacetNotFoundException, ResourceNotFoundException, ResourceRegistryException; - public boolean detachFacet(String consistOfUUID) + public boolean detachFacet(UUID consistOfUUID) throws ResourceRegistryException; - public String attachResource(String sourceResourceUUID, - String targetResourceUUID, String relatedToType, + public String attachResource(UUID sourceResourceUUID, + UUID targetResourceUUID, String relatedToType, String jsonRepresentation) throws ResourceNotFoundException, ResourceRegistryException; - public boolean detachResource(String relatedToUUID) + public boolean detachResource(UUID relatedToUUID) throws ResourceRegistryException; }