Class ResourceRegistrySchemaClientImpl
- java.lang.Object
-
- org.gcube.informationsystem.resourceregistry.schema.ResourceRegistrySchemaClientImpl
-
- All Implemented Interfaces:
ResourceRegistrySchemaClient
public class ResourceRegistrySchemaClientImpl extends Object implements ResourceRegistrySchemaClient
- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringaddressprotected Map<String,String>headersprotected booleanincludeMetaTrack if the client must request to includeMetadataprotected org.gcube.informationsystem.types.knowledge.TypesKnowledgetypesKnowledge
-
Constructor Summary
Constructors Constructor Description ResourceRegistrySchemaClientImpl(String address)ResourceRegistrySchemaClientImpl(String address, boolean sharedModelKnowledge)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<org.gcube.informationsystem.types.reference.Type>addChildren(org.gcube.informationsystem.tree.Node<org.gcube.informationsystem.types.reference.Type> node, List<org.gcube.informationsystem.types.reference.Type> types, int currentLevel, int maxLevel)voidaddHeader(String name, String value)<ME extends org.gcube.informationsystem.model.reference.ModelElement>
org.gcube.informationsystem.types.reference.Typecreate(Class<ME> clz)Stringcreate(String typeDefinitition)<ME extends org.gcube.informationsystem.model.reference.ModelElement>
booleanexist(Class<ME> clazz)booleanexist(String typeName)booleanexistTypeFromServer(String typeName)protected org.gcube.common.gxhttp.request.GXHTTPStringRequestgetGXHTTPStringRequest()org.gcube.informationsystem.model.knowledge.ModelKnowledge<org.gcube.informationsystem.types.reference.Type,org.gcube.informationsystem.types.knowledge.TypeInformation>getModelKnowledge()<ME extends org.gcube.informationsystem.model.reference.ModelElement>
List<org.gcube.informationsystem.types.reference.Type>getTypeFromServer(Class<ME> clz, Boolean polymorphic)StringgetTypeFromServer(String typeName, Boolean polymorphic)List<org.gcube.informationsystem.types.reference.Type>getTypeFromTypesKnowledge(String typeName, int level)List<org.gcube.informationsystem.types.reference.Type>getTypeFromTypesKnowledge(String typeName, Boolean polymorphic)List<org.gcube.informationsystem.types.reference.Type>getTypeFromTypesKnowledge(String typeName, Boolean polymorphic, int level)<ME extends org.gcube.informationsystem.model.reference.ModelElement>
org.gcube.informationsystem.tree.Node<org.gcube.informationsystem.types.reference.Type>getTypeTreeNode(Class<ME> clazz)org.gcube.informationsystem.tree.Node<org.gcube.informationsystem.types.reference.Type>getTypeTreeNode(String typeName)booleanincludeMeta()<ME extends org.gcube.informationsystem.model.reference.ModelElement>
List<org.gcube.informationsystem.types.reference.Type>read(Class<ME> clazz, int level)<ME extends org.gcube.informationsystem.model.reference.ModelElement>
List<org.gcube.informationsystem.types.reference.Type>read(Class<ME> clazz, Boolean polymorphic)Stringread(String typeName, int level)Stringread(String typeName, Boolean polymorphic)voidrenewModelKnowledge()voidsetIncludeMeta(boolean includeMeta)
-
-
-
Method Detail
-
includeMeta
public boolean includeMeta()
-
setIncludeMeta
public void setIncludeMeta(boolean includeMeta)
-
addHeader
public void addHeader(String name, String value)
- Specified by:
addHeaderin interfaceResourceRegistrySchemaClient
-
getGXHTTPStringRequest
protected org.gcube.common.gxhttp.request.GXHTTPStringRequest getGXHTTPStringRequest()
-
getModelKnowledge
public org.gcube.informationsystem.model.knowledge.ModelKnowledge<org.gcube.informationsystem.types.reference.Type,org.gcube.informationsystem.types.knowledge.TypeInformation> getModelKnowledge()
- Specified by:
getModelKnowledgein interfaceResourceRegistrySchemaClient
-
renewModelKnowledge
public void renewModelKnowledge()
- Specified by:
renewModelKnowledgein interfaceResourceRegistrySchemaClient
-
create
public <ME extends org.gcube.informationsystem.model.reference.ModelElement> org.gcube.informationsystem.types.reference.Type create(Class<ME> clz) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
createin interfaceResourceRegistrySchemaClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
create
public String create(String typeDefinitition) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
createin interfaceResourceRegistrySchemaClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
exist
public <ME extends org.gcube.informationsystem.model.reference.ModelElement> boolean exist(Class<ME> clazz) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
existin interfaceResourceRegistrySchemaClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
exist
public boolean exist(String typeName) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
existin interfaceResourceRegistrySchemaClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getTypeFromTypesKnowledge
public List<org.gcube.informationsystem.types.reference.Type> getTypeFromTypesKnowledge(String typeName, Boolean polymorphic) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getTypeFromTypesKnowledge
public List<org.gcube.informationsystem.types.reference.Type> getTypeFromTypesKnowledge(String typeName, int level) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
addChildren
protected List<org.gcube.informationsystem.types.reference.Type> addChildren(org.gcube.informationsystem.tree.Node<org.gcube.informationsystem.types.reference.Type> node, List<org.gcube.informationsystem.types.reference.Type> types, int currentLevel, int maxLevel)
-
getTypeFromTypesKnowledge
public List<org.gcube.informationsystem.types.reference.Type> getTypeFromTypesKnowledge(String typeName, Boolean polymorphic, int level) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
read
public String read(String typeName, Boolean polymorphic) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
readin interfaceResourceRegistrySchemaClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
read
public <ME extends org.gcube.informationsystem.model.reference.ModelElement> List<org.gcube.informationsystem.types.reference.Type> read(Class<ME> clazz, Boolean polymorphic) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
readin interfaceResourceRegistrySchemaClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
read
public String read(String typeName, int level) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
readin interfaceResourceRegistrySchemaClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
read
public <ME extends org.gcube.informationsystem.model.reference.ModelElement> List<org.gcube.informationsystem.types.reference.Type> read(Class<ME> clazz, int level) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
readin interfaceResourceRegistrySchemaClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getTypeTreeNode
public org.gcube.informationsystem.tree.Node<org.gcube.informationsystem.types.reference.Type> getTypeTreeNode(String typeName) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
getTypeTreeNodein interfaceResourceRegistrySchemaClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getTypeTreeNode
public <ME extends org.gcube.informationsystem.model.reference.ModelElement> org.gcube.informationsystem.tree.Node<org.gcube.informationsystem.types.reference.Type> getTypeTreeNode(Class<ME> clazz) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
getTypeTreeNodein interfaceResourceRegistrySchemaClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
existTypeFromServer
public boolean existTypeFromServer(String typeName) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getTypeFromServer
public <ME extends org.gcube.informationsystem.model.reference.ModelElement> List<org.gcube.informationsystem.types.reference.Type> getTypeFromServer(Class<ME> clz, Boolean polymorphic) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getTypeFromServer
public String getTypeFromServer(String typeName, Boolean polymorphic) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
-