From d755b55bbe84b493c9e104ac4e1dee111d08fa4e Mon Sep 17 00:00:00 2001 From: "luca.frosini" Date: Thu, 22 Dec 2016 16:27:26 +0000 Subject: [PATCH] Reorganizing components git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry-api@141385 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../resourceregistry/{ => api}/Constants.java | 2 +- .../api/ContextManagement.java | 29 ----- .../api/EntityManagement.java | 104 ------------------ .../resourceregistry/api/Query.java | 25 ----- .../api/SchemaManagement.java | 97 ---------------- 5 files changed, 1 insertion(+), 256 deletions(-) rename src/main/java/org/gcube/informationsystem/resourceregistry/{ => api}/Constants.java (84%) delete mode 100644 src/main/java/org/gcube/informationsystem/resourceregistry/api/ContextManagement.java delete mode 100644 src/main/java/org/gcube/informationsystem/resourceregistry/api/EntityManagement.java delete mode 100644 src/main/java/org/gcube/informationsystem/resourceregistry/api/Query.java delete mode 100644 src/main/java/org/gcube/informationsystem/resourceregistry/api/SchemaManagement.java diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/Constants.java b/src/main/java/org/gcube/informationsystem/resourceregistry/api/Constants.java similarity index 84% rename from src/main/java/org/gcube/informationsystem/resourceregistry/Constants.java rename to src/main/java/org/gcube/informationsystem/resourceregistry/api/Constants.java index 0681f21..ba9c1d9 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/Constants.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/api/Constants.java @@ -1,4 +1,4 @@ -package org.gcube.informationsystem.resourceregistry; +package org.gcube.informationsystem.resourceregistry.api; /** * @author Luca Frosini (ISTI - CNR) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/api/ContextManagement.java b/src/main/java/org/gcube/informationsystem/resourceregistry/api/ContextManagement.java deleted file mode 100644 index 4cbd2fd..0000000 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/api/ContextManagement.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * - */ -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.context.ContextCreationException; -import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException; -import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException; - -/** - * @author Luca Frosini (ISTI - CNR) - */ -public interface ContextManagement { - - public String create(UUID parentContext, String name) throws ContextCreationException, ResourceRegistryException; - - public String read(UUID context) throws ContextNotFoundException, ContextException; - - public String rename(UUID context, String newName) throws ContextNotFoundException, ContextException; - - public String move(UUID newParent, UUID contextToMove) 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 deleted file mode 100644 index dd7a3cc..0000000 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/api/EntityManagement.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * - */ -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.context.ContextNotFoundException; -import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetAlreadyPresentException; -import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetNotFoundException; -import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceAlreadyPresentException; -import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException; - -/** - * @author Luca Frosini (ISTI - CNR) - * - */ -public interface EntityManagement { - - /* Facets Methods */ - - public String createFacet(String facetType, String jsonRepresentation) - throws FacetAlreadyPresentException, ResourceRegistryException; - - public String readFacet(UUID uuid) throws FacetNotFoundException, - ResourceRegistryException; - - public String readFacet(UUID uuid, String facetType) - throws FacetNotFoundException, ResourceRegistryException; - - public String updateFacet(UUID uuid, String jsonRepresentation) - throws FacetNotFoundException, ResourceRegistryException; - - public boolean deleteFacet(UUID uuid) throws FacetNotFoundException, - ResourceRegistryException; - - /* Resources Methods */ - - public String createResource(String resourceType, String jsonRepresentation) - throws ResourceAlreadyPresentException, ResourceRegistryException; - - public String readResource(UUID uuid) throws ResourceNotFoundException, - ResourceRegistryException; - - public String readResource(UUID uuid, String resourceType) - throws ResourceNotFoundException, ResourceRegistryException; - - /** - * Update a resource means update ConsistsOf relations and related Facets - * presents in the jsonRepresentation argument. If some ConsistsOf relations - * does not exist they are created together with the Facet. - * - * All IsRelatedTo relations and related resources (if any) are ignored. - * - * @param resourceUUID - * @param jsonRepresentation - * @return - * @throws ResourceNotFoundException - * @throws ResourceRegistryException - */ - public String updateResource(UUID resourceUUID, String jsonRepresentation) - throws ResourceNotFoundException, ResourceRegistryException; - - public boolean deleteResource(UUID uuid) throws ResourceNotFoundException, - ResourceRegistryException, ResourceRegistryException; - - - /* Relations Methods */ - public String attachFacet(UUID resourceUUID, UUID facetUUID, - String consistOfType, String jsonRepresentation) - throws FacetNotFoundException, ResourceNotFoundException, - ResourceRegistryException; - - public boolean detachFacet(UUID consistsOfUUID) - throws ResourceRegistryException; - - public String attachResource(UUID sourceResourceUUID, - UUID targetResourceUUID, String relatedToType, - String jsonRepresentation) throws ResourceNotFoundException, - ResourceRegistryException; - - public boolean detachResource(UUID isRelatedToUUID) - throws ResourceRegistryException; - - - /* Context toggle methods */ - public boolean addResourceToContext(UUID uuid) - throws ResourceNotFoundException, ContextNotFoundException, - ResourceRegistryException; - - public boolean addFacetToContext(UUID uuid) throws FacetNotFoundException, - ContextNotFoundException, ResourceRegistryException; - - - public boolean removeResourceFromContext(UUID uuid) - throws ResourceNotFoundException, ContextNotFoundException, - ResourceRegistryException; - - public boolean removeFacetFromContext(UUID uuid) throws FacetNotFoundException, - ContextNotFoundException, ResourceRegistryException; - - -} diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/api/Query.java b/src/main/java/org/gcube/informationsystem/resourceregistry/api/Query.java deleted file mode 100644 index d278d3a..0000000 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/api/Query.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - */ -package org.gcube.informationsystem.resourceregistry.api; - -import org.gcube.informationsystem.resourceregistry.api.exceptions.InvalidQueryException; - -/** - * @author Luca Frosini (ISTI - CNR) - * - */ -public interface Query { - - /** - * @param query - * @param limit - * @param fetchPlan - * @return - * @throws InvalidQueryException - * http://orientdb.com/docs/last/OrientDB-REST.html#query - */ - public String query(String query, int limit, String fetchPlan) - throws InvalidQueryException; - -} diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/api/SchemaManagement.java b/src/main/java/org/gcube/informationsystem/resourceregistry/api/SchemaManagement.java deleted file mode 100644 index f8bc0ee..0000000 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/api/SchemaManagement.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.gcube.informationsystem.resourceregistry.api; - -import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException; -import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException; - -/** - * Service Endpoint Interface - * @author Luca Frosini (ISTI - CNR) - * - * For JSON schema see - * http://orientdb.com/docs/last/OrientDB-REST.html#class - * - */ -public interface SchemaManagement { - - public String registerEntitySchema(String jsonSchema) throws SchemaException; - - public String getEntitySchema(String entityType) throws SchemaNotFoundException; - - public String updateEntitySchema(String entityType, String jsonSchema) throws SchemaNotFoundException, SchemaException; - - public String deleteEntitySchema(String entityType) throws SchemaNotFoundException; - - public String getEntityTypes(String entityType, boolean includeSchema) throws SchemaNotFoundException, SchemaException; - - - public String registerFacetSchema(String jsonSchema) throws SchemaException; - - public String getFacetSchema(String facetType) throws SchemaNotFoundException; - - public String updateFacetSchema(String facetType, String jsonSchema) throws SchemaNotFoundException, SchemaException; - - public String deleteFacetSchema(String facetType) throws SchemaNotFoundException; - - public String getFacetTypes(String facetType, boolean includeSchema) throws SchemaNotFoundException, SchemaException; - - - - public String registerResourceSchema(String jsonSchema) throws SchemaException; - - public String getResourceSchema(String resourceType) throws SchemaNotFoundException; - - public String updateResourceSchema(String resourceType, String jsonSchema) throws SchemaNotFoundException, SchemaException; - - public String deleteResourceSchema(String resourceType) throws SchemaNotFoundException; - - public String getResourceTypes(String resourceType, boolean includeSchema) throws SchemaNotFoundException, SchemaException; - - - - public String registerEmbeddedTypeSchema(String jsonSchema) throws SchemaException; - - public String getEmbeddedTypeSchema(String embeddedType) throws SchemaNotFoundException; - - public String updateEmbeddedTypeSchema(String embeddedType, String jsonSchema) throws SchemaNotFoundException, SchemaException; - - public String deleteEmbeddedTypeSchema(String embeddedType) throws SchemaNotFoundException; - - public String getEmbeddedTypes(String embeddedType, boolean includeSchema) throws SchemaNotFoundException, SchemaException; - - - - public String registerRelationSchema(String jsonSchema) throws SchemaException; - - public String getRelationSchema(String relationType) throws SchemaNotFoundException; - - public String updateRelationSchema(String relationType, String jsonSchema) throws SchemaNotFoundException, SchemaException; - - public String deleteRelationSchema(String relationType) throws SchemaNotFoundException; - - public String getRelationTypes(String relationType, boolean includeSchema) throws SchemaNotFoundException, SchemaException; - - - - public String registerConsistsOfSchema(String jsonSchema) throws SchemaException; - - public String getConsistsOfSchema(String consistsOfType) throws SchemaNotFoundException; - - public String updateConsistsOfSchema(String consistsOfType, String jsonSchema) throws SchemaNotFoundException, SchemaException; - - public String deleteConsistsOfSchema(String consistsOfType) throws SchemaException; - - public String getConsistsOfTypes(String consistsOfType, boolean includeSchema) throws SchemaNotFoundException, SchemaException; - - - - public String registerIsRelatedToSchema(String jsonSchema) throws SchemaException; - - public String getIsRelatedToSchema(String isRelatedToType) throws SchemaNotFoundException; - - public String updateIsRelatedToSchema(String isRelatedToType, String jsonSchema) throws SchemaNotFoundException, SchemaException; - - public String deleteIsRelatedToSchema(String isRelatedToType) throws SchemaException; - - public String getIsRelatedToTypes(String isRelatedToType, boolean includeSchema) throws SchemaNotFoundException, SchemaException; - -}