Package com.hivemq.adapter.sdk.api.data
Interface ProtocolAdapterDataSample
-
public interface ProtocolAdapterDataSampleInterface for data collected by a protocol adapter. One sample can contain multiple data points (= tag values).The actual data points can be added via the
addDataPoint(DataPoint)method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddDataPoint(@NotNull DataPoint dataPoint)Adds a new data point to this sample.voidaddDataPoint(@NotNull String tagName, @NotNull Object tagValue)Adds a new data point to this sample.@NotNull List<DataPoint>getDataPoints()@NotNull PollingContextgetPollingContext()@NotNull LonggetTimestamp()voidsetDataPoints(@NotNull List<DataPoint> list)Sets/Overwrites all data points of the sample with the given argument.
-
-
-
Method Detail
-
getPollingContext
@NotNull @NotNull PollingContext getPollingContext()
- Returns:
- the
PollingContextcontaining information how the data gets published by the broker.
-
getTimestamp
@NotNull @NotNull Long getTimestamp()
- Returns:
- the timestamp when this data sample was taken.
-
addDataPoint
void addDataPoint(@NotNull @NotNull String tagName, @NotNull @NotNull Object tagValue)
Adds a new data point to this sample.- Parameters:
tagName- the name for this data point.tagValue- the value for this data point.
-
addDataPoint
void addDataPoint(@NotNull @NotNull DataPoint dataPoint)
Adds a new data point to this sample.- Parameters:
dataPoint- the data point.
-
setDataPoints
void setDataPoints(@NotNull @NotNull List<DataPoint> list)
Sets/Overwrites all data points of the sample with the given argument.- Parameters:
list- the new list of data points for this sample.
-
-