diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/resources/Access.java b/src/main/java/org/gcube/informationsystem/resourceregistry/resources/Access.java index 8ce9598..050618d 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/resources/Access.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/resources/Access.java @@ -37,7 +37,7 @@ public class Access { protected SchemaManagement schemaManager = new SchemaManagementImpl(); /** - * e.g. /resource-registry/access?query=SELECT FROM V + * e.g. GET /resource-registry/access?query=SELECT FROM V * @param query * @param fetchPlan * @return @@ -52,7 +52,7 @@ public class Access { } /** - * e.g. /resource-registry/access/facet/instance/4d28077b-566d-4132-b073-f4edaf61dcb9 + * e.g. GET /resource-registry/access/facet/instance/4d28077b-566d-4132-b073-f4edaf61dcb9 * @param facetId * @return * @throws FacetNotFoundException @@ -67,7 +67,7 @@ public class Access { } /** - * e.g. /resource-registry/access/facet/schema/ContactFacet + * e.g. GET /resource-registry/access/facet/schema/ContactFacet * @param facetType * @return * @throws SchemaNotFoundException @@ -81,7 +81,7 @@ public class Access { } /** - * e.g. /resource-registry/access/resource/instance/cc132a2c-d0b0-45a8-92fa-7451f6a44b6d + * e.g. GET /resource-registry/access/resource/instance/cc132a2c-d0b0-45a8-92fa-7451f6a44b6d * @param resourceId * @return * @throws ResourceNotFoundException @@ -95,7 +95,7 @@ public class Access { } /** - * e.g. /resource-registry/access/resource/schema/HostingNode + * e.g. GET /resource-registry/access/resource/schema/HostingNode * @param resourceType * @return * @throws SchemaNotFoundException diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/resources/ContextManager.java b/src/main/java/org/gcube/informationsystem/resourceregistry/resources/ContextManager.java index 09eb95f..52f994d 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/resources/ContextManager.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/resources/ContextManager.java @@ -35,6 +35,13 @@ public class ContextManager { protected ContextManagement contextManager = new ContextManagementImpl(); + /** + * e.g. PUT /resource-registry/context?name=myVRE&parentContextId=a2fe0030-7b3d-4617-ba37-532c0e4b778d + * @param parentUUID + * @param name + * @return + * @throws Exception + */ @PUT public String create( @QueryParam(ContextPath.PARENT_CONTEXT_ID_PARAM) String parentUUID, @@ -44,6 +51,12 @@ public class ContextManager { return contextManager.create(parentUUID, name); } + /** + * e.g. DELETE /resource-registry/context/c0f314e7-2807-4241-a792-2a6c79ed4fd0 + * @param uuid + * @return + * @throws ContextException + */ @DELETE @Path("{" + ID_PATH_PARAM + "}") public String delete(@PathParam(ID_PATH_PARAM) String uuid) @@ -52,6 +65,14 @@ public class ContextManager { return contextManager.delete(uuid); } + /** + * e.g. POST /resource-registry/context/rename/c0f314e7-2807-4241-a792-2a6c79ed4fd0?name=newNameVRE + * @param uuid + * @param name + * @return + * @throws ContextNotFoundException + * @throws ContextException + */ @POST @Path(ContextPath.RENAME_PATH_PART + "/{" + ID_PATH_PARAM + "}") public String rename(@PathParam(ID_PATH_PARAM) String uuid, @@ -61,6 +82,14 @@ public class ContextManager { return contextManager.rename(uuid, name); } + /** + * e.g. POST /resource-registry/context/move/c0f314e7-2807-4241-a792-2a6c79ed4fd0?parentContextId=68cf247a-b1ed-44cd-9d2e-c16d865bade7 + * @param uuid + * @param newParentUUID + * @return + * @throws ContextNotFoundException + * @throws ContextException + */ @POST @Path(ContextPath.MOVE_PATH_PART + "/{" + ID_PATH_PARAM + "}") public String move( diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/resources/EntityManager.java b/src/main/java/org/gcube/informationsystem/resourceregistry/resources/EntityManager.java index 5a7a4a2..591e114 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/resources/EntityManager.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/resources/EntityManager.java @@ -40,6 +40,14 @@ public class EntityManager { protected EntityManagement entityManager = new EntityManagementImpl(); /* Facets Methods */ + /** + * e.g. PUT /resource-registry/entity/facet/ContactFacet?definition={...} + * @param type + * @param definition + * @return + * @throws EntityException + * @throws ResourceRegistryException + */ @PUT @Path(EntityPath.FACET_PATH_PART + "/{" + TYPE_PATH_PARAM + "}") public String createFacet( @@ -51,6 +59,14 @@ public class EntityManager { return entityManager.createFacet(type, definition); } + /** + * e.g. POST /resource-registry/entity/facet/4023d5b2-8601-47a5-83ef-49ffcbfc7d86?definition={...} + * @param uuid + * @param definition + * @return + * @throws FacetNotFoundException + * @throws ResourceRegistryException + */ @POST @Path(EntityPath.FACET_PATH_PART + "/{" + ID_PATH_PARAM + "}") public String updateFacet( @@ -62,6 +78,13 @@ public class EntityManager { return entityManager.updateFacet(uuid, definition); } + /** + * e.g. DELETE /resource-registry/entity/facet/4023d5b2-8601-47a5-83ef-49ffcbfc7d86 + * @param uuid + * @return + * @throws FacetNotFoundException + * @throws ResourceRegistryException + */ @DELETE @Path(EntityPath.FACET_PATH_PART + "/{" + ID_PATH_PARAM + "}") public boolean deleteFacet(@PathParam(ID_PATH_PARAM) String uuid) @@ -72,6 +95,14 @@ public class EntityManager { /* Resources Methods */ + /** + * e.g. PUT /resource-registry/entity/resource/HostingNode?definition={...} + * @param type + * @param definition + * @return + * @throws FacetNotFoundException + * @throws ResourceRegistryException + */ @PUT @Path(EntityPath.RESOURCE_PATH_PART + "/{" + TYPE_PATH_PARAM + "}") public String createResource( @@ -83,6 +114,13 @@ public class EntityManager { return entityManager.createResource(type, definition); } + /** + * e.g. DELETE /resource-registry/entity/resource/67062c11-9c3a-4906-870d-7df6a43408b0 + * @param uuid + * @return + * @throws ResourceNotFoundException + * @throws Exception + */ @DELETE @Path(EntityPath.RESOURCE_PATH_PART + "/{" + ID_PATH_PARAM + "}") public boolean deleteResource(@PathParam(ID_PATH_PARAM) String uuid) @@ -93,6 +131,17 @@ public class EntityManager { /* Relations Methods */ + /** + * e.g. PUT /resource-registry/entity/consistOf/source/bbf80a93-2284-424a-930c-7ee20021aee1/target/f6931232-c034-4979-9b2f-7193d3fba7df?type=hasCreator&properties={...} + * @param resourceUUID + * @param facetUUID + * @param type + * @param properties + * @return + * @throws FacetNotFoundException + * @throws ResourceNotFoundException + * @throws ResourceRegistryException + */ @PUT @Path(EntityPath.CONSIST_OF_PATH_PART + "/" + EntityPath.SOURCE_PATH_PART + "/{" @@ -114,6 +163,12 @@ public class EntityManager { properties); } + /** + * e.g. DELETE /resource-registry/entity/consistOf/9bff49c8-c0a7-45de-827c-accb71defbd3 + * @param consistOfUUID + * @return + * @throws ResourceRegistryException + */ @DELETE @Path(EntityPath.CONSIST_OF_PATH_PART + "/{" + ID_PATH_PARAM + "}") @@ -123,6 +178,16 @@ public class EntityManager { return entityManager.detachFacet(consistOfUUID); } + /** + * e.g. PUT /resource-registry/entity/relatedTo/source/4a81008a-6300-4a32-857f-cebe3f7b2925/target/985f7cf9-b6fa-463b-86c8-84ab0a77deea?type=callsFor&properties={...} + * @param sourceResourceUUID + * @param targetResourceUUID + * @param type + * @param properties + * @return + * @throws ResourceNotFoundException + * @throws ResourceRegistryException + */ @PUT @Path(EntityPath.RELATED_TO_PATH_PART + "/" + EntityPath.SOURCE_PATH_PART + "/{" @@ -143,6 +208,12 @@ public class EntityManager { targetResourceUUID, type, properties); } + /** + * e.g. DELETE /resource-registry/entity/relatedTo/b3982715-a7aa-4530-9a5f-2f60008d256e + * @param relatedToUUID + * @return + * @throws ResourceRegistryException + */ @DELETE @Path(EntityPath.RELATED_TO_PATH_PART + "/{" + ID_PATH_PARAM + "}") diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/resources/SchemaManager.java b/src/main/java/org/gcube/informationsystem/resourceregistry/resources/SchemaManager.java index 6e65e8e..f12cadd 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/resources/SchemaManager.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/resources/SchemaManager.java @@ -24,7 +24,12 @@ public class SchemaManager { protected SchemaManagement schemaManager = new SchemaManagementImpl(); - + /** + * e.g. PUT /resource-registry/schema/embedded?schema={...} + * @param jsonSchema + * @return + * @throws SchemaException + */ @PUT @Path(SchemaPath.EMBEDDED_PATH_PART) public String registerEmbeddedTypeSchema(@QueryParam(SchemaPath.SCHEMA_PARAM) String jsonSchema) throws SchemaException { @@ -32,6 +37,12 @@ public class SchemaManager { return schemaManager.registerEmbeddedTypeSchema(jsonSchema); } + /** + * e.g. PUT /resource-registry/schema/facet?schema={...} + * @param jsonSchema + * @return + * @throws SchemaException + */ @PUT @Path(SchemaPath.FACET_PATH_PART) public String registerFacetSchema(@QueryParam(SchemaPath.SCHEMA_PARAM) String jsonSchema) throws SchemaException { @@ -39,7 +50,13 @@ public class SchemaManager { return schemaManager.registerFacetSchema(jsonSchema); } - + /** + * e.g. PUT /resource-registry/schema/resource?schema={...} + * @param jsonSchema + * @param jsonSchema + * @return + * @throws SchemaException + */ @PUT @Path(SchemaPath.RESOURCE_PATH_PART) public String registerResourceSchema(@QueryParam(SchemaPath.SCHEMA_PARAM) String jsonSchema) throws SchemaException { @@ -47,7 +64,12 @@ public class SchemaManager { return schemaManager.registerResourceSchema(jsonSchema); } - + /** + * e.g. PUT /resource-registry/schema/consistOf?schema={...} + * @param jsonSchema + * @return + * @throws SchemaException + */ @PUT @Path(SchemaPath.CONSIST_OF_PATH_PART) public String registerConsistOfSchema(@QueryParam(SchemaPath.SCHEMA_PARAM) String jsonSchema) throws SchemaException { @@ -55,6 +77,12 @@ public class SchemaManager { return schemaManager.registerConsistOfSchema(jsonSchema); } + /** + * e.g. PUT /resource-registry/schema/relatedTo?schema={...} + * @param jsonSchema + * @return + * @throws SchemaException + */ @PUT @Path(SchemaPath.RELATED_TO_PATH_PART) public String registerRelatedToSchema(@QueryParam(SchemaPath.SCHEMA_PARAM) String jsonSchema) throws SchemaException {