package org.gcube.informationsystem.resourceregistry.publisher; import java.util.List; import java.util.Set; import java.util.UUID; import org.gcube.informationsystem.context.reference.entities.Context; import org.gcube.informationsystem.model.reference.ERElement; import org.gcube.informationsystem.model.reference.entities.Facet; import org.gcube.informationsystem.model.reference.entities.Resource; import org.gcube.informationsystem.model.reference.relations.ConsistsOf; import org.gcube.informationsystem.model.reference.relations.IsRelatedTo; import org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException; import org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException; import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException; 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.FacetAvailableInAnotherContextException; 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.ResourceAvailableInAnotherContextException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.consistsOf.ConsistsOfAlreadyPresentException; import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.consistsOf.ConsistsOfAvailableInAnotherContextException; import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.consistsOf.ConsistsOfNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.isrelatedto.IsRelatedToAlreadyPresentException; import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.isrelatedto.IsRelatedToAvailableInAnotherContextException; import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.isrelatedto.IsRelatedToNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaViolationException; /** * @author Luca Frosini (ISTI - CNR) */ public interface ResourceRegistryPublisher { public List getAllContext() throws ResourceRegistryException; public Context getContext(UUID uuid) throws ContextNotFoundException, ResourceRegistryException; public Context getCurrentContext() throws ContextNotFoundException, ResourceRegistryException; /* ----- */ public List list(Class clazz, Boolean polymorphic) throws ResourceRegistryException; public String list(String type, Boolean polymorphic) throws ResourceRegistryException; public ERElem create(ERElem er) throws SchemaViolationException, AlreadyPresentException, ResourceRegistryException; public String create(String json) throws SchemaViolationException, AlreadyPresentException, ResourceRegistryException; public boolean exists(ERElem er) throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException; public boolean exists(Class clazz, UUID uuid) throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException; public boolean exists(String type, UUID uuid) throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException; public ERElem read(ERElem er) throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException; public ERElem read(Class clazz, UUID uuid) throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException; public String read(String type, UUID uuid) throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException; public ERElem update(ERElem er) throws SchemaViolationException, NotFoundException, ResourceRegistryException; public String update(String json) throws SchemaViolationException, NotFoundException, ResourceRegistryException; public String update(String type, String json) throws SchemaViolationException, NotFoundException, ResourceRegistryException; public String update(String type, String json, UUID uuid) throws SchemaViolationException, NotFoundException, ResourceRegistryException; public boolean delete(ERElem er) throws SchemaViolationException, NotFoundException, ResourceRegistryException; public boolean delete(String type, UUID uuid) throws SchemaViolationException, NotFoundException, ResourceRegistryException; /* ----- */ public F createFacet(F facet) throws SchemaViolationException, FacetAlreadyPresentException, ResourceRegistryException; public String createFacet(String facet) throws SchemaViolationException, FacetAlreadyPresentException, ResourceRegistryException; public F readFacet(F facet) throws FacetNotFoundException, FacetAvailableInAnotherContextException, ResourceRegistryException; public String readFacet(String facetType, UUID uuid) throws FacetNotFoundException, FacetAvailableInAnotherContextException, ResourceRegistryException; public F updateFacet(F facet) throws SchemaViolationException, FacetNotFoundException, ResourceRegistryException; public String updateFacet(String facet) throws SchemaViolationException, FacetNotFoundException, ResourceRegistryException; public boolean deleteFacet(F facet) throws SchemaViolationException, FacetNotFoundException, ResourceRegistryException; public boolean deleteFacet(String facetType, UUID uuid) throws SchemaViolationException, FacetNotFoundException, ResourceRegistryException; /* ----- */ public R createResource(R resource) throws SchemaViolationException, ResourceAlreadyPresentException, ResourceRegistryException; public String createResource(String resource) throws SchemaViolationException, ResourceAlreadyPresentException, ResourceRegistryException; public R readResource(R resource) throws ResourceNotFoundException, ResourceAvailableInAnotherContextException, ResourceRegistryException; public String readResource(String resourceType, UUID uuid) throws ResourceNotFoundException, ResourceAvailableInAnotherContextException, ResourceRegistryException; public R updateResource(R resource) throws SchemaViolationException, ResourceNotFoundException, ResourceRegistryException; public String updateResource(String resource) throws SchemaViolationException, ResourceNotFoundException, ResourceRegistryException; public boolean deleteResource(R resource) throws ResourceNotFoundException, ResourceRegistryException; public boolean deleteResource(String resourceType, UUID uuid) throws ResourceNotFoundException, ResourceRegistryException; /* ----- */ public > C createConsistsOf(C consistsOf) throws SchemaViolationException, ConsistsOfAlreadyPresentException, ResourceNotFoundException, ResourceRegistryException; public String createConsistsOf(String consistsOf) throws SchemaViolationException, ConsistsOfAlreadyPresentException, ResourceNotFoundException, ResourceRegistryException; public > C readConsistsOf(C consistsOf) throws ConsistsOfNotFoundException, ConsistsOfAvailableInAnotherContextException, ResourceRegistryException; public String readConsistsOf(String consistsOfType, UUID uuid) throws ConsistsOfNotFoundException, ConsistsOfAvailableInAnotherContextException, ResourceRegistryException; public > C updateConsistsOf(C consistsOf) throws SchemaViolationException, ConsistsOfNotFoundException, ResourceRegistryException; public String updateConsistsOf(String consistsOf) throws SchemaViolationException, ConsistsOfNotFoundException, ResourceRegistryException; public > boolean deleteConsistsOf(C consistsOf) throws SchemaViolationException, ConsistsOfNotFoundException, ResourceRegistryException; public boolean deleteConsistsOf(String consistsOfType, UUID uuid) throws SchemaViolationException, ConsistsOfNotFoundException, ResourceRegistryException; /* ----- */ public > I createIsRelatedTo(I isRelatedTo) throws SchemaViolationException, IsRelatedToAlreadyPresentException, ResourceNotFoundException, ResourceRegistryException; public String createIsRelatedTo(String isRelatedTo) throws SchemaViolationException, IsRelatedToAlreadyPresentException, ResourceNotFoundException, ResourceRegistryException; public > I readIsRelatedTo(I isRelatedTo) throws IsRelatedToNotFoundException, IsRelatedToAvailableInAnotherContextException, ResourceRegistryException; public String readIsRelatedTo(String isRelatedToType, UUID uuid) throws IsRelatedToNotFoundException, IsRelatedToAvailableInAnotherContextException, ResourceRegistryException; public > I updateIsRelatedTo(I isRelatedTo) throws SchemaViolationException, IsRelatedToNotFoundException, ResourceRegistryException; public String updateIsRelatedTo(String isRelatedTo) throws SchemaViolationException, IsRelatedToNotFoundException, ResourceRegistryException; public > boolean deleteIsRelatedTo(I isRelatedTo) throws IsRelatedToNotFoundException, ResourceRegistryException; public boolean deleteIsRelatedTo(String isRelatedToType, UUID uuid) throws IsRelatedToNotFoundException, ResourceRegistryException; /* ----- */ public List addToContext(String type, UUID instanceUUID, UUID contextUUID, Boolean dryRun) throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException; public List addToContext(ERElement er, UUID contextUUID, Boolean dryRun) throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException; public List addToCurrentContext(String type, UUID instanceUUID, Boolean dryRun) throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException; public List addToCurrentContext(ERElement er, Boolean dryRun) throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException; public List removeFromContext(String type, UUID instanceUUID, UUID contextUUID, Boolean dryRun) throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException; public List removeFromContext(ERElement er, UUID contextUUID, Boolean dryRun) throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException; public List removeFromCurrentContext(String type, UUID instanceUUID, Boolean dryRun) throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException; public List removeFromCurrentContext(ERElement er, Boolean dryRun) throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException; public Set getElementContexts(String type, UUID instanceUUID) throws NotFoundException, ResourceRegistryException; public Set getElementContexts(ERElem er) throws NotFoundException, ResourceRegistryException; /* ----- */ public List addResourceToContext(String resourceType, UUID resourceUUID, UUID contextUUID, Boolean dryRun) throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException; public List addResourceToContext(R resource, UUID contextUUID, Boolean dryRun) throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException; public List addResourceToCurrentContext(String resourceType, UUID resourceUUID, Boolean dryRun) throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException; public List addResourceToCurrentContext(R resource, Boolean dryRun) throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException; public List removeResourceFromContext(String resourceType, UUID resourceUUID, UUID contextUUID, Boolean dryRun) throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException; public List removeResourceFromContext(R resource, UUID contextUUID, Boolean dryRun) throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException; public List removeResourceFromCurrentContext(String resourceType, UUID resourceUUID, Boolean dryRun) throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException; public List removeResourceFromCurrentContext(R resource, Boolean dryRun) throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException; public Set getResourceContexts(String resourceType, UUID resourceUUID) throws ResourceNotFoundException, ResourceRegistryException; public Set getResourceContexts(R resource) throws ResourceNotFoundException, ResourceRegistryException; /* ----- */ public List addFacetToContext(String facetType, UUID facetUUID, UUID contextUUID, Boolean dryRun) throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException, ResourceRegistryException; public List addFacetToContext(F facet, UUID contextUUID, Boolean dryRun) throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException, ResourceRegistryException; public List addFacetToCurrentContext(String facetType, UUID facetUUID, Boolean dryRun) throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException, ResourceRegistryException; public List addFacetToCurrentContext(F facet, Boolean dryRun) throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException, ResourceRegistryException; public List removeFacetFromContext(String facetType, UUID facetUUID, UUID contextUUID, Boolean dryRun) throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException, ResourceRegistryException; public List removeFacetFromContext(F facet, UUID contextUUID, Boolean dryRun) throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException, ResourceRegistryException; public List removeFacetFromCurrentContext(String facetType, UUID facetUUID, Boolean dryRun) throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException, ResourceRegistryException; public List removeFacetFromCurrentContext(F facet, Boolean dryRun) throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException, ResourceRegistryException; public Set getFacetContexts(String facetType, UUID facetUUID) throws FacetNotFoundException, ResourceRegistryException; public Set getFacetContexts(F facet) throws FacetNotFoundException, ResourceRegistryException; }