Class ClassificationMapping
- java.lang.Object
-
- org.odpi.egeria.connectors.juxt.crux.mapping.AbstractMapping
-
- org.odpi.egeria.connectors.juxt.crux.mapping.InstanceAuditHeaderMapping
-
- org.odpi.egeria.connectors.juxt.crux.mapping.ClassificationMapping
-
public class ClassificationMapping extends InstanceAuditHeaderMapping
Maps the properties of Classifications between persistence and objects. The idea is to map Classifications into a Crux data model that flattens their structure into the EntitySummary structure itself (so they are always retrieved with the EntitySummary document), using the following convention:{ ... :classifications.Confidentiality/type :type/(GUID) :classifications.Confidentiality/instanceLicense "" :classifications.Confidentiality/createTime #inst "2021-01-26T16:35:37.504-00:00" :classifications.Confidentiality.classificationProperties/level ... ... :classifications.AnotherClassification/type :type/(GUID) :classifications.AnotherClassification/createTime #inst "2021-01-26T16:30:37.504-00:00" :classifications.AnotherClassification.classificationProperties/property ... ... }In this way, each classification can be kept separate from other classifications, and a single classification's value remains mutually-exclusive with any other values for that classification (due to the unique reference name of the properties of that classification).
-
-
Field Summary
Fields Modifier and Type Field Description static StringCLASSIFICATION_PROPERTIES_NSstatic StringN_LAST_CLASSIFICATION_CHANGE-
Fields inherited from class org.odpi.egeria.connectors.juxt.crux.mapping.InstanceAuditHeaderMapping
CREATE_TIME, CURRENT_STATUS, METADATA_COLLECTION_ID, TYPE_DEF_CATEGORY, TYPE_DEF_GUIDS, UPDATE_TIME, VERSION
-
Fields inherited from class org.odpi.egeria.connectors.juxt.crux.mapping.AbstractMapping
cruxConnector, mapper
-
-
Constructor Summary
Constructors Constructor Description ClassificationMapping(CruxOMRSRepositoryConnector cruxConnector, crux.api.CruxDocument cruxDoc, String namespace)Construct a mapping from a Crux map (to map to an Egeria representation).ClassificationMapping(CruxOMRSRepositoryConnector cruxConnector, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification> classifications, String namespace)Construct a mapping from a Classification (to map to a Crux representation).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToCruxDoc(crux.api.CruxDocument.Builder builder)Add the details of the mapping to the provided CruxDocument builder.protected List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification>fromDoc()Translate the provided Crux representation into an Egeria representation.static StringgetClassificationNameFromNamespace(String root, String qualifiedNamespace)Given a fully-qualified classification namespace and a root, parse out the name of the classification.static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ClassificationOrigingetClassificationOriginFromSymbolicName(CruxOMRSRepositoryConnector cruxConnector, String symbolicName)Convert the provided symbolic name into its ClassificationOrigin.static StringgetNamespaceForClassification(String root, String classificationName)Given a classification name and qualifying namespace, convert into a qualified name that can be used for the classification-specific namespace.static StringgetNamespaceForProperties(String qualifiedRoot)Retrieve the namespace for properties of the classificationstatic StringgetSymbolicNameForClassificationOrigin(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ClassificationOrigin co)Convert the provided ClassificationOrigin into its symbolic name.static booleanisKnownBaseProperty(String property)Check whether the specified property is a known base-level Classification property.List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification>toEgeria()Map from Crux to Egeria.-
Methods inherited from class org.odpi.egeria.connectors.juxt.crux.mapping.InstanceAuditHeaderMapping
buildDoc, buildDoc, fromDoc, fromDoc
-
Methods inherited from class org.odpi.egeria.connectors.juxt.crux.mapping.AbstractMapping
getDeserializedValue, getEmbeddedSerializedForm, getKeyword, getKeyword
-
-
-
-
Field Detail
-
CLASSIFICATION_PROPERTIES_NS
public static final String CLASSIFICATION_PROPERTIES_NS
- See Also:
- Constant Field Values
-
N_LAST_CLASSIFICATION_CHANGE
public static final String N_LAST_CLASSIFICATION_CHANGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClassificationMapping
public ClassificationMapping(CruxOMRSRepositoryConnector cruxConnector, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification> classifications, String namespace)
Construct a mapping from a Classification (to map to a Crux representation).- Parameters:
cruxConnector- connectivity to Cruxclassifications- from which to mapnamespace- under which to qualify the classifications
-
ClassificationMapping
public ClassificationMapping(CruxOMRSRepositoryConnector cruxConnector, crux.api.CruxDocument cruxDoc, String namespace)
Construct a mapping from a Crux map (to map to an Egeria representation).- Parameters:
cruxConnector- connectivity to CruxcruxDoc- from which to mapnamespace- under which the classifications are qualified
-
-
Method Detail
-
isKnownBaseProperty
public static boolean isKnownBaseProperty(String property)
Check whether the specified property is a known base-level Classification property.- Parameters:
property- to check- Returns:
- boolean
-
addToCruxDoc
public void addToCruxDoc(crux.api.CruxDocument.Builder builder)
Add the details of the mapping to the provided CruxDocument builder.- Parameters:
builder- into which to add the classification details
-
toEgeria
public List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification> toEgeria()
Map from Crux to Egeria.- Returns:
List<Classification>- See Also:
ClassificationMapping(CruxOMRSRepositoryConnector, CruxDocument, String)
-
fromDoc
protected List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification> fromDoc()
Translate the provided Crux representation into an Egeria representation.- Returns:
List<Classification>
-
getNamespaceForClassification
public static String getNamespaceForClassification(String root, String classificationName)
Given a classification name and qualifying namespace, convert into a qualified name that can be used for the classification-specific namespace.- Parameters:
root- namespaceclassificationName- of the classification- Returns:
- String qualified namespace
-
getClassificationNameFromNamespace
public static String getClassificationNameFromNamespace(String root, String qualifiedNamespace)
Given a fully-qualified classification namespace and a root, parse out the name of the classification.- Parameters:
root- namespacequalifiedNamespace- fully-qualified classification namespace- Returns:
- String classification name
-
getClassificationOriginFromSymbolicName
public static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ClassificationOrigin getClassificationOriginFromSymbolicName(CruxOMRSRepositoryConnector cruxConnector, String symbolicName)
Convert the provided symbolic name into its ClassificationOrigin.- Parameters:
cruxConnector- connectivity to the repositorysymbolicName- to convert- Returns:
- ClassificationOrigin
-
getSymbolicNameForClassificationOrigin
public static String getSymbolicNameForClassificationOrigin(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ClassificationOrigin co)
Convert the provided ClassificationOrigin into its symbolic name.- Parameters:
co- to convert- Returns:
- String
-
-