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
This commit is contained in:
Luca Frosini 2016-11-14 15:36:13 +00:00
parent 9385457e9e
commit 93286a8a85
1 changed files with 43 additions and 22 deletions

View File

@ -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 extends Facet> F createFacet(Class<F> facetClass, F facet);
public <F extends Facet> F updateFacet(Class<F> facetClass, F facet);
public <F extends Facet> boolean deleteFacet(F facet);
public <R extends Resource> R createResource(Class<R> resourceClass, R resource);
public <R extends Resource> boolean deleteResource(R resource);
public <C extends ConsistsOf<? extends Resource, ? extends Facet>> C createConsistsOf(Class<C> consistsOfClass, C consistsOf);
public <C extends ConsistsOf<? extends Resource, ? extends Facet>> boolean deleteConsistsOf(C consistsOf);
public <I extends IsRelatedTo<? extends Resource, ? extends Resource>> I createIsRelatedTo(Class<I> isRelatedToClass, I isRelatedTo);
public <I extends IsRelatedTo<? extends Resource, ? extends Resource>> boolean deleteIsRelatedTo(I isRelatedTo);
public <F extends Facet> F createFacet(Class<F> facetClass, F facet);
public <F extends Facet> F updateFacet(Class<F> facetClass, F facet);
public <F extends Facet> boolean deleteFacet(F facet);
public <R extends Resource> R createResource(Class<R> resourceClass,
R resource);
public <R extends Resource> boolean deleteResource(R resource);
public <C extends ConsistsOf<? extends Resource, ? extends Facet>> C createConsistsOf(
Class<C> consistsOfClass, C consistsOf);
public <C extends ConsistsOf<? extends Resource, ? extends Facet>> boolean deleteConsistsOf(
C consistsOf);
public <I extends IsRelatedTo<? extends Resource, ? extends Resource>> I createIsRelatedTo(
Class<I> isRelatedToClass, I isRelatedTo);
public <I extends IsRelatedTo<? extends Resource, ? extends Resource>> boolean deleteIsRelatedTo(
I isRelatedTo);
public boolean addResourceToContext(UUID uuid)
throws ResourceNotFoundException, ContextNotFoundException,
ResourceRegistryException;
public <R extends Resource> boolean addResourceToContext(R resource)
throws ResourceNotFoundException, ContextNotFoundException,
ResourceRegistryException;
public boolean addFacetToContext(UUID uuid) throws FacetNotFoundException,
ContextNotFoundException, ResourceRegistryException;
public <F extends Facet> boolean addFacetToContext(F facet)
throws FacetNotFoundException, ContextNotFoundException,
ResourceRegistryException;
}