Interface CloudEventMetadata<T>
-
- Type Parameters:
T
- the data type
- All Known Subinterfaces:
IncomingCloudEventMetadata<T>
,IncomingKafkaCloudEventMetadata<K,T>
,OutgoingCloudEventMetadata<T>
- All Known Implementing Classes:
BaseCloudEventMetadata
,DefaultIncomingCloudEventMetadata
,DefaultIncomingKafkaCloudEventMetadata
,DefaultOutgoingCloudEventMetadata
public interface CloudEventMetadata<T>
Represents Cloud Event metadata See https://github.com/cloudevents/spec/blob/v1.0/spec.md.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CE_ATTRIBUTE_DATA_CONTENT_TYPE
static String
CE_ATTRIBUTE_DATA_SCHEMA
static String
CE_ATTRIBUTE_ID
static String
CE_ATTRIBUTE_SOURCE
static String
CE_ATTRIBUTE_SPEC_VERSION
static String
CE_ATTRIBUTE_SUBJECT
static String
CE_ATTRIBUTE_TIME
static String
CE_ATTRIBUTE_TYPE
static String
CE_VERSION_1_0
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Field Detail
-
CE_ATTRIBUTE_SPEC_VERSION
static final String CE_ATTRIBUTE_SPEC_VERSION
- See Also:
- Constant Field Values
-
CE_ATTRIBUTE_ID
static final String CE_ATTRIBUTE_ID
- See Also:
- Constant Field Values
-
CE_ATTRIBUTE_SOURCE
static final String CE_ATTRIBUTE_SOURCE
- See Also:
- Constant Field Values
-
CE_ATTRIBUTE_TYPE
static final String CE_ATTRIBUTE_TYPE
- See Also:
- Constant Field Values
-
CE_ATTRIBUTE_DATA_CONTENT_TYPE
static final String CE_ATTRIBUTE_DATA_CONTENT_TYPE
- See Also:
- Constant Field Values
-
CE_ATTRIBUTE_DATA_SCHEMA
static final String CE_ATTRIBUTE_DATA_SCHEMA
- See Also:
- Constant Field Values
-
CE_ATTRIBUTE_SUBJECT
static final String CE_ATTRIBUTE_SUBJECT
- See Also:
- Constant Field Values
-
CE_ATTRIBUTE_TIME
static final String CE_ATTRIBUTE_TIME
- See Also:
- Constant Field Values
-
CE_VERSION_1_0
static final String CE_VERSION_1_0
- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
String getId()
Identifies the event. Mandatory attribute.- Returns:
- the id, cannot be
null
-
getSource
URI getSource()
Identifies the context in which an event happened. Mandatory attribute.- Returns:
- the source, cannot be
null
-
getSpecVersion
String getSpecVersion()
The version of the CloudEvents specification which the event uses. Mandatory attribute.- Returns:
- the specification version
-
getType
String getType()
This attribute contains a value describing the type of event related to the originating occurrence. Mandatory attribute.- Returns:
- the type
-
getDataContentType
Optional<String> getDataContentType()
Content type of data value.- Returns:
- the content type if any, empty if none.
-
getDataSchema
Optional<URI> getDataSchema()
Identifies the schema that data adheres to.- Returns:
- the schema URI if any, empty if none.
-
getSubject
Optional<String> getSubject()
This describes the subject of the event in the context of the event producer (identified by source).- Returns:
- the subject if any, empty if none
-
getTimeStamp
Optional<ZonedDateTime> getTimeStamp()
Timestamp of when the occurrence happened.- Returns:
- the timestamp if any, empty if none
-
getExtension
<A> Optional<A> getExtension(String name)
A CloudEvent may include any number of additional context attributes with distinct names, known as "extension attributes". This method allows retrieving these attributes.- Parameters:
name
- the name of the attribute, must not benull
- Returns:
- the value of the attribute, empty if not present.
-
getExtensions
Map<String,Object> getExtensions()
A CloudEvent may include any number of additional context attributes with distinct names, known as "extension attributes". This method allows retrieving these attributes.- Returns:
- the map of extension attributes, potentially empty.
-
getData
T getData()
The event payload. It is the owner message payload.- Returns:
- the payload, can be
null
-
-