Class BaseCloudEventMetadata<T>
java.lang.Object
io.smallrye.reactive.messaging.ce.impl.BaseCloudEventMetadata<T>
- Type Parameters:
T- the type of data
- All Implemented Interfaces:
CloudEventMetadata<T>
- Direct Known Subclasses:
DefaultIncomingCloudEventMetadata,DefaultOutgoingCloudEventMetadata
Default implementation of the
CloudEventMetadata interface-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Tprotected final Stringprotected final URIprotected final Stringprotected final URIprotected final Stringprotected final Stringprotected final ZonedDateTimeprotected final StringFields inherited from interface io.smallrye.reactive.messaging.ce.CloudEventMetadata
CE_ATTRIBUTE_DATA_CONTENT_TYPE, CE_ATTRIBUTE_DATA_SCHEMA, CE_ATTRIBUTE_ID, CE_ATTRIBUTE_SOURCE, CE_ATTRIBUTE_SPEC_VERSION, CE_ATTRIBUTE_SUBJECT, CE_ATTRIBUTE_TIME, CE_ATTRIBUTE_TYPE, CE_VERSION_1_0 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetData()The event payload.Content type of data value.Identifies the schema that data adheres to.<A> Optional<A>getExtension(String name) A CloudEvent may include any number of additional context attributes with distinct names, known as "extension attributes".A CloudEvent may include any number of additional context attributes with distinct names, known as "extension attributes".getId()Identifies the event.Identifies the context in which an event happened.The version of the CloudEvents specification which the event uses.This describes the subject of the event in the context of the event producer (identified by source).Timestamp of when the occurrence happened.getType()This attribute contains a value describing the type of event related to the originating occurrence.voidvalidate()
-
Field Details
-
id
-
specVersion
-
source
-
type
-
dataContentType
-
dataSchema
-
subject
-
timestamp
-
extensions
-
data
-
-
Constructor Details
-
BaseCloudEventMetadata
-
-
Method Details
-
validate
public void validate() -
getId
Description copied from interface:CloudEventMetadataIdentifies the event. Mandatory attribute.- Specified by:
getIdin interfaceCloudEventMetadata<T>- Returns:
- the id, cannot be
null
-
getSource
Description copied from interface:CloudEventMetadataIdentifies the context in which an event happened. Mandatory attribute.- Specified by:
getSourcein interfaceCloudEventMetadata<T>- Returns:
- the source, cannot be
null
-
getSpecVersion
Description copied from interface:CloudEventMetadataThe version of the CloudEvents specification which the event uses. Mandatory attribute.- Specified by:
getSpecVersionin interfaceCloudEventMetadata<T>- Returns:
- the specification version
-
getType
Description copied from interface:CloudEventMetadataThis attribute contains a value describing the type of event related to the originating occurrence. Mandatory attribute.- Specified by:
getTypein interfaceCloudEventMetadata<T>- Returns:
- the type
-
getDataContentType
Description copied from interface:CloudEventMetadataContent type of data value.- Specified by:
getDataContentTypein interfaceCloudEventMetadata<T>- Returns:
- the content type if any, empty if none.
-
getDataSchema
Description copied from interface:CloudEventMetadataIdentifies the schema that data adheres to.- Specified by:
getDataSchemain interfaceCloudEventMetadata<T>- Returns:
- the schema URI if any, empty if none.
-
getSubject
Description copied from interface:CloudEventMetadataThis describes the subject of the event in the context of the event producer (identified by source).- Specified by:
getSubjectin interfaceCloudEventMetadata<T>- Returns:
- the subject if any, empty if none
-
getTimeStamp
Description copied from interface:CloudEventMetadataTimestamp of when the occurrence happened.- Specified by:
getTimeStampin interfaceCloudEventMetadata<T>- Returns:
- the timestamp if any, empty if none
-
getExtension
Description copied from interface:CloudEventMetadataA CloudEvent may include any number of additional context attributes with distinct names, known as "extension attributes". This method allows retrieving these attributes.- Specified by:
getExtensionin interfaceCloudEventMetadata<T>- Parameters:
name- the name of the attribute, must not benull- Returns:
- the value of the attribute, empty if not present.
-
getExtensions
Description copied from interface:CloudEventMetadataA CloudEvent may include any number of additional context attributes with distinct names, known as "extension attributes". This method allows retrieving these attributes.- Specified by:
getExtensionsin interfaceCloudEventMetadata<T>- Returns:
- the map of extension attributes, potentially empty.
-
getData
Description copied from interface:CloudEventMetadataThe event payload. It is the owner message payload.- Specified by:
getDatain interfaceCloudEventMetadata<T>- Returns:
- the payload, can be
null
-