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;
|
2016-10-18 10:52:05 +02:00
|
|
|
import java.util.UUID;
|
2016-09-12 14:45:05 +02:00
|
|
|
|
2018-10-02 09:19:56 +02:00
|
|
|
import org.gcube.informationsystem.model.reference.ER;
|
|
|
|
import org.gcube.informationsystem.model.reference.ISManageable;
|
|
|
|
import org.gcube.informationsystem.model.reference.entity.Context;
|
|
|
|
import org.gcube.informationsystem.model.reference.entity.Facet;
|
|
|
|
import org.gcube.informationsystem.model.reference.entity.Resource;
|
|
|
|
import org.gcube.informationsystem.model.reference.relation.ConsistsOf;
|
|
|
|
import org.gcube.informationsystem.model.reference.relation.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;
|
2017-01-12 16:39:53 +01:00
|
|
|
import org.gcube.informationsystem.types.TypeBinder.TypeDefinition;
|
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
|
|
|
|
2017-11-13 12:46:08 +01:00
|
|
|
public <ERType extends ER> boolean exists(Class<ERType> clazz, UUID uuid)
|
2018-06-04 15:31:13 +02:00
|
|
|
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException;
|
2018-06-11 16:20:52 +02:00
|
|
|
|
2017-11-13 12:46:08 +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
|
|
|
|
2017-11-02 14:42:31 +01:00
|
|
|
public <ERType extends ER> ERType getInstance(Class<ERType> clazz, UUID uuid)
|
2018-06-04 15:31:13 +02:00
|
|
|
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException;
|
2018-06-11 16:20:52 +02:00
|
|
|
|
2017-11-13 12:46:08 +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
|
|
|
|
2017-11-13 12:46:08 +01:00
|
|
|
public <ERType extends ER, R extends Resource> List<R> getInstances(Class<ERType> clazz, Boolean polymorphic)
|
|
|
|
throws ResourceRegistryException;
|
2018-06-11 16:20:52 +02:00
|
|
|
|
2017-11-13 12:46:08 +01:00
|
|
|
public String getInstances(String type, Boolean polymorphic) throws ResourceRegistryException;
|
2018-06-11 16:20:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
public <R extends Resource, C extends ConsistsOf<?,?>, F extends Facet> List<R> getResourcesFromReferenceFacet(
|
|
|
|
Class<R> resourceClass, Class<C> consistsOfClass, Class<F> facetClass, F referenceFacet,
|
|
|
|
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,
|
2019-01-17 11:18:02 +01:00
|
|
|
Map<String,String> map) 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,
|
2019-01-17 11:18:02 +01:00
|
|
|
boolean polymorphic, Map<String,String> map) throws ResourceRegistryException;
|
2018-06-11 16:20:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
public <R extends Resource, I extends IsRelatedTo<?,?>, RR extends Resource> List<R> getRelatedResourcesFromReferenceResource(
|
|
|
|
Class<R> resourceClass, Class<I> isRelatedToClass, Class<RR> referenceResourceClass, RR referenceResource,
|
|
|
|
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;
|
|
|
|
|
2018-06-12 16:06:48 +02:00
|
|
|
/*
|
2018-06-11 16:20:52 +02:00
|
|
|
public <E extends Entity, R extends Relation<?,?>, RE extends Entity> List<E> getRelated(Class<E> entityClass,
|
|
|
|
Class<R> relationClass, Class<RE> referenceEntityClass, Direction direction, boolean polymorphic,
|
|
|
|
Map<String,Object> map) throws ResourceRegistryException;
|
|
|
|
|
|
|
|
public String getRelated(String entityType, String relationType, String referenceEntityType, Direction direction,
|
|
|
|
boolean polymorphic, Map<String,Object> map) throws ResourceRegistryException;
|
|
|
|
|
|
|
|
public <E extends Entity, R extends Relation<?,?>, RE extends Entity> List<E> getRelated(Class<E> entityClass,
|
|
|
|
Class<R> relationClass, Class<RE> referenceEntityClass, RE referenceEntity, Direction direction,
|
|
|
|
boolean polymorphic) throws ResourceRegistryException;
|
|
|
|
|
|
|
|
public <E extends Entity, R extends Relation<?,?>, RE extends Entity> List<E> getRelated(Class<E> entityClass,
|
|
|
|
Class<R> relationClass, Class<RE> referenceEntityClass, UUID referenceEntityUUID, Direction direction,
|
|
|
|
boolean polymorphic) throws ResourceRegistryException;
|
|
|
|
|
|
|
|
public String getRelated(String entityType, String relationType, String referenceEntityType, UUID referenceEntity,
|
|
|
|
Direction direction, boolean polymorphic) throws ResourceRegistryException;
|
2018-06-12 16:06:48 +02:00
|
|
|
*/
|
2018-06-11 16:20:52 +02:00
|
|
|
|
|
|
|
|
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
|
|
|
|
2017-11-07 18:45:36 +01:00
|
|
|
public <ISM extends ISManageable> List<TypeDefinition> getSchema(Class<ISM> clazz, Boolean polymorphic)
|
|
|
|
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
|
|
|
|
2016-07-18 11:57:37 +02:00
|
|
|
}
|