Package akka.javasdk

Interface CloudEvent


public interface CloudEvent
CloudEvent representation of Metadata.
  • Method Details Link icon

    • specversion Link icon

      String specversion()
      The CloudEvent spec version.
      Returns:
      The spec version.
    • id Link icon

      String id()
      The id of this CloudEvent. According to the CloudEvents https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id[specification], the ID is not guaranteed to be the same for redelivery of the same event, hence we can't use it for deduplication.
      Returns:
      The id.
    • withId Link icon

      CloudEvent withId(String id)
      Return a new CloudEvent with the given id.
      Parameters:
      id - The id to set.
      Returns:
      A copy of this CloudEvent.
    • source Link icon

      URI source()
      The source of this CloudEvent.
      Returns:
      The source.
    • withSource Link icon

      CloudEvent withSource(URI source)
      Return a new CloudEvent with the given source.
      Parameters:
      source - The source to set.
      Returns:
      A copy of this CloudEvent.
    • type Link icon

      String type()
      The type of this CloudEvent.
      Returns:
      The type.
    • withType Link icon

      CloudEvent withType(String type)
      Return a new CloudEvent with the given type.
      Parameters:
      type - The type to set.
      Returns:
      A copy of this CloudEvent.
    • datacontenttype Link icon

      Optional<String> datacontenttype()
      The data content type of this CloudEvent.
      Returns:
      The data content type, if set.
    • withDatacontenttype Link icon

      CloudEvent withDatacontenttype(String datacontenttype)
      Return a new CloudEvent with the given data content type.
      Parameters:
      datacontenttype - The data content type to set.
      Returns:
      A copy of this CloudEvent.
    • clearDatacontenttype Link icon

      CloudEvent clearDatacontenttype()
      Clear the data content type of this CloudEvent, if set.
      Returns:
      A copy of this CloudEvent.
    • dataschema Link icon

      Optional<URI> dataschema()
      The data schema of this CloudEvent.
      Returns:
      The data schema, if set.
    • withDataschema Link icon

      CloudEvent withDataschema(URI dataschema)
      Return a new CloudEvent with the given data schema.
      Parameters:
      dataschema - The data schema to set.
      Returns:
      A copy of this CloudEvent.
    • clearDataschema Link icon

      CloudEvent clearDataschema()
      Clear the data schema of this CloudEvent, if set.
      Returns:
      A copy of this CloudEvent.
    • subject Link icon

      Optional<String> subject()
      The subject of this CloudEvent.
      Returns:
      The subject, if set.
    • withSubject Link icon

      CloudEvent withSubject(String subject)
      Return a new CloudEvent with the given subject.
      Parameters:
      subject - The subject to set.
      Returns:
      A copy of this CloudEvent.
    • clearSubject Link icon

      CloudEvent clearSubject()
      Clear the subject of this CloudEvent, if set.
      Returns:
      A copy of this CloudEvent.
    • sequence Link icon

      Optional<Long> sequence()
      The sequence of this CloudEvent parsed to Long value.
    • sequenceString Link icon

      Optional<String> sequenceString()
      The sequence of this CloudEvent.
    • withSequence Link icon

      CloudEvent withSequence(String sequence)
      Return a new CloudEvent with the given sequence.
      Parameters:
      sequence - The sequence to set.
      Returns:
      A copy of this CloudEvent.
    • clearSequence Link icon

      CloudEvent clearSequence()
      Clear the sequence of this CloudEvent, if set.
      Returns:
      A copy of this CloudEvent.
    • sequenceType Link icon

      Optional<String> sequenceType()
      The sequence type of this CloudEvent.
    • withSequenceType Link icon

      CloudEvent withSequenceType(String sequenceType)
      Return a new CloudEvent with the given sequence type.
      Parameters:
      sequenceType - The sequence type to set.
      Returns:
      A copy of this CloudEvent.
    • clearSequenceType Link icon

      CloudEvent clearSequenceType()
      Clear the sequence type of this CloudEvent, if set.
      Returns:
      A copy of this CloudEvent.
    • time Link icon

      The time of this CloudEvent.
      Returns:
      The time, if set.
    • withTime Link icon

      CloudEvent withTime(ZonedDateTime time)
      Return a new CloudEvent with the given time.
      Parameters:
      time - The time to set.
      Returns:
      A copy of this CloudEvent.
    • clearTime Link icon

      CloudEvent clearTime()
      Clear the time of this CloudEvent, if set.
      Returns:
      A copy of this CloudEvent.
    • asMetadata Link icon

      Metadata asMetadata()
      Return this CloudEvent represented as Metadata.

      If this CloudEvent was created by {Metadata.asCloudEvent()}, then any non CloudEvent metadata that was present will still be present.

      Returns:
      This CloudEvent expressed as metadata.
    • of Link icon

      static CloudEvent of(String id, URI source, String type)
      Create a CloudEvent.
      Parameters:
      id - The id of the CloudEvent.
      source - The source of the CloudEvent.
      type - The type of the CloudEvent.
      Returns:
      The newly created CloudEvent.