Class InstanceHeaderMapping
- java.lang.Object
-
- org.odpi.egeria.connectors.juxt.xtdb.mapping.AbstractMapping
-
- org.odpi.egeria.connectors.juxt.xtdb.mapping.InstanceAuditHeaderMapping
-
- org.odpi.egeria.connectors.juxt.xtdb.mapping.InstanceHeaderMapping
-
- Direct Known Subclasses:
EntitySummaryMapping,RelationshipMapping
public class InstanceHeaderMapping extends InstanceAuditHeaderMapping
Maps the properties of InstanceHeaders between persistence and objects. (Note that this is the first level of mapping that can be instantiated, as it is the first level in which a XTDB ID (GUID) is mapped.)
-
-
Field Summary
Fields Modifier and Type Field Description protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeaderinstanceHeaderstatic StringRE_IDENTIFIED_FROM_GUIDprotected xtdb.api.XtdbDocumentxtdbDoc-
Fields inherited from class org.odpi.egeria.connectors.juxt.xtdb.mapping.InstanceAuditHeaderMapping
CREATE_TIME, CURRENT_STATUS, INSTANCE_PROVENANCE_TYPE, MAINTAINED_BY, METADATA_COLLECTION_ID, METADATA_COLLECTION_NAME, REPLICATED_BY, STATUS_ON_DELETE, TYPE_DEF_CATEGORY, TYPE_DEF_GUIDS, UPDATE_TIME, UPDATED_BY, VERSION
-
Fields inherited from class org.odpi.egeria.connectors.juxt.xtdb.mapping.AbstractMapping
mapper, xtdbConnector
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedInstanceHeaderMapping(XtdbOMRSRepositoryConnector xtdbConnector, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader instanceHeader)Construct a mapping from an InstanceAuditHeader (to map to a XTDB representation).protectedInstanceHeaderMapping(XtdbOMRSRepositoryConnector xtdbConnector, xtdb.api.XtdbDocument xtdbDoc)Construct a mapping from a XTDB map (to map to an Egeria representation).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfromDoc()Translate the provided XTDB representation into an Egeria representation.protected static voidfromMap(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader ih, clojure.lang.IPersistentMap doc)Translate the provided XTDB representation into an Egeria representation.static StringgetGuidReference(XtdbOMRSRepositoryConnector xtdbConnector, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader ih)Translate the provided InstanceHeader information into a XTDB reference to the GUID of the instance.static StringgetGuidReference(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader ih)Translate the provided InstanceHeader information into a XTDB reference to the GUID of the instance.protected static StringgetReference(String instanceType, String guid)Translate the provided details into a XTDB reference.protected xtdb.api.XtdbDocument.BuildertoDoc()Translate the provided Egeria representation into a XTDB document.static clojure.lang.IPersistentMaptoMap(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader header)Translate the provided Egeria representation into a XTDB document map.xtdb.api.XtdbDocumenttoXTDB()Map from Egeria to XTDB.static StringtrimGuidFromReference(String reference)Retrieve only the GUID portion of a XTDB reference.-
Methods inherited from class org.odpi.egeria.connectors.juxt.xtdb.mapping.InstanceAuditHeaderMapping
addToMap, addTypeDetailsToMap, buildDoc, buildDoc, fromDoc, fromDoc, fromMap, getTypeFromInstance, isKnownBaseProperty
-
Methods inherited from class org.odpi.egeria.connectors.juxt.xtdb.mapping.AbstractMapping
getDeserializedValue, getDeserializedValue, getEmbeddedSerializedForm, getEmbeddedSerializedForm, getKeyword, getKeyword
-
-
-
-
Field Detail
-
RE_IDENTIFIED_FROM_GUID
public static final String RE_IDENTIFIED_FROM_GUID
-
instanceHeader
protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader instanceHeader
-
xtdbDoc
protected xtdb.api.XtdbDocument xtdbDoc
-
-
Constructor Detail
-
InstanceHeaderMapping
protected InstanceHeaderMapping(XtdbOMRSRepositoryConnector xtdbConnector, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader instanceHeader)
Construct a mapping from an InstanceAuditHeader (to map to a XTDB representation).- Parameters:
xtdbConnector- connectivity to XTDBinstanceHeader- from which to map
-
InstanceHeaderMapping
protected InstanceHeaderMapping(XtdbOMRSRepositoryConnector xtdbConnector, xtdb.api.XtdbDocument xtdbDoc)
Construct a mapping from a XTDB map (to map to an Egeria representation).- Parameters:
xtdbConnector- connectivity to XTDBxtdbDoc- from which to map
-
-
Method Detail
-
toXTDB
public xtdb.api.XtdbDocument toXTDB()
Map from Egeria to XTDB.- Returns:
- XtdbDocument
- See Also:
InstanceHeaderMapping(XtdbOMRSRepositoryConnector, InstanceHeader)
-
toDoc
protected xtdb.api.XtdbDocument.Builder toDoc()
Translate the provided Egeria representation into a XTDB document.- Returns:
- XtdbDocument.Builder from which to build the document
-
toMap
public static clojure.lang.IPersistentMap toMap(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader header) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException, IOExceptionTranslate the provided Egeria representation into a XTDB document map.- Parameters:
header- to translate- Returns:
- IPersistentMap representing the XTDB document
- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- on any errors identified within the metadata instanceIOException- on any error serializing the values
-
fromDoc
protected void fromDoc()
Translate the provided XTDB representation into an Egeria representation.
-
fromMap
protected static void fromMap(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader ih, clojure.lang.IPersistentMap doc) throws IOException, org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterExceptionTranslate the provided XTDB representation into an Egeria representation.- Parameters:
ih- into which to mapdoc- from which to map- Throws:
IOException- on any issue deserializing valuesorg.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- for any unmapped properties
-
getGuidReference
public static String getGuidReference(XtdbOMRSRepositoryConnector xtdbConnector, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader ih)
Translate the provided InstanceHeader information into a XTDB reference to the GUID of the instance.- Parameters:
xtdbConnector- connectivity to the repositoryih- to translate- Returns:
- String for the XTDB reference
-
getGuidReference
public static String getGuidReference(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader ih) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException
Translate the provided InstanceHeader information into a XTDB reference to the GUID of the instance.- Parameters:
ih- to translate- Returns:
- String for the XTDB reference
- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- on any error translating the GUID
-
trimGuidFromReference
public static String trimGuidFromReference(String reference)
Retrieve only the GUID portion of a XTDB reference.- Parameters:
reference- from which to trim the GUID- Returns:
- String of only the GUID portion of the reference
-
-