- All Known Subinterfaces:
CloudEvent,CloudEventContext
@ParametersAreNonnullByDefault
public interface CloudEventAttributes
Interface which defines CloudEvent attributes as per specification
For more info: Context attributes
-
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String attributeName) Get the context attribute namedattributeNameA common way to get the media type of CloudEvents 'data';getId()getTime()getType()
-
Method Details
-
getSpecVersion
SpecVersion getSpecVersion()- Returns:
- The version of the CloudEvents specification which the event uses
-
getId
String getId()- Returns:
- Identifies the event. Producers MUST ensure that source + id is unique for each distinct event
-
getType
String getType()- Returns:
- A value describing the type of event related to the originating occurrence.
-
getSource
URI getSource()- Returns:
- The context in which an event happened.
-
getDataContentType
A common way to get the media type of CloudEvents 'data';- Returns:
- If has a value, it MUST follows the RFC2046
-
getDataSchema
- Returns:
- Return the URI specifying the location of the schema for the provided data
-
getSubject
- Returns:
- Subject of the event
-
getTime
- Returns:
- Timestamp of when the occurrence happened
-
getAttribute
Get the context attribute namedattributeName- Parameters:
attributeName- a valid attribute name- Returns:
- the attribute value or null if this instance doesn't contain such attribute
- Throws:
IllegalArgumentException- if the provided attribute name it's not a valid attribute for this spec
-
getAttributeNames
- Returns:
- The non-null context attributes names in this instance
-