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
|
|
|
|
2017-01-12 16:39:53 +01:00
|
|
|
import org.gcube.informationsystem.model.ER;
|
2017-01-25 15:34:53 +01:00
|
|
|
import org.gcube.informationsystem.model.ISManageable;
|
2017-11-07 18:45:36 +01:00
|
|
|
import org.gcube.informationsystem.model.entity.Context;
|
2017-01-12 16:39:53 +01:00
|
|
|
import org.gcube.informationsystem.model.entity.Entity;
|
2017-11-02 14:42:31 +01:00
|
|
|
import org.gcube.informationsystem.model.entity.Facet;
|
2017-01-13 17:57:33 +01:00
|
|
|
import org.gcube.informationsystem.model.entity.Resource;
|
2017-11-02 14:42:31 +01:00
|
|
|
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
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 {
|
2016-07-18 11:57:37 +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;
|
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;
|
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;
|
2017-11-02 14:42:31 +01: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;
|
2017-11-02 14:42:31 +01: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;
|
2017-11-02 14:42:31 +01:00
|
|
|
|
2017-11-13 12:46:08 +01:00
|
|
|
public String getInstances(String type, Boolean polymorphic) throws ResourceRegistryException;
|
|
|
|
|
|
|
|
public <ERType extends ER, E extends Entity, R extends Resource> List<R> getInstancesFromEntity(Class<ERType> clazz,
|
|
|
|
Boolean polymorphic, E reference, Direction direction) throws ResourceRegistryException;
|
2017-11-02 14:42:31 +01:00
|
|
|
|
2017-11-13 12:46:08 +01:00
|
|
|
public <ERType extends ER, R extends Resource> List<R> getInstancesFromEntity(Class<ERType> clazz,
|
|
|
|
Boolean polymorphic, UUID reference, Direction direction) throws ResourceRegistryException;
|
|
|
|
|
|
|
|
public String getInstancesFromEntity(String type, Boolean polymorphic, UUID reference, Direction direction)
|
|
|
|
throws ResourceRegistryException;
|
|
|
|
|
|
|
|
public <R extends Resource, F extends Facet, C extends ConsistsOf<?, ?>> List<R> getFilteredResources(
|
|
|
|
Class<R> resourceClass, Class<C> consistsOfClass, Class<F> facetClass, boolean polymorphic,
|
|
|
|
Map<String, Object> map) throws ResourceRegistryException;
|
|
|
|
|
|
|
|
public String getFilteredResources(String resourceType, String consistsOfType, String facetType,
|
2017-11-02 14:42:31 +01:00
|
|
|
boolean polymorphic, Map<String, Object> map) throws ResourceRegistryException;
|
2016-07-18 11:57:37 +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;
|
|
|
|
|
2017-11-07 18:45:36 +01:00
|
|
|
public <ISM extends ISManageable> List<TypeDefinition> getSchema(Class<ISM> clazz, Boolean polymorphic)
|
|
|
|
throws SchemaNotFoundException, ResourceRegistryException;
|
|
|
|
|
2017-11-13 12:46:08 +01:00
|
|
|
public Context getContext(UUID uuid) throws ContextNotFoundException, ResourceRegistryException;
|
2017-12-07 17:27:00 +01:00
|
|
|
|
|
|
|
public List<Context> getAllContext() throws ResourceRegistryException;
|
2017-11-07 18:45:36 +01:00
|
|
|
|
2016-07-18 11:57:37 +02:00
|
|
|
}
|