java.lang.Object
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.AbstractMapping
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.InstanceAuditHeaderMapping
Direct Known Subclasses:
ClassificationMapping, InstanceHeaderMapping

public abstract class InstanceAuditHeaderMapping extends AbstractMapping
Maps the properties of InstanceAuditHeaders between persistence and objects.
  • Field Details

    • METADATA_COLLECTION_ID

      public static final String METADATA_COLLECTION_ID
    • METADATA_COLLECTION_NAME

      public static final String METADATA_COLLECTION_NAME
    • CREATE_TIME

      public static final String CREATE_TIME
    • UPDATE_TIME

      public static final String UPDATE_TIME
    • CURRENT_STATUS

      public static final String CURRENT_STATUS
    • STATUS_ON_DELETE

      public static final String STATUS_ON_DELETE
    • TYPE_DEF_GUIDS

      public static final String TYPE_DEF_GUIDS
    • TYPE_DEF_CATEGORY

      public static final String TYPE_DEF_CATEGORY
    • VERSION

      public static final String VERSION
    • MAINTAINED_BY

      public static final String MAINTAINED_BY
    • UPDATED_BY

      public static final String UPDATED_BY
    • REPLICATED_BY

      public static final String REPLICATED_BY
    • INSTANCE_PROVENANCE_TYPE

      public static final String INSTANCE_PROVENANCE_TYPE
  • Constructor Details

    • InstanceAuditHeaderMapping

      protected InstanceAuditHeaderMapping(XTDBOMRSRepositoryConnector xtdbConnector)
      Default constructor.
      Parameters:
      xtdbConnector - connectivity to XTDB
  • Method Details

    • isKnownBaseProperty

      public static boolean isKnownBaseProperty(String property)
      Check whether the specified property is a known base-level Instance property.
      Parameters:
      property - to check
      Returns:
      boolean
    • buildDoc

      protected static void buildDoc(xtdb.api.XtdbDocument.Builder builder, InstanceAuditHeader iah) throws IOException
      Translate the provided Egeria representation into a XTDB document.
      Parameters:
      builder - for the XTDB document
      iah - Egeria representation from which to map
      Throws:
      IOException - on any error serializing the provided values
    • buildDoc

      public static Date buildDoc(xtdb.api.XtdbDocument.Builder builder, InstanceAuditHeader iah, String namespace) throws IOException
      Translate the provided Egeria representation into a XTDB document.
      Parameters:
      builder - for the XTDB document
      iah - Egeria representation from which to map
      namespace - by which to qualify the properties
      Returns:
      the latest change date in the header (updateTime or if empty createTime)
      Throws:
      IOException - on any error serializing the provided values
    • addToMap

      public static clojure.lang.IPersistentVector addToMap(clojure.lang.IPersistentMap doc, InstanceAuditHeader iah, String namespace) throws IOException
      Translate the provided Egeria representation into a XTDB document map.
      Parameters:
      doc - for the XTDB document
      iah - Egeria representation from which to map
      namespace - by which to qualify the properties
      Returns:
      a tuple containing the timestamp of the create / update followed by the updated document map itself
      Throws:
      IOException - on any error serializing the provided values
    • addTypeDetailsToMap

      public static clojure.lang.IPersistentMap addTypeDetailsToMap(clojure.lang.IPersistentMap doc, InstanceType type, String namespace) throws IOException
      Translate the provided Egeria type information into a XTDB document map.
      Parameters:
      doc - for the XTDB document
      type - to update into the document
      namespace - by which to qualify the properties
      Returns:
      IPersistentMap containing the updated XTDB document
      Throws:
      IOException - on any error serializing the provided values
    • getTypeFromInstance

      public static InstanceType getTypeFromInstance(clojure.lang.IPersistentMap doc, String namespace) throws IOException
      Retrieve the instance type details from the provided XTDB document map.
      Parameters:
      doc - for the XTDB document
      namespace - by which the properties are qualified
      Returns:
      InstanceType
      Throws:
      IOException - on any error deserializing the value
    • fromDoc

      protected void fromDoc(InstanceAuditHeader iah, xtdb.api.XtdbDocument doc)
      Translate the provided XTDB representation into an Egeria representation.
      Parameters:
      iah - into which to map
      doc - from which to map
    • fromDoc

      protected void fromDoc(InstanceAuditHeader iah, xtdb.api.XtdbDocument doc, String namespace)
      Translate the provided XTDB representation into an Egeria representation.
      Parameters:
      iah - into which to map
      doc - from which to map
      namespace - by which the properties are qualified
    • fromMap

      protected static void fromMap(InstanceAuditHeader iah, clojure.lang.IPersistentMap doc, String namespace) throws IOException, InvalidParameterException
      Translate the provided XTDB representation into an Egeria representation.
      Parameters:
      iah - into which to map
      doc - from which to map
      namespace - by which the properties are qualified
      Throws:
      IOException - on any issue deserializing values
      InvalidParameterException - for any unmapped properties