From 93286a8a8501e0ceb6293f5451418f7670edc8f7 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Mon, 14 Nov 2016 15:36:13 +0000 Subject: [PATCH] refs #5748: Add "Add To Context API" in Resource Registry Publisher https://support.d4science.org/issues/5748 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry-publisher@134122 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../proxy/ResourceRegistryPublisher.java | 65 ++++++++++++------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/publisher/proxy/ResourceRegistryPublisher.java b/src/main/java/org/gcube/informationsystem/resourceregistry/publisher/proxy/ResourceRegistryPublisher.java index 7727f45..3ce8420 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/publisher/proxy/ResourceRegistryPublisher.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/publisher/proxy/ResourceRegistryPublisher.java @@ -1,36 +1,57 @@ package org.gcube.informationsystem.resourceregistry.publisher.proxy; +import java.util.UUID; + import org.gcube.informationsystem.model.entity.Facet; import org.gcube.informationsystem.model.entity.Resource; import org.gcube.informationsystem.model.relation.ConsistsOf; import org.gcube.informationsystem.model.relation.IsRelatedTo; +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.FacetNotFoundException; +import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.ResourceNotFoundException; /** * @author Luca Frosini (ISTI - CNR) */ public interface ResourceRegistryPublisher { - - public F createFacet(Class facetClass, F facet); - - public F updateFacet(Class facetClass, F facet); - - public boolean deleteFacet(F facet); - - - public R createResource(Class resourceClass, R resource); - - public boolean deleteResource(R resource); - - - - public > C createConsistsOf(Class consistsOfClass, C consistsOf); - - public > boolean deleteConsistsOf(C consistsOf); - - - public > I createIsRelatedTo(Class isRelatedToClass, I isRelatedTo); - - public > boolean deleteIsRelatedTo(I isRelatedTo); + public F createFacet(Class facetClass, F facet); + + public F updateFacet(Class facetClass, F facet); + + public boolean deleteFacet(F facet); + + public R createResource(Class resourceClass, + R resource); + + public boolean deleteResource(R resource); + + public > C createConsistsOf( + Class consistsOfClass, C consistsOf); + + public > boolean deleteConsistsOf( + C consistsOf); + + public > I createIsRelatedTo( + Class isRelatedToClass, I isRelatedTo); + + public > boolean deleteIsRelatedTo( + I isRelatedTo); + + public boolean addResourceToContext(UUID uuid) + throws ResourceNotFoundException, ContextNotFoundException, + ResourceRegistryException; + + public boolean addResourceToContext(R resource) + throws ResourceNotFoundException, ContextNotFoundException, + ResourceRegistryException; + + public boolean addFacetToContext(UUID uuid) throws FacetNotFoundException, + ContextNotFoundException, ResourceRegistryException; + + public boolean addFacetToContext(F facet) + throws FacetNotFoundException, ContextNotFoundException, + ResourceRegistryException; }