Class OMRSEvent

  • Direct Known Subclasses:
    OMRSInstanceEvent, OMRSRegistryEvent, OMRSTypeDefEvent

    public abstract class OMRSEvent
    extends java.lang.Object
    OMRSEvent defines the common content of a message that is sent through the OMRSTopicConnector to all metadata repositories registered in the open metadata repository cohort. It supports a category enum for the three main categories of event and provides specialized structures for processing each category of event.
    • Constructor Summary

      Constructors 
      Constructor Description
      OMRSEvent​(org.odpi.openmetadata.repositoryservices.events.beans.v1.OMRSEventV1 inboundEvent)
      Inbound event constructor that takes the object created by the Jackson JSON mapper and unpacks the properties into the internal OMRSEvent object.
      OMRSEvent​(OMRSEventCategory eventCategory)
      Outbound event constructor used when there is no error.
      OMRSEvent​(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, java.lang.String errorMessage, java.lang.String targetMetadataCollectionId, Connection targetRemoteConnection)
      Outbound event constructor used for registry error events.
      OMRSEvent​(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, java.lang.String errorMessage, java.lang.String otherMetadataCollectionId, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.AttributeTypeDef otherAttributeTypeDef)
      Outbound constructor used for AttributeTypeDef conflict events.
      OMRSEvent​(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, java.lang.String errorMessage, java.lang.String targetMetadataCollectionId, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.AttributeTypeDef targetAttributeTypeDef, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.AttributeTypeDef otherAttributeTypeDef)
      Outbound constructor used for AttributeTypeDef conflict events.
      OMRSEvent​(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, java.lang.String errorMessage, java.lang.String otherMetadataCollectionId, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary otherTypeDefSummary)
      Outbound constructor used for TypeDef conflict events.
      OMRSEvent​(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, java.lang.String errorMessage, java.lang.String targetMetadataCollectionId, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary targetTypeDefSummary, java.lang.String targetInstanceGUID, java.lang.String otherMetadataCollectionId, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProvenanceType otherOrigin, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary otherTypeDefSummary, java.lang.String otherInstanceGUID)
      Outbound constructor used for metadata instance conflict events.
      OMRSEvent​(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, java.lang.String errorMessage, java.lang.String targetMetadataCollectionId, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary targetTypeDefSummary, java.lang.String targetInstanceGUID, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary otherTypeDefSummary)
      Outbound constructor used for metadata instance type conflict events.
      OMRSEvent​(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, java.lang.String errorMessage, java.lang.String targetMetadataCollectionId, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary targetTypeDefSummary, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDef otherTypeDef)
      Outbound event constructor for a TypeDef patch mismatch warning.
      OMRSEvent​(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, java.lang.String errorMessage, java.lang.String targetMetadataCollectionId, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary targetTypeDefSummary, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary otherTypeDefSummary)
      Outbound constructor used for TypeDef conflict events.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getErrorMessage()
      Return any error message for the event.
      OMRSEventCategory getEventCategory()
      Return the category of the event.
      OMRSEventDirection getEventDirection()
      Return whether this is an inbound or outbound event.
      OMRSEventOriginator getEventOriginator()
      Return details of the originator of the event including the id of their metadata collection.
      java.util.Date getEventTimestamp()
      Return the timestamp for the event.
      protected OMRSEventErrorCode getGenericErrorCode()
      Return the error code for the event.
      org.odpi.openmetadata.repositoryservices.events.beans.v1.OMRSEventV1 getOMRSEventV1()
      Returns an OMRSEvent populated with details about a generic event.
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.AttributeTypeDef getOtherAttributeTypeDef()
      Return the AttributeTypeDef from the other repository.
      java.lang.String getOtherInstanceGUID()
      Return the unique identifier for the other instance.
      java.lang.String getOtherMetadataCollectionId()
      Return the unique identifier for the metadata collection containing the other instance.
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProvenanceType getOtherOrigin()
      Return the provenance (origin) information for the other instance.
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDef getOtherTypeDef()
      Return the TypeDef from the other repository.
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary getOtherTypeDefSummary()
      Return the version of the TypeDef from the other repository.
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.AttributeTypeDef getTargetAttributeTypeDef()
      Return the target AttributeTypeDef.
      java.lang.String getTargetInstanceGUID()
      Return the target's instance's unique identifier.
      java.lang.String getTargetMetadataCollectionId()
      This is the identifier of the metadata collection that needs to take action.
      Connection getTargetRemoteConnection()
      This is the target's connection that is causing errors in the originator's server.
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary getTargetTypeDefSummary()
      Return the target's TypeDef summary.
      void setEventOriginator​(OMRSEventOriginator eventOriginator)
      Set up details of the event originator used by the event publisher for outbound events.
      java.lang.String toString()
      Standard toString method.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • eventTimestamp

        protected java.util.Date eventTimestamp
      • errorMessage

        protected java.lang.String errorMessage
      • targetMetadataCollectionId

        protected java.lang.String targetMetadataCollectionId
      • targetRemoteConnection

        protected Connection targetRemoteConnection
      • targetTypeDefSummary

        protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary targetTypeDefSummary
      • targetAttributeTypeDef

        protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.AttributeTypeDef targetAttributeTypeDef
      • targetInstanceGUID

        protected java.lang.String targetInstanceGUID
      • otherOrigin

        protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProvenanceType otherOrigin
      • otherMetadataCollectionId

        protected java.lang.String otherMetadataCollectionId
      • otherTypeDefSummary

        protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary otherTypeDefSummary
      • otherTypeDef

        protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDef otherTypeDef
      • otherAttributeTypeDef

        protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.AttributeTypeDef otherAttributeTypeDef
      • otherInstanceGUID

        protected java.lang.String otherInstanceGUID
    • Constructor Detail

      • OMRSEvent

        public OMRSEvent​(org.odpi.openmetadata.repositoryservices.events.beans.v1.OMRSEventV1 inboundEvent)
        Inbound event constructor that takes the object created by the Jackson JSON mapper and unpacks the properties into the internal OMRSEvent object.
        Parameters:
        inboundEvent - incoming Event.
      • OMRSEvent

        public OMRSEvent​(OMRSEventCategory eventCategory)
        Outbound event constructor used when there is no error.
        Parameters:
        eventCategory - category of event.
      • OMRSEvent

        public OMRSEvent​(OMRSEventCategory eventCategory,
                         OMRSEventErrorCode genericErrorCode,
                         java.lang.String errorMessage,
                         java.lang.String targetMetadataCollectionId,
                         Connection targetRemoteConnection)
        Outbound event constructor used for registry error events.
        Parameters:
        eventCategory - category of event.
        genericErrorCode - code for the error
        errorMessage - detailed error message for remote audit log
        targetMetadataCollectionId - identifier of the metadata collection in error.
        targetRemoteConnection - connection used to create the connector to access metadata in the remote repository.
      • OMRSEvent

        public OMRSEvent​(OMRSEventCategory eventCategory,
                         OMRSEventErrorCode genericErrorCode,
                         java.lang.String errorMessage,
                         java.lang.String targetMetadataCollectionId,
                         org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary targetTypeDefSummary,
                         org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary otherTypeDefSummary)
        Outbound constructor used for TypeDef conflict events.
        Parameters:
        eventCategory - category of event.
        genericErrorCode - code for the error
        errorMessage - detailed error message for remote audit log
        targetMetadataCollectionId - identifier of the metadata collection required to change TypeDef.
        targetTypeDefSummary - details of TypeDef to change.
        otherTypeDefSummary - description of conflicting TypeDef that will not change.
      • OMRSEvent

        public OMRSEvent​(OMRSEventCategory eventCategory,
                         OMRSEventErrorCode genericErrorCode,
                         java.lang.String errorMessage,
                         java.lang.String otherMetadataCollectionId,
                         org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary otherTypeDefSummary)
        Outbound constructor used for TypeDef conflict events.
        Parameters:
        eventCategory - category of event.
        genericErrorCode - code for the error
        errorMessage - detailed error message for remote audit log
        otherMetadataCollectionId - identifier of the metadata collection that sent the type.
        otherTypeDefSummary - description of conflicting TypeDef.
      • OMRSEvent

        public OMRSEvent​(OMRSEventCategory eventCategory,
                         OMRSEventErrorCode genericErrorCode,
                         java.lang.String errorMessage,
                         java.lang.String targetMetadataCollectionId,
                         org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.AttributeTypeDef targetAttributeTypeDef,
                         org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.AttributeTypeDef otherAttributeTypeDef)
        Outbound constructor used for AttributeTypeDef conflict events.
        Parameters:
        eventCategory - category of event.
        genericErrorCode - code for the error
        errorMessage - detailed error message for remote audit log
        targetMetadataCollectionId - identifier of the metadata collection required to change TypeDef.
        targetAttributeTypeDef - details of AttributeTypeDef to change.
        otherAttributeTypeDef - description of conflicting AttributeTypeDef that will not change.
      • OMRSEvent

        public OMRSEvent​(OMRSEventCategory eventCategory,
                         OMRSEventErrorCode genericErrorCode,
                         java.lang.String errorMessage,
                         java.lang.String otherMetadataCollectionId,
                         org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.AttributeTypeDef otherAttributeTypeDef)
        Outbound constructor used for AttributeTypeDef conflict events.
        Parameters:
        eventCategory - category of event.
        genericErrorCode - code for the error
        errorMessage - detailed error message for remote audit log
        otherMetadataCollectionId - identifier of the remote metadata collection.
        otherAttributeTypeDef - description of conflicting AttributeTypeDef.
      • OMRSEvent

        public OMRSEvent​(OMRSEventCategory eventCategory,
                         OMRSEventErrorCode genericErrorCode,
                         java.lang.String errorMessage,
                         java.lang.String targetMetadataCollectionId,
                         org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary targetTypeDefSummary,
                         org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDef otherTypeDef)
        Outbound event constructor for a TypeDef patch mismatch warning.
        Parameters:
        eventCategory - category of event.
        genericErrorCode - code for the error.
        errorMessage - detailed error message for remote audit log
        targetMetadataCollectionId - identifier of the remote metadata collection with mismatched TypeDef.
        targetTypeDefSummary - description of TypeDef.
        otherTypeDef - details of local TypeDef
      • OMRSEvent

        public OMRSEvent​(OMRSEventCategory eventCategory,
                         OMRSEventErrorCode genericErrorCode,
                         java.lang.String errorMessage,
                         java.lang.String targetMetadataCollectionId,
                         org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary targetTypeDefSummary,
                         java.lang.String targetInstanceGUID,
                         java.lang.String otherMetadataCollectionId,
                         org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProvenanceType otherOrigin,
                         org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary otherTypeDefSummary,
                         java.lang.String otherInstanceGUID)
        Outbound constructor used for metadata instance conflict events.
        Parameters:
        eventCategory - category of event.
        genericErrorCode - code for the error
        errorMessage - detailed error message for remote audit log
        targetMetadataCollectionId - metadata collection id of other repository with the conflicting instance
        targetTypeDefSummary - description of the target instance's TypeDef
        targetInstanceGUID - unique identifier for the source instance
        otherOrigin - origin of the other (older) metadata instance
        otherMetadataCollectionId - metadata collection of the other (older) metadata instance
        otherTypeDefSummary - details of the other (older) instance's TypeDef
        otherInstanceGUID - unique identifier for the other (older) instance
      • OMRSEvent

        public OMRSEvent​(OMRSEventCategory eventCategory,
                         OMRSEventErrorCode genericErrorCode,
                         java.lang.String errorMessage,
                         java.lang.String targetMetadataCollectionId,
                         org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary targetTypeDefSummary,
                         java.lang.String targetInstanceGUID,
                         org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary otherTypeDefSummary)
        Outbound constructor used for metadata instance type conflict events.
        Parameters:
        eventCategory - category of event.
        genericErrorCode - code for the error
        errorMessage - detailed error message for remote audit log
        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 local TypeDef
    • Method Detail

      • setEventOriginator

        public void setEventOriginator​(OMRSEventOriginator eventOriginator)
        Set up details of the event originator used by the event publisher for outbound events.
        Parameters:
        eventOriginator - details of the originator of the event including the id of the local metadata collection.
      • getEventDirection

        public OMRSEventDirection getEventDirection()
        Return whether this is an inbound or outbound event. This is used for messages.
        Returns:
        OMRSEventDirection enum
      • getEventTimestamp

        public java.util.Date getEventTimestamp()
        Return the timestamp for the event.
        Returns:
        Date object
      • getEventCategory

        public OMRSEventCategory getEventCategory()
        Return the category of the event. If the event category is null then the event was unreadable in some form (or there is a logic error).
        Returns:
        event category enum
      • getEventOriginator

        public OMRSEventOriginator getEventOriginator()
        Return details of the originator of the event including the id of their metadata collection. If the originator is null then the event was unreadable in some form (or there is a logic error).
        Returns:
        event originator object
      • getGenericErrorCode

        protected OMRSEventErrorCode getGenericErrorCode()
        Return the error code for the event. This is set to null if there is no error.
        Returns:
        error code enum or null
      • getErrorMessage

        public java.lang.String getErrorMessage()
        Return any error message for the event. This is null if there is no error. If there is an error, this error message is suitable for the local OMRS audit log.
        Returns:
        String errorMessage
      • getTargetMetadataCollectionId

        public java.lang.String getTargetMetadataCollectionId()
        This is the identifier of the metadata collection that needs to take action. It is null if there is no error condition.
        Returns:
        String metadata collection id
      • getTargetRemoteConnection

        public Connection getTargetRemoteConnection()
        This is the target's connection that is causing errors in the originator's server.
        Returns:
        OCF connection
      • getTargetTypeDefSummary

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary getTargetTypeDefSummary()
        Return the target's TypeDef summary.
        Returns:
        TypeDefSummary containing identifiers, category and version
      • getTargetAttributeTypeDef

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.AttributeTypeDef getTargetAttributeTypeDef()
        Return the target AttributeTypeDef.
        Returns:
        AttributeTypeDef object
      • getTargetInstanceGUID

        public java.lang.String getTargetInstanceGUID()
        Return the target's instance's unique identifier.
        Returns:
        String guid
      • getOtherOrigin

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProvenanceType getOtherOrigin()
        Return the provenance (origin) information for the other instance.
        Returns:
        InstanceProvenanceType enum
      • getOtherMetadataCollectionId

        public java.lang.String getOtherMetadataCollectionId()
        Return the unique identifier for the metadata collection containing the other instance.
        Returns:
        String guid
      • getOtherTypeDefSummary

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefSummary getOtherTypeDefSummary()
        Return the version of the TypeDef from the other repository.
        Returns:
        TypeDefSummary containing identifiers, category and version
      • getOtherTypeDef

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDef getOtherTypeDef()
        Return the TypeDef from the other repository.
        Returns:
        TypeDef object
      • getOtherAttributeTypeDef

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.AttributeTypeDef getOtherAttributeTypeDef()
        Return the AttributeTypeDef from the other repository.
        Returns:
        AttributeTypeDef object
      • getOtherInstanceGUID

        public java.lang.String getOtherInstanceGUID()
        Return the unique identifier for the other instance.
        Returns:
        String guid
      • getOMRSEventV1

        public org.odpi.openmetadata.repositoryservices.events.beans.v1.OMRSEventV1 getOMRSEventV1()
        Returns an OMRSEvent populated with details about a generic event. Specific subtypes override this method to create messages with specific subsections.
        Returns:
        OMRSEvent (Version 1) object
      • toString

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