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 T
protected final String
protected final URI
protected final String
protected final URI
protected final String
protected final String
protected final ZonedDateTime
protected final String
Fields 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.void
validate()
-
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:CloudEventMetadata
Identifies the event. Mandatory attribute.- Specified by:
getId
in interfaceCloudEventMetadata<T>
- Returns:
- the id, cannot be
null
-
getSource
Description copied from interface:CloudEventMetadata
Identifies the context in which an event happened. Mandatory attribute.- Specified by:
getSource
in interfaceCloudEventMetadata<T>
- Returns:
- the source, cannot be
null
-
getSpecVersion
Description copied from interface:CloudEventMetadata
The version of the CloudEvents specification which the event uses. Mandatory attribute.- Specified by:
getSpecVersion
in interfaceCloudEventMetadata<T>
- Returns:
- the specification version
-
getType
Description copied from interface:CloudEventMetadata
This attribute contains a value describing the type of event related to the originating occurrence. Mandatory attribute.- Specified by:
getType
in interfaceCloudEventMetadata<T>
- Returns:
- the type
-
getDataContentType
Description copied from interface:CloudEventMetadata
Content type of data value.- Specified by:
getDataContentType
in interfaceCloudEventMetadata<T>
- Returns:
- the content type if any, empty if none.
-
getDataSchema
Description copied from interface:CloudEventMetadata
Identifies the schema that data adheres to.- Specified by:
getDataSchema
in interfaceCloudEventMetadata<T>
- Returns:
- the schema URI if any, empty if none.
-
getSubject
Description copied from interface:CloudEventMetadata
This describes the subject of the event in the context of the event producer (identified by source).- Specified by:
getSubject
in interfaceCloudEventMetadata<T>
- Returns:
- the subject if any, empty if none
-
getTimeStamp
Description copied from interface:CloudEventMetadata
Timestamp of when the occurrence happened.- Specified by:
getTimeStamp
in interfaceCloudEventMetadata<T>
- Returns:
- the timestamp if any, empty if none
-
getExtension
Description copied from interface:CloudEventMetadata
A CloudEvent may include any number of additional context attributes with distinct names, known as "extension attributes". This method allows retrieving these attributes.- Specified by:
getExtension
in 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:CloudEventMetadata
A CloudEvent may include any number of additional context attributes with distinct names, known as "extension attributes". This method allows retrieving these attributes.- Specified by:
getExtensions
in interfaceCloudEventMetadata<T>
- Returns:
- the map of extension attributes, potentially empty.
-
getData
Description copied from interface:CloudEventMetadata
The event payload. It is the owner message payload.- Specified by:
getData
in interfaceCloudEventMetadata<T>
- Returns:
- the payload, can be
null
-