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 T
getData()
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".String
getId()
Identifies the event.URI
getSource()
Identifies the context in which an event happened.String
getSpecVersion()
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.String
getType()
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:CloudEventMetadata
Identifies the event. Mandatory attribute.- Specified by:
getId
in interfaceCloudEventMetadata<K>
- Returns:
- the id, cannot be
null
-
getSource
public URI getSource()
Description copied from interface:CloudEventMetadata
Identifies the context in which an event happened. Mandatory attribute.- Specified by:
getSource
in interfaceCloudEventMetadata<K>
- Returns:
- the source, cannot be
null
-
getSpecVersion
public String getSpecVersion()
Description copied from interface:CloudEventMetadata
The version of the CloudEvents specification which the event uses. Mandatory attribute.- Specified by:
getSpecVersion
in interfaceCloudEventMetadata<K>
- Returns:
- the specification version
-
getType
public String 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<K>
- Returns:
- the type
-
getDataContentType
public Optional<String> getDataContentType()
Description copied from interface:CloudEventMetadata
Content type of data value.- Specified by:
getDataContentType
in interfaceCloudEventMetadata<K>
- Returns:
- the content type if any, empty if none.
-
getDataSchema
public Optional<URI> getDataSchema()
Description copied from interface:CloudEventMetadata
Identifies the schema that data adheres to.- Specified by:
getDataSchema
in interfaceCloudEventMetadata<K>
- Returns:
- the schema URI if any, empty if none.
-
getSubject
public Optional<String> 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<K>
- Returns:
- the subject if any, empty if none
-
getTimeStamp
public Optional<ZonedDateTime> getTimeStamp()
Description copied from interface:CloudEventMetadata
Timestamp of when the occurrence happened.- Specified by:
getTimeStamp
in interfaceCloudEventMetadata<K>
- Returns:
- the timestamp if any, empty if none
-
getExtension
public <A> Optional<A> getExtension(String name)
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<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: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<K>
- Returns:
- the map of extension attributes, potentially empty.
-
getData
public T getData()
Description copied from interface:CloudEventMetadata
The event payload. It is the owner message payload.- Specified by:
getData
in interfaceCloudEventMetadata<K>
- Returns:
- the payload, can be
null
-
-