Class TypeDefCache
java.lang.Object
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.cache.TypeDefCache
A shadow cache of all typeDef information.
This is necessary to maintain due to fact that caching in the OMRSRepositoryContentManager
does not occur until AFTER the OMRSMetadataCollection operation (i.e. addTypeDef) is fully completed: making it
impossible to use the repositoryHelper inside any method that addTypeDef itself may call.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddAttributeTypeDef(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.AttributeTypeDef typeDef) Cache the provided attribute type definition for use across threads.static voidaddTypeDef(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDef typeDef) Cache the provided type definition for use across threads.static Map<String,PropertyKeywords> getAllPropertyKeywordsForTypeDef(String typeDefGUID) Retrieve a map of all property keywords for the provided type definition.static List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefLink>getAllSuperTypes(String typeDefGUID) Retrieve a list of all supertypes of the provided type definition.getAllTypeDefsForProperty(String propertyName) Return the names of all type definitions that define the supplied property name.static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.AttributeTypeDefgetAttributeTypeDef(String typeDefGUID) Retrieve the attribute type definition for the given GUID.static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatusgetInitialStatus(String typeName) Retrieve the initial status to use for an instance of the supplied type.static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceTypegetInstanceType(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory category, String typeName) Retrieve the instance type representing the provided type definition.static PropertyKeywordsgetPropertyKeywords(String typeDefGUID, String propertyName) Retrieve the property keywords for the provided property in the specified type definition.static StringgetPropertyNamespaceForType(String typeDefGUID) Retrieve the namespace for the provided type definition's properties.static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefgetTypeDef(String typeDefGUID) Retrieve the type definition for the given GUID.static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefgetTypeDefByName(String typeDefName) Retrieve the type definition for the given name.static booleanValidate that an entity's type is of the expected/desired type, which may be a subtype of the expected type.static booleanisValidClassificationForEntity(String classificationTypeName, String entityTypeName) Return boolean indicating if a classification type can be applied to a specified entity.static voidremoveAttributeTypeDef(String typeDefGUID) Remove the cached attribute type definition.static voidremoveTypeDef(String typeDefGUID) Remove the cached type definition.
-
Constructor Details
-
TypeDefCache
public TypeDefCache()
-
-
Method Details
-
addTypeDef
public static void addTypeDef(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDef typeDef) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException Cache the provided type definition for use across threads.- Parameters:
typeDef- the type definition to cache- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- if there is any issue with the contents of the type definition
-
getTypeDef
public static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDef getTypeDef(String typeDefGUID) Retrieve the type definition for the given GUID.- Parameters:
typeDefGUID- unique identifier of the type definition- Returns:
- TypeDef that matches the GUID, or null if there is no such type definition
-
getTypeDefByName
public static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDef getTypeDefByName(String typeDefName) Retrieve the type definition for the given name.- Parameters:
typeDefName- unique name of the type definition- Returns:
- TypeDef that matches the name, or null if there is no such type definition
-
removeTypeDef
Remove the cached type definition.- Parameters:
typeDefGUID- unique identifier of the type definition to remove from the cache
-
addAttributeTypeDef
public static void addAttributeTypeDef(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.AttributeTypeDef typeDef) Cache the provided attribute type definition for use across threads.- Parameters:
typeDef- the attribute type definition to cache
-
getAttributeTypeDef
public static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.AttributeTypeDef getAttributeTypeDef(String typeDefGUID) Retrieve the attribute type definition for the given GUID.- Parameters:
typeDefGUID- unique identifier of the attribute type definition- Returns:
- AttributeTypeDef that matches the GUID, or null if there is no such attribute type definition
-
removeAttributeTypeDef
Remove the cached attribute type definition.- Parameters:
typeDefGUID- unique identifier of the attribute type definition to remove from the cache
-
getAllSuperTypes
public static List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefLink> getAllSuperTypes(String typeDefGUID) Retrieve a list of all supertypes of the provided type definition.- Parameters:
typeDefGUID- unique identifier of the type definition for which to retrieve all supertypes- Returns:
List<TypeDefLink>of all supertypes
-
getAllPropertyKeywordsForTypeDef
Retrieve a map of all property keywords for the provided type definition.- Parameters:
typeDefGUID- unique identifier of the type definition for which to retrieve all properties- Returns:
Map<String, PropertyKeywords>keyed by unqualified (simple) property name with the qualified property keywords as the value
-
getPropertyKeywords
Retrieve the property keywords for the provided property in the specified type definition.- Parameters:
typeDefGUID- unique identifier of the type definition for which to retrieve the propertypropertyName- name of the property for which to retrieve the keywords- Returns:
- PropertyKeywords
-
isTypeOf
Validate that an entity's type is of the expected/desired type, which may be a subtype of the expected type.- Parameters:
actualTypeName- name of the entity typeexpectedTypeName- name of the expected type- Returns:
- boolean if they match (a null in actualTypeName results in false; a null in expectedType results in true)
-
getAllTypeDefsForProperty
Return the names of all type definitions that define the supplied property name.- Parameters:
propertyName- property name to query.- Returns:
- set of names of the TypeDefs that define a property with this name
-
getPropertyNamespaceForType
Retrieve the namespace for the provided type definition's properties.- Parameters:
typeDefGUID- unique identifier of the type definition for which to retrieve the property namespace- Returns:
- String
-
getInstanceType
public static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceType getInstanceType(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory category, String typeName) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException Retrieve the instance type representing the provided type definition.- Parameters:
category- of the type definitiontypeName- of the type definition- Returns:
- InstanceType
- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException- if there are any errors determining or matching the type definition
-
getInitialStatus
public static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus getInitialStatus(String typeName) Retrieve the initial status to use for an instance of the supplied type.- Parameters:
typeName- of the type definition for which to retrieve the initial status- Returns:
- InstanceStatus
-
isValidClassificationForEntity
public static boolean isValidClassificationForEntity(String classificationTypeName, String entityTypeName) Return boolean indicating if a classification type can be applied to a specified entity.- Parameters:
classificationTypeName- name of the classification's type (ClassificationDef)entityTypeName- name of the entity's type (EntityDef)- Returns:
- boolean indicating if the classification is valid for the entity (true) or not (false)
-