Class DefaultIncomingKafkaCloudEventMetadata<K,T>
- java.lang.Object
-
- io.smallrye.reactive.messaging.kafka.impl.ce.DefaultIncomingKafkaCloudEventMetadata<K,T>
-
- All Implemented Interfaces:
CloudEventMetadata<T>,IncomingCloudEventMetadata<T>,IncomingKafkaCloudEventMetadata<K,T>
public class DefaultIncomingKafkaCloudEventMetadata<K,T> extends Object implements IncomingKafkaCloudEventMetadata<K,T>
-
-
Field Summary
-
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
-
Fields inherited from interface io.smallrye.reactive.messaging.kafka.IncomingKafkaCloudEventMetadata
CE_KAFKA_KEY, CE_KAFKA_TOPIC
-
-
Constructor Summary
Constructors Constructor Description DefaultIncomingKafkaCloudEventMetadata(IncomingCloudEventMetadata<T> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetData()The event payload.Optional<String>getDataContentType()Content type of data value.Optional<URI>getDataSchema()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".Map<String,Object>getExtensions()A CloudEvent may include any number of additional context attributes with distinct names, known as "extension attributes".StringgetId()Identifies the event.URIgetSource()Identifies the context in which an event happened.StringgetSpecVersion()The version of the CloudEvents specification which the event uses.Optional<String>getSubject()This describes the subject of the event in the context of the event producer (identified by source).Optional<ZonedDateTime>getTimeStamp()Timestamp of when the occurrence happened.StringgetType()This attribute contains a value describing the type of event related to the originating occurrence.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.smallrye.reactive.messaging.kafka.IncomingKafkaCloudEventMetadata
getKey, getTopic
-
-
-
-
Constructor Detail
-
DefaultIncomingKafkaCloudEventMetadata
public DefaultIncomingKafkaCloudEventMetadata(IncomingCloudEventMetadata<T> delegate)
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:CloudEventMetadataIdentifies the event. Mandatory attribute.- Specified by:
getIdin interfaceCloudEventMetadata<K>- Returns:
- the id, cannot be
null
-
getSource
public URI getSource()
Description copied from interface:CloudEventMetadataIdentifies the context in which an event happened. Mandatory attribute.- Specified by:
getSourcein interfaceCloudEventMetadata<K>- Returns:
- the source, cannot be
null
-
getSpecVersion
public String getSpecVersion()
Description copied from interface:CloudEventMetadataThe version of the CloudEvents specification which the event uses. Mandatory attribute.- Specified by:
getSpecVersionin interfaceCloudEventMetadata<K>- Returns:
- the specification version
-
getType
public String 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<K>- Returns:
- the type
-
getDataContentType
public Optional<String> getDataContentType()
Description copied from interface:CloudEventMetadataContent type of data value.- Specified by:
getDataContentTypein interfaceCloudEventMetadata<K>- Returns:
- the content type if any, empty if none.
-
getDataSchema
public Optional<URI> getDataSchema()
Description copied from interface:CloudEventMetadataIdentifies the schema that data adheres to.- Specified by:
getDataSchemain interfaceCloudEventMetadata<K>- Returns:
- the schema URI if any, empty if none.
-
getSubject
public Optional<String> 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<K>- Returns:
- the subject if any, empty if none
-
getTimeStamp
public Optional<ZonedDateTime> getTimeStamp()
Description copied from interface:CloudEventMetadataTimestamp of when the occurrence happened.- Specified by:
getTimeStampin interfaceCloudEventMetadata<K>- Returns:
- the timestamp if any, empty if none
-
getExtension
public <A> Optional<A> getExtension(String name)
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<K>- Parameters:
name- the name of the attribute, must not benull- Returns:
- the value of the attribute, empty if not present.
-
getExtensions
public Map<String,Object> 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<K>- Returns:
- the map of extension attributes, potentially empty.
-
getData
public T getData()
Description copied from interface:CloudEventMetadataThe event payload. It is the owner message payload.- Specified by:
getDatain interfaceCloudEventMetadata<K>- Returns:
- the payload, can be
null
-
-