Interface CloudEventMetadata<T>
- Type Parameters:
T
- the data type
- All Known Subinterfaces:
IncomingCloudEventMetadata<T>
,OutgoingCloudEventMetadata<T>
- All Known Implementing Classes:
BaseCloudEventMetadata
,DefaultIncomingCloudEventMetadata
,DefaultOutgoingCloudEventMetadata
public interface CloudEventMetadata<T>
Represents Cloud Event metadata
See https://github.com/cloudevents/spec/blob/v1.0/spec.md.
-
Field Summary
-
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.
-
Field Details
-
CE_ATTRIBUTE_SPEC_VERSION
- See Also:
-
CE_ATTRIBUTE_ID
- See Also:
-
CE_ATTRIBUTE_SOURCE
- See Also:
-
CE_ATTRIBUTE_TYPE
- See Also:
-
CE_ATTRIBUTE_DATA_CONTENT_TYPE
- See Also:
-
CE_ATTRIBUTE_DATA_SCHEMA
- See Also:
-
CE_ATTRIBUTE_SUBJECT
- See Also:
-
CE_ATTRIBUTE_TIME
- See Also:
-
CE_VERSION_1_0
- See Also:
-
-
Method Details
-
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
Content type of data value.- Returns:
- the content type if any, empty if none.
-
getDataSchema
Identifies the schema that data adheres to.- Returns:
- the schema URI if any, empty if none.
-
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 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
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
-