Class OMRSEvent
- java.lang.Object
-
- org.odpi.openmetadata.repositoryservices.events.OMRSEvent
-
- Direct Known Subclasses:
OMRSInstanceEvent,OMRSRegistryEvent,OMRSTypeDefEvent
public abstract class OMRSEvent extends 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.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringerrorMessageprotected OMRSEventCategoryeventCategoryprotected OMRSEventDirectioneventDirectionprotected OMRSEventOriginatoreventOriginatorprotected DateeventTimestampprotected OMRSEventErrorCodegenericErrorCodeprotected AttributeTypeDefotherAttributeTypeDefprotected StringotherInstanceGUIDprotected StringotherMetadataCollectionIdprotected InstanceProvenanceTypeotherOriginprotected TypeDefotherTypeDefprotected TypeDefSummaryotherTypeDefSummaryprotected AttributeTypeDeftargetAttributeTypeDefprotected StringtargetInstanceGUIDprotected StringtargetMetadataCollectionIdprotected ConnectiontargetRemoteConnectionprotected TypeDefSummarytargetTypeDefSummary
-
Constructor Summary
Constructors Constructor Description OMRSEvent(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetErrorMessage()Return any error message for the event.OMRSEventCategorygetEventCategory()Return the category of the event.OMRSEventDirectiongetEventDirection()Return whether this is an inbound or outbound event.OMRSEventOriginatorgetEventOriginator()Return details of the originator of the event including the id of their metadata collection.DategetEventTimestamp()Return the timestamp for the event.protected OMRSEventErrorCodegetGenericErrorCode()Return the error code for the event.OMRSEventV1getOMRSEventV1()Returns an OMRSEvent populated with details about a generic event.AttributeTypeDefgetOtherAttributeTypeDef()Return the AttributeTypeDef from the other repository.StringgetOtherInstanceGUID()Return the unique identifier for the other instance.StringgetOtherMetadataCollectionId()Return the unique identifier for the metadata collection containing the other instance.InstanceProvenanceTypegetOtherOrigin()Return the provenance (origin) information for the other instance.TypeDefgetOtherTypeDef()Return the TypeDef from the other repository.TypeDefSummarygetOtherTypeDefSummary()Return the version of the TypeDef from the other repository.AttributeTypeDefgetTargetAttributeTypeDef()Return the target AttributeTypeDef.StringgetTargetInstanceGUID()Return the target's instance's unique identifier.StringgetTargetMetadataCollectionId()This is the identifier of the metadata collection that needs to take action.ConnectiongetTargetRemoteConnection()This is the target's connection that is causing errors in the originator's server.TypeDefSummarygetTargetTypeDefSummary()Return the target's TypeDef summary.voidsetEventOriginator(OMRSEventOriginator eventOriginator)Set up details of the event originator used by the event publisher for outbound events.StringtoString()Standard toString method.
-
-
-
Field Detail
-
eventTimestamp
protected Date eventTimestamp
-
eventDirection
protected OMRSEventDirection eventDirection
-
eventCategory
protected OMRSEventCategory eventCategory
-
eventOriginator
protected OMRSEventOriginator eventOriginator
-
genericErrorCode
protected OMRSEventErrorCode genericErrorCode
-
errorMessage
protected String errorMessage
-
targetMetadataCollectionId
protected String targetMetadataCollectionId
-
targetRemoteConnection
protected Connection targetRemoteConnection
-
targetTypeDefSummary
protected TypeDefSummary targetTypeDefSummary
-
targetAttributeTypeDef
protected AttributeTypeDef targetAttributeTypeDef
-
targetInstanceGUID
protected String targetInstanceGUID
-
otherOrigin
protected InstanceProvenanceType otherOrigin
-
otherMetadataCollectionId
protected String otherMetadataCollectionId
-
otherTypeDefSummary
protected TypeDefSummary otherTypeDefSummary
-
otherTypeDef
protected TypeDef otherTypeDef
-
otherAttributeTypeDef
protected AttributeTypeDef otherAttributeTypeDef
-
otherInstanceGUID
protected String otherInstanceGUID
-
-
Constructor Detail
-
OMRSEvent
public OMRSEvent(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, 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 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 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 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 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 TypeDefSummary getTargetTypeDefSummary()
Return the target's TypeDef summary.- Returns:
- TypeDefSummary containing identifiers, category and version
-
getTargetAttributeTypeDef
public AttributeTypeDef getTargetAttributeTypeDef()
Return the target AttributeTypeDef.- Returns:
- AttributeTypeDef object
-
getTargetInstanceGUID
public String getTargetInstanceGUID()
Return the target's instance's unique identifier.- Returns:
- String guid
-
getOtherOrigin
public InstanceProvenanceType getOtherOrigin()
Return the provenance (origin) information for the other instance.- Returns:
- InstanceProvenanceType enum
-
getOtherMetadataCollectionId
public String getOtherMetadataCollectionId()
Return the unique identifier for the metadata collection containing the other instance.- Returns:
- String guid
-
getOtherTypeDefSummary
public TypeDefSummary getOtherTypeDefSummary()
Return the version of the TypeDef from the other repository.- Returns:
- TypeDefSummary containing identifiers, category and version
-
getOtherTypeDef
public TypeDef getOtherTypeDef()
Return the TypeDef from the other repository.- Returns:
- TypeDef object
-
getOtherAttributeTypeDef
public AttributeTypeDef getOtherAttributeTypeDef()
Return the AttributeTypeDef from the other repository.- Returns:
- AttributeTypeDef object
-
getOtherInstanceGUID
public String getOtherInstanceGUID()
Return the unique identifier for the other instance.- Returns:
- String guid
-
getOMRSEventV1
public 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
-
-