Class OMRSEvent
java.lang.Object
org.odpi.openmetadata.repositoryservices.events.OMRSEvent
- Direct Known Subclasses:
OMRSInstanceEvent
,OMRSRegistryEvent
,OMRSTypeDefEvent
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.
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected OMRSEventCategory
protected OMRSEventDirection
protected OMRSEventOriginator
protected Date
protected OMRSEventErrorCode
protected AttributeTypeDef
protected String
protected String
protected InstanceProvenanceType
protected TypeDef
protected TypeDefSummary
protected AttributeTypeDef
protected String
protected String
protected Connection
protected TypeDefSummary
-
Constructor Summary
ConstructorDescriptionOMRSEvent
(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, String errorMessage, String targetMetadataCollectionId, Connection targetRemoteConnection) Outbound event constructor used for registry error events.OMRSEvent
(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, String errorMessage, String otherMetadataCollectionId, AttributeTypeDef otherAttributeTypeDef) Outbound constructor used for AttributeTypeDef conflict events.OMRSEvent
(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, String errorMessage, String targetMetadataCollectionId, AttributeTypeDef targetAttributeTypeDef, AttributeTypeDef otherAttributeTypeDef) Outbound constructor used for AttributeTypeDef conflict events.OMRSEvent
(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, String errorMessage, String otherMetadataCollectionId, TypeDefSummary otherTypeDefSummary) Outbound constructor used for TypeDef conflict events.OMRSEvent
(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, String errorMessage, String targetMetadataCollectionId, TypeDefSummary targetTypeDefSummary, String targetInstanceGUID, String otherMetadataCollectionId, InstanceProvenanceType otherOrigin, TypeDefSummary otherTypeDefSummary, String otherInstanceGUID) Outbound constructor used for metadata instance conflict events.OMRSEvent
(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, String errorMessage, String targetMetadataCollectionId, TypeDefSummary targetTypeDefSummary, String targetInstanceGUID, TypeDefSummary otherTypeDefSummary) Outbound constructor used for metadata instance type conflict events.OMRSEvent
(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, String errorMessage, String targetMetadataCollectionId, TypeDefSummary targetTypeDefSummary, TypeDef otherTypeDef) Outbound event constructor for a TypeDef patch mismatch warning.OMRSEvent
(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, String errorMessage, String targetMetadataCollectionId, TypeDefSummary targetTypeDefSummary, TypeDefSummary otherTypeDefSummary) Outbound constructor used for TypeDef conflict events. -
Method Summary
Modifier and TypeMethodDescriptionReturn any error message for the event.Return the category of the event.Return whether this is an inbound or outbound event.Return details of the originator of the event including the id of their metadata collection.Return the timestamp for the event.protected OMRSEventErrorCode
Return the error code for the event.Returns an OMRSEvent populated with details about a generic event.Return the AttributeTypeDef from the other repository.Return the unique identifier for the other instance.Return the unique identifier for the metadata collection containing the other instance.Return the provenance (origin) information for the other instance.Return the TypeDef from the other repository.Return the version of the TypeDef from the other repository.Return the target AttributeTypeDef.Return the target's instance's unique identifier.This is the identifier of the metadata collection that needs to take action.This is the target's connection that is causing errors in the originator's server.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.toString()
Standard toString method.
-
Field Details
-
eventTimestamp
-
eventDirection
-
eventCategory
-
eventOriginator
-
genericErrorCode
-
errorMessage
-
targetMetadataCollectionId
-
targetRemoteConnection
-
targetTypeDefSummary
-
targetAttributeTypeDef
-
targetInstanceGUID
-
otherOrigin
-
otherMetadataCollectionId
-
otherTypeDefSummary
-
otherTypeDef
-
otherAttributeTypeDef
-
otherInstanceGUID
-
-
Constructor Details
-
OMRSEvent
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
Outbound event constructor used when there is no error.- Parameters:
eventCategory
- category of event.
-
OMRSEvent
public OMRSEvent(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, String errorMessage, String targetMetadataCollectionId, Connection targetRemoteConnection) Outbound event constructor used for registry error events.- Parameters:
eventCategory
- category of event.genericErrorCode
- code for the errorerrorMessage
- detailed error message for remote audit logtargetMetadataCollectionId
- 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, String errorMessage, String targetMetadataCollectionId, TypeDefSummary targetTypeDefSummary, TypeDefSummary otherTypeDefSummary) Outbound constructor used for TypeDef conflict events.- Parameters:
eventCategory
- category of event.genericErrorCode
- code for the errorerrorMessage
- detailed error message for remote audit logtargetMetadataCollectionId
- 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, String errorMessage, String otherMetadataCollectionId, TypeDefSummary otherTypeDefSummary) Outbound constructor used for TypeDef conflict events.- Parameters:
eventCategory
- category of event.genericErrorCode
- code for the errorerrorMessage
- detailed error message for remote audit logotherMetadataCollectionId
- identifier of the metadata collection that sent the type.otherTypeDefSummary
- description of conflicting TypeDef.
-
OMRSEvent
public OMRSEvent(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, String errorMessage, String targetMetadataCollectionId, AttributeTypeDef targetAttributeTypeDef, AttributeTypeDef otherAttributeTypeDef) Outbound constructor used for AttributeTypeDef conflict events.- Parameters:
eventCategory
- category of event.genericErrorCode
- code for the errorerrorMessage
- detailed error message for remote audit logtargetMetadataCollectionId
- 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, String errorMessage, String otherMetadataCollectionId, AttributeTypeDef otherAttributeTypeDef) Outbound constructor used for AttributeTypeDef conflict events.- Parameters:
eventCategory
- category of event.genericErrorCode
- code for the errorerrorMessage
- detailed error message for remote audit logotherMetadataCollectionId
- identifier of the remote metadata collection.otherAttributeTypeDef
- description of conflicting AttributeTypeDef.
-
OMRSEvent
public OMRSEvent(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, String errorMessage, String targetMetadataCollectionId, TypeDefSummary targetTypeDefSummary, 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 logtargetMetadataCollectionId
- 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, String errorMessage, String targetMetadataCollectionId, TypeDefSummary targetTypeDefSummary, String targetInstanceGUID, String otherMetadataCollectionId, InstanceProvenanceType otherOrigin, TypeDefSummary otherTypeDefSummary, String otherInstanceGUID) Outbound constructor used for metadata instance conflict events.- Parameters:
eventCategory
- category of event.genericErrorCode
- code for the errorerrorMessage
- detailed error message for remote audit logtargetMetadataCollectionId
- metadata collection id of other repository with the conflicting instancetargetTypeDefSummary
- description of the target instance's TypeDeftargetInstanceGUID
- unique identifier for the source instanceotherOrigin
- origin of the other (older) metadata instanceotherMetadataCollectionId
- metadata collection of the other (older) metadata instanceotherTypeDefSummary
- details of the other (older) instance's TypeDefotherInstanceGUID
- unique identifier for the other (older) instance
-
OMRSEvent
public OMRSEvent(OMRSEventCategory eventCategory, OMRSEventErrorCode genericErrorCode, String errorMessage, String targetMetadataCollectionId, TypeDefSummary targetTypeDefSummary, String targetInstanceGUID, TypeDefSummary otherTypeDefSummary) Outbound constructor used for metadata instance type conflict events.- Parameters:
eventCategory
- category of event.genericErrorCode
- code for the errorerrorMessage
- detailed error message for remote audit logtargetMetadataCollectionId
- metadata collection id of other repository with the conflicting instancetargetTypeDefSummary
- details of the target instance's TypeDeftargetInstanceGUID
- unique identifier for the source instanceotherTypeDefSummary
- details of the local TypeDef
-
-
Method Details
-
setEventOriginator
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
Return whether this is an inbound or outbound event. This is used for messages.- Returns:
- OMRSEventDirection enum
-
getEventTimestamp
Return the timestamp for the event.- Returns:
- Date object
-
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
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
Return the error code for the event. This is set to null if there is no error.- Returns:
- error code enum or null
-
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
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
This is the target's connection that is causing errors in the originator's server.- Returns:
- OCF connection
-
getTargetTypeDefSummary
Return the target's TypeDef summary.- Returns:
- TypeDefSummary containing identifiers, category and version
-
getTargetAttributeTypeDef
Return the target AttributeTypeDef.- Returns:
- AttributeTypeDef object
-
getTargetInstanceGUID
Return the target's instance's unique identifier.- Returns:
- String guid
-
getOtherOrigin
Return the provenance (origin) information for the other instance.- Returns:
- InstanceProvenanceType enum
-
getOtherMetadataCollectionId
Return the unique identifier for the metadata collection containing the other instance.- Returns:
- String guid
-
getOtherTypeDefSummary
Return the version of the TypeDef from the other repository.- Returns:
- TypeDefSummary containing identifiers, category and version
-
getOtherTypeDef
Return the TypeDef from the other repository.- Returns:
- TypeDef object
-
getOtherAttributeTypeDef
Return the AttributeTypeDef from the other repository.- Returns:
- AttributeTypeDef object
-
getOtherInstanceGUID
Return the unique identifier for the other instance.- Returns:
- String guid
-
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
Standard toString method.
-