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
This commit is contained in:
Luca Frosini 2016-10-27 15:51:02 +00:00
parent b32581e8bc
commit df1bce7a72
2 changed files with 21 additions and 17 deletions

View File

@ -3,6 +3,8 @@
*/ */
package org.gcube.informationsystem.resourceregistry.api; 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.InternalException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextCreationException; import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextCreationException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException; 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 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;
} }

View File

@ -3,6 +3,8 @@
*/ */
package org.gcube.informationsystem.resourceregistry.api; 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.ResourceRegistryException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.EntityException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.EntityException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.FacetNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.FacetNotFoundException;
@ -19,16 +21,16 @@ public interface EntityManagement {
public String createFacet(String facetType, String jsonRepresentation) public String createFacet(String facetType, String jsonRepresentation)
throws EntityException, ResourceRegistryException; throws EntityException, ResourceRegistryException;
public String readFacet(String uuid) throws FacetNotFoundException, public String readFacet(UUID uuid) throws FacetNotFoundException,
ResourceRegistryException; ResourceRegistryException;
public String readFacet(String uuid, String facetType) public String readFacet(UUID uuid, String facetType)
throws FacetNotFoundException, ResourceRegistryException; throws FacetNotFoundException, ResourceRegistryException;
public String updateFacet(String uuid, String jsonRepresentation) public String updateFacet(UUID uuid, String jsonRepresentation)
throws FacetNotFoundException, ResourceRegistryException; throws FacetNotFoundException, ResourceRegistryException;
public boolean deleteFacet(String uuid) throws FacetNotFoundException, public boolean deleteFacet(UUID uuid) throws FacetNotFoundException,
ResourceRegistryException; ResourceRegistryException;
/* Resources Methods */ /* Resources Methods */
@ -36,32 +38,32 @@ public interface EntityManagement {
public String createResource(String resourceType, String jsonRepresentation) public String createResource(String resourceType, String jsonRepresentation)
throws ResourceRegistryException; throws ResourceRegistryException;
public String readResource(String uuid) throws ResourceNotFoundException, public String readResource(UUID uuid) throws ResourceNotFoundException,
ResourceRegistryException; ResourceRegistryException;
public String readResource(String uuid, String resourceType) public String readResource(UUID uuid, String resourceType)
throws ResourceNotFoundException, ResourceRegistryException; throws ResourceNotFoundException, ResourceRegistryException;
public boolean deleteResource(String uuid) public boolean deleteResource(UUID uuid)
throws ResourceNotFoundException, ResourceRegistryException, throws ResourceNotFoundException, ResourceRegistryException,
ResourceRegistryException; ResourceRegistryException;
/* Relations Methods */ /* Relations Methods */
public String attachFacet(String resourceUUID, String facetUUID, public String attachFacet(UUID resourceUUID, UUID facetUUID,
String consistOfType, String jsonRepresentation) String consistOfType, String jsonRepresentation)
throws FacetNotFoundException, ResourceNotFoundException, throws FacetNotFoundException, ResourceNotFoundException,
ResourceRegistryException; ResourceRegistryException;
public boolean detachFacet(String consistOfUUID) public boolean detachFacet(UUID consistOfUUID)
throws ResourceRegistryException; throws ResourceRegistryException;
public String attachResource(String sourceResourceUUID, public String attachResource(UUID sourceResourceUUID,
String targetResourceUUID, String relatedToType, UUID targetResourceUUID, String relatedToType,
String jsonRepresentation) throws ResourceNotFoundException, String jsonRepresentation) throws ResourceNotFoundException,
ResourceRegistryException; ResourceRegistryException;
public boolean detachResource(String relatedToUUID) public boolean detachResource(UUID relatedToUUID)
throws ResourceRegistryException; throws ResourceRegistryException;
} }