Class DataEvent


public class DataEvent extends DataStreamEvent

Type of event generated when new data is available from a data producer. It is immutable and carries data by reference.

Since:
Feb 20, 2015
  • Field Details

    • foiUID

      protected String foiUID
    • resultTime

      protected Instant resultTime
    • records

      protected DataBlock[] records
  • Constructor Details

    • DataEvent

      public DataEvent(long timeStamp, String sysUID, String outputName, DataBlock... records)
      Constructs a data event associated to a specific system and channel
      Parameters:
      timeStamp - Time of event generation (unix time in milliseconds, base 1970)
      sysUID - Unique ID of system that produced the data records
      outputName - Name of the output interface that generated the data
      records - Array of data records that triggered this event
    • DataEvent

      public DataEvent(long timeStamp, IStreamingDataInterface dataInterface, DataBlock... records)
      Helper constructor to construct a data event associated to the system that is the parent of the given data interface
      Parameters:
      timeStamp - Time of event generation (unix time in milliseconds, base 1970)
      dataInterface - Stream interface that generated the associated data
      records - Array of records that triggered this event
    • DataEvent

      public DataEvent(long timeStamp, IStreamingDataInterface dataInterface, String foiUID, DataBlock... records)
      Helper constructor to construct a data event associated to the system that is the parent of the given data interface
      Parameters:
      timeStamp - Time of event generation (unix time in milliseconds, base 1970)
      dataInterface - Stream interface that generated the associated data
      foiUID - Unique ID of feature of interest that this data applies to
      records - Array of records that triggered this event
    • DataEvent

      public DataEvent(long timeStamp, String sysUID, String outputName, String foiUID, DataBlock... records)
      Constructs a data event associated to a specific system, channel and FOI
      Parameters:
      timeStamp - Time of event generation (unix time in milliseconds, base 1970)
      sysUID - Unique ID of system that produced the data records
      outputName - Name of the output interface that generated the data
      foiUID - Unique ID of feature of interest that this data applies to
      records - Array of data records that triggered this event
    • DataEvent

      public DataEvent(long timeStamp, String sysUID, String outputName, Instant resultTime, DataBlock... records)
      Constructs a data event associated to a specific system and channel, and tagged by a specific result time.
      Parameters:
      timeStamp - Time of event generation (unix time in milliseconds, base 1970)
      sysUID - Unique ID of system that produced the data records
      outputName - Name of the output interface that generated the data
      resultTime - Time at which the data was generated (e.g. model run time)
      records - Array of data records that triggered this event
    • DataEvent

      public DataEvent(long timeStamp, String sysUID, String outputName, Instant resultTime, String foiUID, DataBlock... records)
      Constructs a data event associated to a specific system, channel and FOI, and tagged by a specific result time.
      Parameters:
      timeStamp - Time of event generation (unix time in milliseconds, base 1970)
      sysUID - Unique ID of system that produced the data records
      outputName - Name of the output interface that generated the data
      resultTime - Time at which the data was generated (e.g. model run time)
      foiUID - Unique ID of feature of interest that this data applies to
      records - Array of data records that triggered this event
  • Method Details

    • getSource

      public IStreamingDataInterface getSource()
      Description copied from class: Event
      Gets the source of the event as an object reference.

      Note that this is not guaranteed to be available when using events in a distributed system.

      Overrides:
      getSource in class Event
      Returns:
      Source object that generated this event or null
    • getResultTime

      public Instant getResultTime()
      Returns:
      The time at which the data records were generated by the system
    • getFoiUID

      public String getFoiUID()
      Returns:
      Unique ID of feature of interest that this data applies to
    • getRecords

      public DataBlock[] getRecords()
      Returns:
      List of data records attached to this event.
      Multiple records can be associated to a single event because with high rate or batch producers (e.g. models), it is often not practical or a waste of resources to generate an event for every single record of measurements. Note that all records share the same system, foi and result time.
    • getSourceID

      public String getSourceID()
      Description copied from class: Event
      Gets the ID of the source of event.
      Overrides:
      getSourceID in class DataStreamEvent
      Returns:
      ID of the event source