Class EntityProxyMapping
java.lang.Object
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.AbstractMapping
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.InstanceAuditHeaderMapping
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.InstanceHeaderMapping
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.EntitySummaryMapping
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.EntityProxyMapping
Maps the properties of EntityProxies between persistence and objects.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.EntitySummaryMapping
INSTANCE_REF_PREFIX, N_CLASSIFICATIONS
Fields inherited from class org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.InstanceHeaderMapping
instanceHeader, RE_IDENTIFIED_FROM_GUID, xtdbDoc
Fields inherited from class org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.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.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.AbstractMapping
mapper, xtdbConnector
-
Constructor Summary
ConstructorDescriptionEntityProxyMapping
(XTDBOMRSRepositoryConnector xtdbConnector, EntityProxy entityProxy) Construct a mapping from an EntityDetail (to map to a XTDB representation).EntityProxyMapping
(XTDBOMRSRepositoryConnector xtdbConnector, xtdb.api.XtdbDocument xtdbDoc) Construct a mapping from a XTDB map (to map to an Egeria representation). -
Method Summary
Modifier and TypeMethodDescriptionprotected void
fromDoc()
Translate the provided XTDB representation into an Egeria representation.static EntityProxy
fromMap
(clojure.lang.IPersistentMap doc) Translate the provided XTDB representation into an Egeria representation.static EntityProxy
getFromDoc
(XTDBOMRSRepositoryConnector xtdbConnector, xtdb.api.XtdbDocument doc) Translate the provided XTDB representation of an entity into an EntityProxy.static String
getReference
(String guid) Retrieve the canonical reference to the entity summary with the specified GUID.static boolean
isOnlyAProxy
(clojure.lang.IPersistentMap doc) Indicates whether the provided map represents only an EntityProxy (true) or a full EntityDetail (false).static boolean
isOnlyAProxy
(xtdb.api.XtdbDocument doc) Indicates whether the provided map represents only an EntityProxy (true) or a full EntityDetail (false).protected xtdb.api.XtdbDocument.Builder
toDoc()
Translate the provided Egeria representation into a XTDB map.toEgeria()
Map from XTDB to Egeria.Methods inherited from class org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.EntitySummaryMapping
fromMap
Methods inherited from class org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.InstanceHeaderMapping
fromMap, getGuidReference, getGuidReference, getReference, toMap, toXTDB, trimGuidFromReference
Methods inherited from class org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.InstanceAuditHeaderMapping
addToMap, addTypeDetailsToMap, buildDoc, buildDoc, fromDoc, fromDoc, fromMap, getTypeFromInstance, isKnownBaseProperty
Methods inherited from class org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.AbstractMapping
getDeserializedValue, getDeserializedValue, getEmbeddedSerializedForm, getEmbeddedSerializedForm, getKeyword, getKeyword
-
Field Details
-
ENTITY_PROXY_ONLY_MARKER
-
-
Constructor Details
-
EntityProxyMapping
Construct a mapping from an EntityDetail (to map to a XTDB representation).- Parameters:
xtdbConnector
- connectivity to XTDBentityProxy
- from which to map
-
EntityProxyMapping
Construct a mapping from a XTDB map (to map to an Egeria representation).- Parameters:
xtdbConnector
- connectivity to XTDBxtdbDoc
- from which to map
-
-
Method Details
-
toEgeria
Map from XTDB to Egeria. NOTE: This method should ONLY be used when you are certain that you have only a proxy that you are translating. In general, it is better to use the getFromDoc method which will automatically determine whether you have a full entity or only a proxy, and translate either to only the proxy representation as-needed. (This method here should really be treated as an internal method of this class, and is only public given that it overrides another public method in the parent class.)- Overrides:
toEgeria
in classEntitySummaryMapping
- Returns:
- EntityProxy
- See Also:
-
toDoc
protected xtdb.api.XtdbDocument.Builder toDoc()Translate the provided Egeria representation into a XTDB map.- Overrides:
toDoc
in classEntitySummaryMapping
- Returns:
- XtdbDocument.Builder from which to build the document
-
fromDoc
protected void fromDoc()Translate the provided XTDB representation into an Egeria representation.- Overrides:
fromDoc
in classEntitySummaryMapping
-
fromMap
public static EntityProxy fromMap(clojure.lang.IPersistentMap doc) throws IOException, InvalidParameterException Translate the provided XTDB representation into an Egeria representation.- Parameters:
doc
- from which to map- Returns:
- EntityProxy the Egeria representation of the XTDB document
- Throws:
IOException
- on any issue deserializing valuesInvalidParameterException
- for any unmapped properties
-
getFromDoc
public static EntityProxy getFromDoc(XTDBOMRSRepositoryConnector xtdbConnector, xtdb.api.XtdbDocument doc) Translate the provided XTDB representation of an entity into an EntityProxy.- Parameters:
xtdbConnector
- connectivity to the XTDB environmentdoc
- containing the XTDB representation of the entity- Returns:
- EntityProxy
-
getReference
Retrieve the canonical reference to the entity summary with the specified GUID.- Parameters:
guid
- of the entity summary to reference- Returns:
- String giving the XTDB reference to this entity summary document
-
isOnlyAProxy
public static boolean isOnlyAProxy(xtdb.api.XtdbDocument doc) Indicates whether the provided map represents only an EntityProxy (true) or a full EntityDetail (false).- Parameters:
doc
- containing the XTDB representation- Returns:
- boolean
-
isOnlyAProxy
public static boolean isOnlyAProxy(clojure.lang.IPersistentMap doc) Indicates whether the provided map represents only an EntityProxy (true) or a full EntityDetail (false).- Parameters:
doc
- containing the XTDB representation- Returns:
- boolean
-