2017-04-03 18:44:47 +02:00
|
|
|
package org.gcube.informationsystem.resourceregistry.publisher;
|
2016-09-14 18:08:46 +02:00
|
|
|
|
2016-11-14 16:36:13 +01:00
|
|
|
import java.util.UUID;
|
|
|
|
|
2016-09-14 18:08:46 +02:00
|
|
|
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;
|
2016-11-14 16:36:13 +01:00
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
|
2017-02-24 12:46:18 +01:00
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetAlreadyPresentException;
|
2016-11-29 08:27:30 +01:00
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetNotFoundException;
|
2017-02-24 12:46:18 +01:00
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceAlreadyPresentException;
|
2016-11-29 08:27:30 +01:00
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException;
|
2016-09-14 18:08:46 +02:00
|
|
|
|
2016-10-12 14:36:27 +02:00
|
|
|
/**
|
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
|
|
*/
|
2016-09-14 18:08:46 +02:00
|
|
|
public interface ResourceRegistryPublisher {
|
2017-02-24 12:46:18 +01:00
|
|
|
|
|
|
|
public <F extends Facet> F createFacet(Class<F> facetClass, F facet) throws FacetAlreadyPresentException, ResourceRegistryException;
|
2016-11-14 16:36:13 +01:00
|
|
|
|
2017-10-02 18:28:47 +02:00
|
|
|
public String createFacet(String facetType, String facet) throws FacetAlreadyPresentException, ResourceRegistryException;
|
|
|
|
|
2017-02-24 12:46:18 +01:00
|
|
|
public <F extends Facet> F updateFacet(Class<F> facetClass, F facet) throws FacetNotFoundException, ResourceRegistryException;
|
2016-11-14 16:36:13 +01:00
|
|
|
|
2017-10-02 18:28:47 +02:00
|
|
|
public String updateFacet(UUID uuid, String facet) throws FacetNotFoundException, ResourceRegistryException;
|
|
|
|
|
2017-02-24 12:46:18 +01:00
|
|
|
public <F extends Facet> boolean deleteFacet(F facet) throws FacetNotFoundException, ResourceRegistryException;
|
2016-11-14 16:36:13 +01:00
|
|
|
|
2017-04-18 11:49:34 +02:00
|
|
|
public boolean deleteFacet(UUID uuid) throws FacetNotFoundException, ResourceRegistryException;
|
2017-02-24 12:46:18 +01:00
|
|
|
|
2017-10-02 18:28:47 +02:00
|
|
|
|
2016-11-14 16:36:13 +01:00
|
|
|
public <R extends Resource> R createResource(Class<R> resourceClass,
|
2017-02-24 12:46:18 +01:00
|
|
|
R resource) throws ResourceAlreadyPresentException, ResourceRegistryException;
|
2016-11-28 12:49:27 +01:00
|
|
|
|
2017-10-02 18:28:47 +02:00
|
|
|
public String createResource(String resourceType, String resource) throws ResourceAlreadyPresentException, ResourceRegistryException;
|
|
|
|
|
2017-02-24 12:46:18 +01:00
|
|
|
public <R extends Resource> R updateResource(Class<R> resourceClass, R resource) throws ResourceNotFoundException, ResourceRegistryException;
|
2016-11-28 12:49:27 +01:00
|
|
|
|
2017-10-02 18:28:47 +02:00
|
|
|
public String updateResource(UUID uuid, String resource) throws ResourceNotFoundException, ResourceRegistryException;
|
|
|
|
|
2017-02-24 12:46:18 +01:00
|
|
|
public <R extends Resource> boolean deleteResource(R resource) throws ResourceNotFoundException, ResourceRegistryException;
|
2016-09-14 18:08:46 +02:00
|
|
|
|
2017-04-18 11:49:34 +02:00
|
|
|
public boolean deleteResource(UUID uuid) throws ResourceNotFoundException, ResourceRegistryException;
|
|
|
|
|
2017-02-24 12:46:18 +01:00
|
|
|
|
2016-11-14 16:36:13 +01:00
|
|
|
public <C extends ConsistsOf<? extends Resource, ? extends Facet>> C createConsistsOf(
|
2017-02-24 12:46:18 +01:00
|
|
|
Class<C> consistsOfClass, C consistsOf) throws FacetNotFoundException, ResourceNotFoundException, ResourceRegistryException;
|
2016-11-14 16:36:13 +01:00
|
|
|
|
2017-10-02 18:28:47 +02:00
|
|
|
public String createConsistsOf(String consistsOfType, String consistsOf) throws FacetNotFoundException, ResourceNotFoundException, ResourceRegistryException;
|
|
|
|
|
2016-11-14 16:36:13 +01:00
|
|
|
public <C extends ConsistsOf<? extends Resource, ? extends Facet>> boolean deleteConsistsOf(
|
2017-02-24 11:51:22 +01:00
|
|
|
C consistsOf) throws ResourceRegistryException;
|
2017-02-24 12:46:18 +01:00
|
|
|
|
|
|
|
public boolean deleteConsistsOf(UUID uuid) throws ResourceRegistryException;
|
|
|
|
|
|
|
|
|
2016-11-14 16:36:13 +01:00
|
|
|
public <I extends IsRelatedTo<? extends Resource, ? extends Resource>> I createIsRelatedTo(
|
2017-02-24 12:46:18 +01:00
|
|
|
Class<I> isRelatedToClass, I isRelatedTo) throws ResourceNotFoundException, ResourceRegistryException;
|
2017-10-02 18:28:47 +02:00
|
|
|
|
|
|
|
public String createIsRelatedTo(String isRelatedToType, String isRelatedTo) throws ResourceNotFoundException, ResourceRegistryException;
|
|
|
|
|
2016-11-14 16:36:13 +01:00
|
|
|
public <I extends IsRelatedTo<? extends Resource, ? extends Resource>> boolean deleteIsRelatedTo(
|
2017-02-24 11:51:22 +01:00
|
|
|
I isRelatedTo) throws ResourceRegistryException;
|
2016-11-14 16:36:13 +01:00
|
|
|
|
2017-02-24 12:46:18 +01:00
|
|
|
public boolean deleteIsRelatedTo(UUID uuid) throws ResourceRegistryException;
|
2017-02-24 11:51:22 +01:00
|
|
|
|
|
|
|
|
2016-11-14 16:36:13 +01:00
|
|
|
public boolean addResourceToContext(UUID uuid)
|
|
|
|
throws ResourceNotFoundException, ContextNotFoundException,
|
|
|
|
ResourceRegistryException;
|
|
|
|
|
|
|
|
public <R extends Resource> boolean addResourceToContext(R resource)
|
|
|
|
throws ResourceNotFoundException, ContextNotFoundException,
|
|
|
|
ResourceRegistryException;
|
|
|
|
|
2017-02-24 12:46:18 +01:00
|
|
|
|
2016-11-14 16:36:13 +01:00
|
|
|
public boolean addFacetToContext(UUID uuid) throws FacetNotFoundException,
|
|
|
|
ContextNotFoundException, ResourceRegistryException;
|
|
|
|
|
|
|
|
public <F extends Facet> boolean addFacetToContext(F facet)
|
|
|
|
throws FacetNotFoundException, ContextNotFoundException,
|
|
|
|
ResourceRegistryException;
|
2016-09-14 18:08:46 +02:00
|
|
|
|
2016-12-21 16:29:37 +01:00
|
|
|
|
|
|
|
public boolean removeResourceFromContext(UUID uuid)
|
|
|
|
throws ResourceNotFoundException, ContextNotFoundException,
|
|
|
|
ResourceRegistryException;
|
|
|
|
|
|
|
|
public <R extends Resource> boolean removeResourceFromContext(R resource)
|
|
|
|
throws ResourceNotFoundException, ContextNotFoundException,
|
|
|
|
ResourceRegistryException;
|
|
|
|
|
2017-02-24 12:46:18 +01:00
|
|
|
|
2016-12-21 16:29:37 +01:00
|
|
|
public boolean removeFacetFromContext(UUID uuid) throws FacetNotFoundException,
|
|
|
|
ContextNotFoundException, ResourceRegistryException;
|
|
|
|
|
|
|
|
public <F extends Facet> boolean removeFacetFromContext(F facet)
|
|
|
|
throws FacetNotFoundException, ContextNotFoundException,
|
|
|
|
ResourceRegistryException;
|
2016-09-14 18:08:46 +02:00
|
|
|
}
|