Interface CloudEventAttributes

All Known Subinterfaces:
CloudEvent, CloudEventContext

@ParametersAreNonnullByDefault public interface CloudEventAttributes
Interface which defines CloudEvent attributes as per specification

For more info: Context attributes

  • 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

      @Nullable String getDataContentType()
      A common way to get the media type of CloudEvents 'data';
      Returns:
      If has a value, it MUST follows the RFC2046
    • getDataSchema

      @Nullable URI getDataSchema()
      Returns:
      Return the URI specifying the location of the schema for the provided data
    • getSubject

      @Nullable String getSubject()
      Returns:
      Subject of the event
    • getTime

      Returns:
      Timestamp of when the occurrence happened
    • getAttribute

      @Nullable Object getAttribute(String attributeName) throws IllegalArgumentException
      Get the context attribute named attributeName
      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

      default Set<String> getAttributeNames()
      Returns:
      The non-null context attributes names in this instance