package org.gcube.informationsystem.resourceregistry.publisher; 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.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 ResourceRegistryPublisher { public F createFacet(Class facetClass, F facet) throws FacetAlreadyPresentException, ResourceRegistryException; public String createFacet(String facetType, String facet) throws FacetAlreadyPresentException, ResourceRegistryException; public F updateFacet(Class facetClass, F facet) throws FacetNotFoundException, ResourceRegistryException; public String updateFacet(UUID uuid, String facet) throws FacetNotFoundException, ResourceRegistryException; public boolean deleteFacet(F facet) throws FacetNotFoundException, ResourceRegistryException; public boolean deleteFacet(UUID uuid) throws FacetNotFoundException, ResourceRegistryException; public R createResource(Class resourceClass, R resource) throws ResourceAlreadyPresentException, ResourceRegistryException; public String createResource(String resourceType, String resource) throws ResourceAlreadyPresentException, ResourceRegistryException; public R updateResource(Class resourceClass, R resource) throws ResourceNotFoundException, ResourceRegistryException; public String updateResource(UUID uuid, String resource) throws ResourceNotFoundException, ResourceRegistryException; public boolean deleteResource(R resource) throws ResourceNotFoundException, ResourceRegistryException; public boolean deleteResource(UUID uuid) throws ResourceNotFoundException, ResourceRegistryException; public > C createConsistsOf( Class consistsOfClass, C consistsOf) throws FacetNotFoundException, ResourceNotFoundException, ResourceRegistryException; public String createConsistsOf(String consistsOfType, String consistsOf) throws FacetNotFoundException, ResourceNotFoundException, ResourceRegistryException; public > boolean deleteConsistsOf( C consistsOf) throws ResourceRegistryException; public boolean deleteConsistsOf(UUID uuid) throws ResourceRegistryException; public > I createIsRelatedTo( Class isRelatedToClass, I isRelatedTo) throws ResourceNotFoundException, ResourceRegistryException; public String createIsRelatedTo(String isRelatedToType, String isRelatedTo) throws ResourceNotFoundException, ResourceRegistryException; public > boolean deleteIsRelatedTo( I isRelatedTo) throws ResourceRegistryException; public boolean deleteIsRelatedTo(UUID uuid) throws ResourceRegistryException; 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; public boolean removeResourceFromContext(UUID uuid) throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException; public boolean removeResourceFromContext(R resource) throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException; public boolean removeFacetFromContext(UUID uuid) throws FacetNotFoundException, ContextNotFoundException, ResourceRegistryException; public boolean removeFacetFromContext(F facet) throws FacetNotFoundException, ContextNotFoundException, ResourceRegistryException; }