Package org.sensorhub.api.data
Class DataEvent
java.lang.Object
org.sensorhub.api.event.Event
org.sensorhub.api.system.SystemEvent
org.sensorhub.api.data.DataStreamEvent
org.sensorhub.api.data.DataEvent
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 Summary
FieldsFields inherited from class org.sensorhub.api.data.DataStreamEvent
dataStreamID, outputName
Fields inherited from class org.sensorhub.api.system.SystemEvent
sourceID, systemID, systemUID
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a data event associated to a specific system, channel and FOIDataEvent
(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.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.Constructs a data event associated to a specific system and channelDataEvent
(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 interfaceDataEvent
(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 -
Method Summary
Modifier and TypeMethodDescriptionGets the source of the event as an object reference.Gets the ID of the source of event.Methods inherited from class org.sensorhub.api.data.DataStreamEvent
assignDataStreamID, getDataStreamID, getOutputName
Methods inherited from class org.sensorhub.api.system.SystemEvent
assignSystemID, getSystemID, getSystemUID
Methods inherited from class org.sensorhub.api.event.Event
getTimeStamp, toString
-
Field Details
-
foiUID
-
resultTime
-
records
-
-
Constructor Details
-
DataEvent
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 recordsoutputName
- Name of the output interface that generated the datarecords
- Array of data records that triggered this event
-
DataEvent
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 datarecords
- 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 datafoiUID
- Unique ID of feature of interest that this data applies torecords
- 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 recordsoutputName
- Name of the output interface that generated the datafoiUID
- Unique ID of feature of interest that this data applies torecords
- 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 recordsoutputName
- Name of the output interface that generated the dataresultTime
- 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 recordsoutputName
- Name of the output interface that generated the dataresultTime
- Time at which the data was generated (e.g. model run time)foiUID
- Unique ID of feature of interest that this data applies torecords
- Array of data records that triggered this event
-
-
Method Details
-
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.
-
getResultTime
- Returns:
- The time at which the data records were generated by the system
-
getFoiUID
- Returns:
- Unique ID of feature of interest that this data applies to
-
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
Description copied from class:Event
Gets the ID of the source of event.- Overrides:
getSourceID
in classDataStreamEvent
- Returns:
- ID of the event source
-