Class Event<T>
- java.lang.Object
-
- org.odpi.openmetadata.connector.sas.event.model.Event<T>
-
public class Event<T> extends java.lang.ObjectThe common event model class. This is used to provide a generic, and standard, approach to submitting events to a message broker. Serves as a wrapper around any generic object instance which can be customized to provide additional information for the specific event.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONTENT_TYPEstatic intEVENT_VERSION
-
Constructor Summary
Constructors Modifier Constructor Description Event()protectedEvent(T payload, EventHeaders headers, java.lang.String id, java.lang.String type, java.lang.String payloadType, java.lang.String user, java.util.Date timeStamp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)EventHeadersgetHeaders()Returns the collection of headers associated with the eventjava.lang.StringgetId()Returns the unique identifier of the eventTgetPayload()The customized event payload.java.lang.StringgetPayloadAsString()Returns the event's payload in a JSON string format.java.lang.StringgetPayloadType()Returns the type of the payloadjava.util.DategetTimeStamp()Represents the exact time when the event took place.java.lang.StringgetType()The specific type of event.java.lang.StringgetUser()The name of the user associated with the event.intgetVersion()Returns the version of the event modelinthashCode()java.lang.StringtoString()
-
-
-
Field Detail
-
EVENT_VERSION
public static final int EVENT_VERSION
- See Also:
- Constant Field Values
-
CONTENT_TYPE
public static final java.lang.String CONTENT_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Event
public Event()
-
Event
protected Event(T payload, EventHeaders headers, java.lang.String id, java.lang.String type, java.lang.String payloadType, java.lang.String user, java.util.Date timeStamp)
-
-
Method Detail
-
getVersion
public int getVersion()
Returns the version of the event model- Returns:
- version
-
getId
public java.lang.String getId()
Returns the unique identifier of the event- Returns:
- id
-
getUser
public java.lang.String getUser()
The name of the user associated with the event.This value may differ depending on the context. For example, this may represent the actual user currently authenticated within the system, or it may represent a system wide user that is executing an operation on behalf of someone.
- Returns:
- user name
-
getTimeStamp
public java.util.Date getTimeStamp()
Represents the exact time when the event took place. This may be equivalent to the current time (i.e. when the event is published) or a specific time that occurred in the past.- Returns:
- time stamp
-
getType
public java.lang.String getType()
The specific type of event.- Returns:
- event type
-
getPayloadType
public java.lang.String getPayloadType()
Returns the type of the payload- Returns:
- payload type
-
getHeaders
public EventHeaders getHeaders()
Returns the collection of headers associated with the event- Returns:
- headers
-
getPayload
public T getPayload()
The customized event payload.- Returns:
- data
-
getPayloadAsString
public java.lang.String getPayloadAsString() throws com.fasterxml.jackson.core.JsonProcessingExceptionReturns the event's payload in a JSON string format.- Returns:
- payload
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- when the event payload fails to serialize to json properly
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-