2017-04-03 18:44:47 +02:00
|
|
|
package org.gcube.informationsystem.resourceregistry.client;
|
2016-07-18 11:57:37 +02:00
|
|
|
|
2017-01-12 16:39:53 +01:00
|
|
|
import java.util.List;
|
2017-11-02 14:42:31 +01:00
|
|
|
import java.util.Map;
|
2020-11-11 14:18:12 +01:00
|
|
|
import java.util.Set;
|
2016-10-18 10:52:05 +02:00
|
|
|
import java.util.UUID;
|
2016-09-12 14:45:05 +02:00
|
|
|
|
2019-10-25 17:45:39 +02:00
|
|
|
import org.gcube.informationsystem.context.reference.entities.Context;
|
2021-09-14 16:34:20 +02:00
|
|
|
import org.gcube.informationsystem.model.reference.ERElement;
|
2019-02-06 10:01:35 +01:00
|
|
|
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;
|
2018-06-04 15:31:13 +02:00
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException;
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
2016-10-18 10:52:05 +02:00
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
2017-11-07 18:45:36 +01:00
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
|
2017-01-12 16:39:53 +01:00
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.query.InvalidQueryException;
|
2016-10-18 10:52:05 +02:00
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException;
|
2020-02-03 10:52:24 +01:00
|
|
|
import org.gcube.informationsystem.types.reference.Type;
|
2016-07-18 11:57:37 +02:00
|
|
|
|
|
|
|
/**
|
2016-10-12 14:35:20 +02:00
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
2016-07-18 11:57:37 +02:00
|
|
|
*/
|
2016-10-18 10:52:05 +02:00
|
|
|
public interface ResourceRegistryClient {
|
2018-06-11 16:20:52 +02:00
|
|
|
|
2021-09-14 16:34:20 +02:00
|
|
|
public <ERElem extends ERElement> List<ERElem> getInstances(Class<ERElem> clazz, Boolean polymorphic)
|
2021-07-05 17:32:29 +02:00
|
|
|
throws ResourceRegistryException;
|
|
|
|
|
|
|
|
public String getInstances(String type, Boolean polymorphic) throws ResourceRegistryException;
|
|
|
|
|
2021-09-14 16:34:20 +02:00
|
|
|
public <ERElem extends ERElement> boolean exists(Class<ERElem> clazz, UUID uuid)
|
2018-06-04 15:31:13 +02:00
|
|
|
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException;
|
2018-06-11 16:20:52 +02:00
|
|
|
|
2020-11-11 14:18:12 +01:00
|
|
|
public boolean exists(String type, UUID uuid)
|
2018-06-04 15:31:13 +02:00
|
|
|
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException;
|
2018-06-11 16:20:52 +02:00
|
|
|
|
2021-09-14 16:34:20 +02:00
|
|
|
public <ERElem extends ERElement> ERElem getInstance(Class<ERElem> clazz, UUID uuid)
|
2018-06-04 15:31:13 +02:00
|
|
|
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException;
|
2018-06-11 16:20:52 +02:00
|
|
|
|
2020-11-11 14:18:12 +01:00
|
|
|
public String getInstance(String type, UUID uuid)
|
2018-06-04 15:31:13 +02:00
|
|
|
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException;
|
2018-06-11 16:20:52 +02:00
|
|
|
|
|
|
|
public <R extends Resource, C extends ConsistsOf<?,?>, F extends Facet> List<R> getResourcesFromReferenceFacet(
|
2021-07-07 17:35:49 +02:00
|
|
|
Class<R> resourceClass, Class<C> consistsOfClass, F referenceFacet,
|
2018-06-11 16:20:52 +02:00
|
|
|
boolean polymorphic) throws ResourceRegistryException;
|
|
|
|
|
|
|
|
public <R extends Resource, C extends ConsistsOf<?,?>, F extends Facet> List<R> getResourcesFromReferenceFacet(
|
|
|
|
Class<R> resourceClass, Class<C> consistsOfClass, Class<F> facetClass, UUID referenceFacetUUID,
|
|
|
|
boolean polymorphic) throws ResourceRegistryException;
|
|
|
|
|
|
|
|
public String getResourcesFromReferenceFacet(String resourceType, String consistsOfType, String facetType,
|
|
|
|
UUID referenceFacetUUID, boolean polymorphic) throws ResourceRegistryException;
|
|
|
|
|
|
|
|
|
|
|
|
public <R extends Resource, C extends ConsistsOf<?,?>, F extends Facet> List<R> getFilteredResources(
|
2017-11-13 12:46:08 +01:00
|
|
|
Class<R> resourceClass, Class<C> consistsOfClass, Class<F> facetClass, boolean polymorphic,
|
2021-07-07 17:35:49 +02:00
|
|
|
Map<String,String> facetConstraint) throws ResourceRegistryException;
|
2018-06-11 16:20:52 +02:00
|
|
|
|
2017-11-13 12:46:08 +01:00
|
|
|
public String getFilteredResources(String resourceType, String consistsOfType, String facetType,
|
2021-07-07 17:35:49 +02:00
|
|
|
boolean polymorphic, Map<String,String> facetConstraint) throws ResourceRegistryException;
|
2018-06-11 16:20:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
public <R extends Resource, I extends IsRelatedTo<?,?>, RR extends Resource> List<R> getRelatedResourcesFromReferenceResource(
|
2021-07-07 17:35:49 +02:00
|
|
|
Class<R> resourceClass, Class<I> isRelatedToClass, RR referenceResource,
|
2018-06-11 16:20:52 +02:00
|
|
|
Direction direction, boolean polymorphic) throws ResourceRegistryException;
|
|
|
|
|
|
|
|
public <R extends Resource, I extends IsRelatedTo<?,?>, RR extends Resource> List<R> getRelatedResourcesFromReferenceResource(
|
|
|
|
Class<R> resourceClass, Class<I> isRelatedToClass, Class<RR> referenceResourceClass, UUID referenceResourceUUID,
|
|
|
|
Direction direction, boolean polymorphic) throws ResourceRegistryException;
|
|
|
|
|
|
|
|
public String getRelatedResourcesFromReferenceResource(String resourceType, String isRelatedToType,
|
|
|
|
String referenceResourceType, UUID referenceResourceUUID, Direction direction, boolean polymorphic)
|
|
|
|
throws ResourceRegistryException;
|
|
|
|
|
|
|
|
|
|
|
|
public <R extends Resource, I extends IsRelatedTo<?,?>, RR extends Resource> List<R> getRelatedResources(
|
|
|
|
Class<R> resourceClass, Class<I> isRelatedToClass, Class<RR> referenceResourceClass, Direction direction,
|
|
|
|
boolean polymorphic) throws ResourceRegistryException;
|
|
|
|
|
|
|
|
public String getRelatedResources(String resourceType, String isRelatedToType, String referenceResourceType,
|
|
|
|
Direction direction, boolean polymorphic) throws ResourceRegistryException;
|
|
|
|
|
2017-11-13 12:46:08 +01:00
|
|
|
public String query(final String query, final int limit, final String fetchPlan)
|
|
|
|
throws InvalidQueryException, ResourceRegistryException;
|
2018-06-11 16:20:52 +02:00
|
|
|
|
2019-01-21 11:41:16 +01:00
|
|
|
public String query(final String query, final int limit, final String fetchPlan, boolean raw)
|
|
|
|
throws InvalidQueryException, ResourceRegistryException;
|
|
|
|
|
2021-09-15 11:45:05 +02:00
|
|
|
public <ERElem extends ERElement> List<Type> getSchema(Class<ERElem> clazz, Boolean polymorphic)
|
2017-11-07 18:45:36 +01:00
|
|
|
throws SchemaNotFoundException, ResourceRegistryException;
|
2018-06-11 16:20:52 +02:00
|
|
|
|
2017-11-13 12:46:08 +01:00
|
|
|
public Context getContext(UUID uuid) throws ContextNotFoundException, ResourceRegistryException;
|
2017-12-07 17:27:00 +01:00
|
|
|
|
2018-06-12 11:23:50 +02:00
|
|
|
public Context getCurrentContext() throws ContextNotFoundException, ResourceRegistryException;
|
|
|
|
|
2017-12-07 17:27:00 +01:00
|
|
|
public List<Context> getAllContext() throws ResourceRegistryException;
|
2018-06-11 16:20:52 +02:00
|
|
|
|
2021-09-14 16:34:20 +02:00
|
|
|
public <ERElem extends ERElement> Set<UUID> getInstanceContexts(Class<ERElem> clazz, UUID uuid)
|
2020-11-11 14:18:12 +01:00
|
|
|
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException;
|
|
|
|
|
|
|
|
public Set<UUID> getInstanceContexts(String type, UUID uuid)
|
|
|
|
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException;
|
|
|
|
|
2016-07-18 11:57:37 +02:00
|
|
|
}
|