Class 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 Crux ID (GUID) is mapped.)
    • Field Detail

      • instanceHeader

        protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader instanceHeader
      • cruxDoc

        protected crux.api.CruxDocument cruxDoc
    • Constructor Detail

      • InstanceHeaderMapping

        protected InstanceHeaderMapping​(CruxOMRSRepositoryConnector cruxConnector,
                                        org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader instanceHeader)
        Construct a mapping from an InstanceAuditHeader (to map to a Crux representation).
        Parameters:
        cruxConnector - connectivity to Crux
        instanceHeader - from which to map
      • InstanceHeaderMapping

        protected InstanceHeaderMapping​(CruxOMRSRepositoryConnector cruxConnector,
                                        crux.api.CruxDocument cruxDoc)
        Construct a mapping from a Crux map (to map to an Egeria representation).
        Parameters:
        cruxConnector - connectivity to Crux
        cruxDoc - from which to map
    • Method Detail

      • toDoc

        protected crux.api.CruxDocument.Builder toDoc()
        Translate the provided Egeria representation into a Crux document.
        Returns:
        CruxDocument.Builder from which to build the document
      • fromDoc

        protected void fromDoc()
        Translate the provided Crux representation into an Egeria representation.
      • getGuidReference

        public static String getGuidReference​(CruxOMRSRepositoryConnector cruxConnector,
                                              org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader ih)
        Translate the provided InstanceHeader information into a Crux reference to the GUID of the instance.
        Parameters:
        cruxConnector - connectivity to the repository
        ih - to translate
        Returns:
        String for the Crux reference
      • trimGuidFromReference

        public static String trimGuidFromReference​(String reference)
        Retrieve only the GUID portion of a Crux reference.
        Parameters:
        reference - from which to trim the GUID
        Returns:
        String of only the GUID portion of the reference
      • getReference

        protected static String getReference​(String instanceType,
                                             String guid)
        Translate the provided details into a Crux reference.
        Parameters:
        instanceType - of the instance (from TypeDefCategory name)
        guid - of the instance
        Returns:
        String for the Crux reference