Class InstanceAuditHeader

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    Classification, InstanceHeader

    public abstract class InstanceAuditHeader
    extends InstanceElementHeader
    InstanceAuditHeader manages the attributes that are common to classifications, entities and relationships. We need to be able to audit when these fundamental elements change and by whom. Thus they share this header. The fields in this header are managed as follows:
    • Type identifies which TypeDef defines the type of concept/thing that this instance represents and controls the properties that can be stored in the instance.
    • InstanceProvenanceType defines the type of metadata collection that this instance originated from.
    • MetadataCollectionId defines which metadata collection that this instance came from - that is its home.
    • MetadataCollectionName defines the display name for the home metadata collection.
    • InstanceLicense defines a specific license that applies to this instance - null means no restrictions.
    • CreatedBy contains the userId of the person/engine that created the instance. This field is set up when the instance is created and not changed. It typically indicates who is the owner of the element and hence who has update rights.
    • UpdatedBy contains the userId of the person/engine that last updated the instance. This field is set automatically by the open metadata repository when the update happens.
    • MaintainedBy contains the list of userIds of the person/engine that are responsible for maintained this instance. Null means that the maintainer is the creator.
    • CreateTime contains the Date/Time when the instance was created. It is set automatically by the open metadata repository when the instance is created.
    • UpdateTime contains the Data/Time when the instance was last updated. It is also set automatically by the open metadata repository when the update happens.
    • Version is a numeric count of the updates to the instance. It is used by the open metadata repositories to ensure updates to reference copies of the instance are applied in the right sequence. The home open metadata repository (where the create an all subsequent updates happen) maintains the version number.
    • CurrentStatus indicates the status of the instance. It is initialized by the open metadata repository to the first status defined in the TypeDef. After that, it is the actions of the consumers of the metadata (typically the Open Metadata Access Services (OMASs)
    • StatusOnDelete is populated when the instance is deleted and is se to the status when the deleted was called - it is used set the status if the instance is restored.
    • MappingProperties is used by connector implementations that are mapping between an existing repository and open metadata. It provides space for the connector to stash identifiers and other values that help them to map instances stored with the open metadata equivalent. These values should be maintained by the master repository and stored by any repository that is saving the reference copy.
    See Also:
    Serialized Form
    • Field Detail

      • CURRENT_AUDIT_HEADER_VERSION

        public static final long CURRENT_AUDIT_HEADER_VERSION
        See Also:
        Constant Field Values
    • Constructor Detail

      • InstanceAuditHeader

        public InstanceAuditHeader()
        Default Constructor sets the instance to nulls.
      • InstanceAuditHeader

        public InstanceAuditHeader​(InstanceAuditHeader template)
        Copy/clone constructor set the value to those supplied in the template.
        Parameters:
        template - Instance header
    • Method Detail

      • getType

        public InstanceType getType()
        Return the type of this instance. This identifies the type definition (TypeDef) that determines its properties.
        Returns:
        InstanceType object
      • setType

        public void setType​(InstanceType type)
        Set up the type of this instance. This identifies the type definition (TypeDef) that determines its properties.
        Parameters:
        type - InstanceType object
      • getInstanceProvenanceType

        public InstanceProvenanceType getInstanceProvenanceType()
        Return the type of the provenance for this instance.
        Returns:
        InstanceProvenanceType enum
      • setInstanceProvenanceType

        public void setInstanceProvenanceType​(InstanceProvenanceType instanceProvenanceType)
        Set up the type of the provenance for this instance.
        Parameters:
        instanceProvenanceType - InstanceProvenanceType enum
      • getMetadataCollectionId

        public String getMetadataCollectionId()
        Return the unique identifier for the metadata collection that is the home for this instance. If the metadataCollectionId is null it means this instance belongs to the local metadata collection.
        Returns:
        metadataCollectionId String unique identifier for the repository
      • setMetadataCollectionId

        public void setMetadataCollectionId​(String metadataCollectionId)
        Set up the unique identifier for the home metadata collection for this instance. If the metadataCollectionId is null it means this instance belongs to the local metadata collection.
        Parameters:
        metadataCollectionId - String unique identifier for the repository
      • getMetadataCollectionName

        public String getMetadataCollectionName()
        Return a display name for the metadata collection that this instance belongs to. The source of this name is dependent on the type of origin it has. For example, this may be the name of the server where the metadata is hosted, the archive that the instance came from or the name of the tool, platform or engine that originated the metadata.
        Returns:
        display name or null
      • setMetadataCollectionName

        public void setMetadataCollectionName​(String metadataCollectionName)
        Set up a display name for the metadata collection that this instance belongs to. The source of this name is dependent on the type of origin it has. For example, this may be the name of the server where the metadata is hosted, the archive that the instance came from or the name of the tool, platform or engine that originated the metadata.
        Parameters:
        metadataCollectionName - display name or null
      • getReplicatedBy

        public String getReplicatedBy()
        Return the metadata collection id of the cohort member responsible for replicating metadata owned by repositories (eg data tools/engines/platforms) from outside of the cohort or from an open metadata archive. Null means the metadata is owned by a cohort member, or is not to be replicated.
        Returns:
        string metadata collection id
      • setReplicatedBy

        public void setReplicatedBy​(String replicatedBy)
        Set up the metadata collection id of the cohort member responsible for replicating metadata owned by repositories (eg data tools/engines/platforms) from outside of the cohort or from an open metadata archive. Null means the metadata is owned by a cohort member, or is not to be replicated.
        Parameters:
        replicatedBy - string metadata collection id
      • getInstanceLicense

        public String getInstanceLicense()
        Return the license string for this instance - null means no restrictions.
        Returns:
        license string or null
      • setInstanceLicense

        public void setInstanceLicense​(String instanceLicense)
        Set up the license string for this instance - null means no restrictions.
        Parameters:
        instanceLicense - license string or null
      • getStatus

        public InstanceStatus getStatus()
        Return the status of this instance.
        Returns:
        InstanceStatus
      • setStatus

        public void setStatus​(InstanceStatus newStatus)
        Set up the status of this instance.
        Parameters:
        newStatus - InstanceStatus
      • getCreatedBy

        public String getCreatedBy()
        Return the name of the user that created this instance.
        Returns:
        String user name
      • setCreatedBy

        public void setCreatedBy​(String createdBy)
        Set up the name of the user that created this instance.
        Parameters:
        createdBy - String user name
      • getUpdatedBy

        public String getUpdatedBy()
        Return the name of the user that last updated this instance.
        Returns:
        String user name
      • setUpdatedBy

        public void setUpdatedBy​(String updatedBy)
        Set up the name of the user that last updated this instance.
        Parameters:
        updatedBy - String user name
      • getMaintainedBy

        public List<String> getMaintainedBy()
        Return the list of users responsible for maintaining this instance.
        Returns:
        list of user identifiers
      • setMaintainedBy

        public void setMaintainedBy​(List<String> maintainedBy)
        Set up the list of users responsible for maintaining this instance.
        Parameters:
        maintainedBy - list of user identifiers
      • getCreateTime

        public Date getCreateTime()
        Return the date/time that this instance was created.
        Returns:
        Date/Time of creation
      • setCreateTime

        public void setCreateTime​(Date createTime)
        Set up the time that this instance was created.
        Parameters:
        createTime - Date/Time of creation
      • getUpdateTime

        public Date getUpdateTime()
        Return what was the late time this instance was updated.
        Returns:
        Date/Time last updated
      • setUpdateTime

        public void setUpdateTime​(Date updateTime)
        Set up the last update time for this instance.
        Parameters:
        updateTime - Date/Time last updated
      • getVersion

        public long getVersion()
        Return the version number for this instance.
        Returns:
        Long version number
      • setVersion

        public void setVersion​(long version)
        Set up the version number for this instance.
        Parameters:
        version - Long version number
      • getStatusOnDelete

        public InstanceStatus getStatusOnDelete()
        Return the status to use when a deleted instance is restored. UNKNOWN is used whenever the instance is not in DELETED status.
        Returns:
        InstanceStatus
      • setStatusOnDelete

        public void setStatusOnDelete​(InstanceStatus statusOnDelete)
        Set up the status to use when a deleted instance is restored. UNKNOWN is used whenever the instance is not in DELETED status.
        Parameters:
        statusOnDelete - InstanceStatus Enum
      • getMappingProperties

        public Map<String,​Serializable> getMappingProperties()
        Return the additional properties used by the master repository to map to stored instances.
        Returns:
        property map
      • setMappingProperties

        public void setMappingProperties​(Map<String,​Serializable> mappingProperties)
        Set up the additional properties used by the master repository to map to stored instances.
        Parameters:
        mappingProperties - property map
      • toString

        public String toString()
        Standard toString method.
        Overrides:
        toString in class Object
        Returns:
        JSON style description of variables.
      • equals

        public boolean equals​(Object objectToCompare)
        Validate if the supplied object equals this object.
        Overrides:
        equals in class Object
        Parameters:
        objectToCompare - test object
        Returns:
        boolean evaluation
      • hashCode

        public int hashCode()
        Return a hash code based on the values of this object.
        Overrides:
        hashCode in class Object
        Returns:
        in hash code