Class CachedType<T extends org.gcube.informationsystem.types.reference.Type>
java.lang.Object
org.gcube.informationsystem.resourceregistry.persistence.orientdb.types.CachedType<T>
- Type Parameters:
T- the specific Type subclass
Represents a cached representation of a metadata schema type, providing
high-performance schema lookup and type hierarchy traversal.
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.gcube.informationsystem.base.reference.AccessTypeThe access type category of the schema type.protected com.orientechnologies.orient.core.metadata.schema.OClassThe cached OrientDB schema class.The cached list of subtype names.The cached list of supertype names.protected TThe cached strongly-typed schema model instance.protected final StringThe unique name of the schema type. -
Constructor Summary
ConstructorsConstructorDescriptionCachedType(String typeName) Creates a newCachedTypeinstance for the specified type name. -
Method Summary
Modifier and TypeMethodDescriptionbooleanorg.gcube.informationsystem.base.reference.AccessTypeReturns the access type category of this type, retrieving it if not cached.Set<org.gcube.informationsystem.types.reference.properties.PropertyDefinition>Returns the property definitions of this type, including those inherited from all of its supertypes.Recursively retrieves the list of all subclasses for this schema class.com.orientechnologies.orient.core.metadata.schema.OClassReturns the OrientDB schema class of this type, retrieving it if not cached.Returns the list of subtype names of this type, retrieving them if not cached.Returns the list of supertype names of this type, retrieving them if not cached.getType()Returns the strongly-typed schema model instance of this type, retrieving it if not cached.inthashCode()voidsetOClass(com.orientechnologies.orient.core.metadata.schema.OClass oClass) Manually sets the OrientDB schema class of this type, caching it if not already set.
-
Field Details
-
typeName
The unique name of the schema type. -
oClass
protected com.orientechnologies.orient.core.metadata.schema.OClass oClassThe cached OrientDB schema class. -
accessType
protected org.gcube.informationsystem.base.reference.AccessType accessTypeThe access type category of the schema type. -
type
The cached strongly-typed schema model instance. -
supertypes
The cached list of supertype names. -
subTypes
The cached list of subtype names.
-
-
Constructor Details
-
CachedType
Creates a newCachedTypeinstance for the specified type name.- Parameters:
typeName- the unique name of the schema type
-
-
Method Details
-
setOClass
public void setOClass(com.orientechnologies.orient.core.metadata.schema.OClass oClass) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Manually sets the OrientDB schema class of this type, caching it if not already set.- Parameters:
oClass- the OrientDB schema class to cache- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException- if the type is not registeredorg.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException- if the schema definition is invalidorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- on database error
-
getAllSubclasses
protected List<String> getAllSubclasses() throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionRecursively retrieves the list of all subclasses for this schema class.- Returns:
- the list of all subclasses
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException- if the schema definition is invalidorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- on database error
-
getOClass
public com.orientechnologies.orient.core.metadata.schema.OClass getOClass() throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionReturns the OrientDB schema class of this type, retrieving it if not cached.- Returns:
- the OrientDB schema class
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException- if the type is not registeredorg.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException- if the schema definition is invalidorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- on database error
-
getType
public T getType() throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionReturns the strongly-typed schema model instance of this type, retrieving it if not cached.- Returns:
- the strongly-typed schema model
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException- if the type is not registeredorg.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException- if the schema definition is invalidorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- on database error
-
getAccessType
public org.gcube.informationsystem.base.reference.AccessType getAccessType() throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionReturns the access type category of this type, retrieving it if not cached.- Returns:
- the access type category
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException- if the type is not registeredorg.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException- if the schema definition is invalidorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- on database error
-
getSupertypes
public List<String> getSupertypes() throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionReturns the list of supertype names of this type, retrieving them if not cached.- Returns:
- the list of supertype names
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException- if the schema definition is invalidorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- on database error
-
getSubTypes
public List<String> getSubTypes() throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionReturns the list of subtype names of this type, retrieving them if not cached.- Returns:
- the list of subtype names
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException- if the schema definition is invalidorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- on database error
-
getAllProperties
public Set<org.gcube.informationsystem.types.reference.properties.PropertyDefinition> getAllProperties() throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionReturns the property definitions of this type, including those inherited from all of its supertypes.- Returns:
- the property definitions
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException- if the schema definition is invalidorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- on database error
-
hashCode
public int hashCode() -
equals
-