Class OMRSInstanceEvent

java.lang.Object
org.odpi.openmetadata.repositoryservices.events.OMRSEvent
org.odpi.openmetadata.repositoryservices.events.OMRSInstanceEvent

public class OMRSInstanceEvent extends OMRSEvent
Structure of an instance event.
  • Constructor Details

    • OMRSInstanceEvent

      public OMRSInstanceEvent(OMRSEventV1 inboundEvent)
      Inbound event constructor that takes the object created by the Jackson JSON mapper and unpacks the properties into the instance event.
      Parameters:
      inboundEvent - incoming event to parse.
    • OMRSInstanceEvent

      public OMRSInstanceEvent(OMRSInstanceEventType instanceEventType, EntityDetail entity)
      Constructor for instance events related to a change to an entity.
      Parameters:
      instanceEventType - type of event
      entity - new values for entity that changed
    • OMRSInstanceEvent

      public OMRSInstanceEvent(OMRSInstanceEventType instanceEventType, EntityProxy entityProxy, Classification originalClassification, Classification classification)
      Constructor for instance events related to a change to an entity's classification.
      Parameters:
      instanceEventType - type of event
      entityProxy - entity that changed
      originalClassification - original Classification value (if existed)
      classification - new classification (if relevant)
    • OMRSInstanceEvent

      public OMRSInstanceEvent(OMRSInstanceEventType instanceEventType, EntityDetail entity, Classification originalClassification, Classification classification)
      Constructor for instance events related to a change to an entity's classification.
      Parameters:
      instanceEventType - type of event
      entity - entity that changed
      originalClassification - original Classification value (if existed)
      classification - new classification (if relevant)
    • OMRSInstanceEvent

      public OMRSInstanceEvent(OMRSInstanceEventType instanceEventType, EntityDetail originalEntity, EntityDetail newEntity)
      Constructor for instance events related to a change to an entity where the old version is supplied.
      Parameters:
      instanceEventType - type of event
      originalEntity - original value of the entity
      newEntity - new values for entity that changed
    • OMRSInstanceEvent

      public OMRSInstanceEvent(OMRSInstanceEventType instanceEventType, Relationship relationship)
      Constructor for instance events related to a change to a relationship.
      Parameters:
      instanceEventType - type of event
      relationship - new values for relationship that changed
    • OMRSInstanceEvent

      public OMRSInstanceEvent(OMRSInstanceEventType instanceEventType, Relationship originalRelationship, Relationship newRelationship)
      Constructor for instance events related to a change to a relationship where the original values are also sent.
      Parameters:
      instanceEventType - type of event
      originalRelationship - original values of relationship
      newRelationship - new values for relationship that changed
    • OMRSInstanceEvent

      public OMRSInstanceEvent(OMRSInstanceEventType instanceEventType, String typeDefGUID, String typeDefName, String instanceGUID)
      Constructor for instance events related to a delete or purge of an instance or a request to refresh an instance.
      Parameters:
      instanceEventType - type of event
      typeDefGUID - unique identifier for this entity's TypeDef
      typeDefName - name of this entity's TypeDef
      instanceGUID - unique identifier for the entity
    • OMRSInstanceEvent

      public OMRSInstanceEvent(OMRSInstanceEventType instanceEventType, InstanceGraph instances)
      Constructor for batch instance events.
      Parameters:
      instanceEventType - type of event
      instances - graph of instances
    • OMRSInstanceEvent

      public OMRSInstanceEvent(OMRSInstanceEventErrorCode errorCode, String errorMessage, String targetMetadataCollectionId, TypeDefSummary targetTypeDefSummary, String targetInstanceGUID, String otherMetadataCollectionId, InstanceProvenanceType otherOrigin, TypeDefSummary otherTypeDefSummary, String otherInstanceGUID)
      Constructor for instance conflict events.
      Parameters:
      errorCode - error code
      errorMessage - description of the error
      targetMetadataCollectionId - metadata collection id of other repository with the conflicting instance
      targetTypeDefSummary - details of the target instance's TypeDef
      targetInstanceGUID - unique identifier for the source instance
      otherMetadataCollectionId - local metadata collection id
      otherOrigin - provenance information of the local instance
      otherTypeDefSummary - TypeDef details of the local instance
      otherInstanceGUID - GUID of the local instance
    • OMRSInstanceEvent

      public OMRSInstanceEvent(OMRSInstanceEventErrorCode errorCode, String errorMessage, String targetMetadataCollectionId, TypeDefSummary targetTypeDefSummary, String targetInstanceGUID, TypeDefSummary otherTypeDefSummary)
      Instance type conflict event.
      Parameters:
      errorCode - error code
      errorMessage - description of the error
      targetMetadataCollectionId - metadata collection id of other repository with the conflicting instance
      targetTypeDefSummary - details of the target instance's TypeDef
      targetInstanceGUID - unique identifier for the source instance
      otherTypeDefSummary - details of the other TypeDef
  • Method Details

    • setHomeMetadataCollectionId

      public void setHomeMetadataCollectionId(String homeMetadataCollectionId)
      Set up the home metadata collection id. This is used for when a repository is requesting a refresh of an instance's details.
      Parameters:
      homeMetadataCollectionId - unique id of the metadata collection where this instance comes from.
    • setOriginalHomeMetadataCollectionId

      public void setOriginalHomeMetadataCollectionId(String originalHomeMetadataCollectionId)
      Set up the unique id of the metadata collection that was the original home of a metadata instance that has just been rehomed.
      Parameters:
      originalHomeMetadataCollectionId - unique id of original metadata collection
    • setOriginalTypeDefSummary

      public void setOriginalTypeDefSummary(TypeDefSummary originalTypeDefSummary)
      Set up the details of the original TypeDef of a metadata instance that has just been reTyped.
      Parameters:
      originalTypeDefSummary - details of original TypeDef
    • setOriginalInstanceGUID

      public void setOriginalInstanceGUID(String originalInstanceGUID)
      Set up the original unique id (guid) of an instance that has just been re-identified (ie it has had a new guid assigned.
      Parameters:
      originalInstanceGUID - original guid of an instance
    • getInstanceEventType

      public OMRSInstanceEventType getInstanceEventType()
      Return the code for this event's type.
      Returns:
      OMRSInstanceEventType enum
    • getTypeDefGUID

      public String getTypeDefGUID()
      Return the unique identifier for the instance's TypeDef.
      Returns:
      String identifier (guid)
    • getTypeDefName

      public String getTypeDefName()
      Return the unique name for the instance's TypeDef.
      Returns:
      String name
    • getInstanceGUID

      public String getInstanceGUID()
      Return the unique identifier for the instance itself.
      Returns:
      String identifier (guid)
    • getOriginalEntity

      public EntityDetail getOriginalEntity()
      Return the original entity instance (if applicable) or null.
      Returns:
      EntityDetail object
    • getEntity

      public EntityDetail getEntity()
      Return the entity instance (if applicable) or null.
      Returns:
      EntityDetail object
    • getEntityProxy

      public EntityProxy getEntityProxy()
      Return the entity proxy (if applicable) or null.
      Returns:
      EntityProxy object
    • getOriginalRelationship

      public Relationship getOriginalRelationship()
      Return the original relationship instance (if applicable) or null.
      Returns:
      Relationship object
    • getRelationship

      public Relationship getRelationship()
      Return the relationship instance (if applicable) or null.
      Returns:
      Relationship object
    • getOriginalClassification

      public Classification getOriginalClassification()
      Return the original classification if exists
      Returns:
      classification object
    • getClassification

      public Classification getClassification()
      Return the new classification
      Returns:
      classification object
    • getInstanceBatch

      public InstanceGraph getInstanceBatch()
      Return the instance batch (if applicable) or null.
      Returns:
      InstanceGraph object
    • getHomeMetadataCollectionId

      public String getHomeMetadataCollectionId()
      Return the identifier of the instance's home metadata collection. This is used on refresh requests.
      Returns:
      String unique identifier (guid)
    • getOriginalHomeMetadataCollectionId

      public String getOriginalHomeMetadataCollectionId()
      Return the identifier of the original metadata collection for this instance. This is used when an instance is being re-homed.
      Returns:
      String unique identifier (guid)
    • getOriginalTypeDefSummary

      public TypeDefSummary getOriginalTypeDefSummary()
      Return the original version for this instance's TypeDef. This is used if the type for the instance has been changed to resolve a conflict or to allow a change in the TypeDef Gallery.
      Returns:
      details of the original TypeDef
    • getOriginalInstanceGUID

      public String getOriginalInstanceGUID()
      Return the original unique identifier (guid) for this instance. This is used if the guid for the instance has been changed to resolve a conflict.
      Returns:
      String unique identifier (guid)
    • getErrorCode

      public OMRSInstanceEventErrorCode getErrorCode()
      Return the error code for this instance event. If there is no error it is set to NOT_IN_USE.
      Returns:
      OMRSInstanceEventErrorCode enum
    • getOMRSEventV1

      public OMRSEventV1 getOMRSEventV1()
      Returns an OMRSEvent populated with details from this InstanceEvent
      Overrides:
      getOMRSEventV1 in class OMRSEvent
      Returns:
      OMRSEvent (Version 1) object
    • toString

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