Class AbstractDataEvent<T>

java.lang.Object
io.automatiko.engine.api.event.AbstractDataEvent<T>
Type Parameters:
T - the payload
All Implemented Interfaces:
DataEvent<T>

public abstract class AbstractDataEvent<T> extends Object implements DataEvent<T>
This is an abstract implementation of the DataEvent that contains basic common attributes referring to automatiko processes metadata. This class can be extended mainly by Services that need to publish events to be indexed by the Data-Index service.
  • Field Details

    • specversion

      protected String specversion
    • id

      protected String id
    • source

      protected String source
    • type

      protected String type
    • time

      protected String time
    • subject

      protected String subject
    • datacontenttype

      protected String datacontenttype
    • data

      protected T data
    • extensions

      protected Map<String,Object> extensions
  • Constructor Details

  • Method Details

    • getSource

      public String getSource()
      Description copied from interface: DataEvent
      Returns source of the event that is in URI syntax
      Specified by:
      getSource in interface DataEvent<T>
      Returns:
      uri source
    • getSpecversion

      public String getSpecversion()
      Description copied from interface: DataEvent
      Returns specification version of the cloud event
      Specified by:
      getSpecversion in interface DataEvent<T>
      Returns:
      specification version
    • getSubject

      public String getSubject()
      Description copied from interface: DataEvent
      Returns subject of the event
      Specified by:
      getSubject in interface DataEvent<T>
      Returns:
      subject
    • getId

      public String getId()
      Description copied from interface: DataEvent
      Returns unique id of the event
      Specified by:
      getId in interface DataEvent<T>
      Returns:
      unique event id
    • getType

      public String getType()
      Description copied from interface: DataEvent
      Returns type of the event this instance represents e.g. ProcessInstanceEvent
      Specified by:
      getType in interface DataEvent<T>
      Returns:
      type of the event
    • getTime

      public String getTime()
      Description copied from interface: DataEvent
      Returns returns time when the event was created
      Specified by:
      getTime in interface DataEvent<T>
      Returns:
      time of the event
    • getData

      public T getData()
      Description copied from interface: DataEvent
      Returns actual body of the event
      Specified by:
      getData in interface DataEvent<T>
      Returns:
    • getExtensions

      public Map<String,Object> getExtensions()
      Description copied from interface: DataEvent
      Returns all extension attributes of the event
      Specified by:
      getExtensions in interface DataEvent<T>
      Returns:
      extension attributes
    • addExtension

      public void addExtension(String name, Object value)
      Description copied from interface: DataEvent
      Stores extension attribute with given name and value
      Specified by:
      addExtension in interface DataEvent<T>
      Parameters:
      name - name of the attribute
      value - value of the attribute
    • getExtension

      public Object getExtension(String name)
      Description copied from interface: DataEvent
      Returns extension attribute with given name
      Specified by:
      getExtension in interface DataEvent<T>
      Parameters:
      name - name of the attribute
      Returns:
      extension attribute value if exists otherwise null