Interface PollingProtocolAdapter
-
- All Superinterfaces:
ProtocolAdapter
public interface PollingProtocolAdapter extends ProtocolAdapter
This interface is used for protocol adapters which implement polling algorithms from PLC endpoints. The scheduling is done by the adapter framework in HiveMQ Edge.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetMaxPollingErrorsBeforeRemoval()@NotNull List<? extends PollingContext>getPollingContexts()This method gets invoked by HiveMQ Edge to receive all polling contexts for this adapter.intgetPollingIntervalMillis()voidpoll(@NotNull PollingInput pollingInput, @NotNull PollingOutput pollingOutput)This method gets invoked by the HiveMQ Edge adapter framework to collect data points from the plc.-
Methods inherited from interface com.hivemq.adapter.sdk.api.ProtocolAdapter
destroy, discoverValues, getId, getProtocolAdapterInformation, start, stop
-
-
-
-
Method Detail
-
poll
void poll(@NotNull @NotNull PollingInput pollingInput, @NotNull @NotNull PollingOutput pollingOutput)
This method gets invoked by the HiveMQ Edge adapter framework to collect data points from the plc.- Parameters:
pollingInput- input object containing information what and how to poll the datapollingOutput- output object to add data for this poll and to signalize edge polling is done or failed.
-
getPollingContexts
@NotNull @NotNull List<? extends PollingContext> getPollingContexts()
This method gets invoked by HiveMQ Edge to receive all polling contexts for this adapter. Adapters can return multiple contexts in order to poll from multiple endpoints. For each context the poll method will be indicated separately.- Returns:
- A list of polling contexts for this adapter instance.
-
getPollingIntervalMillis
int getPollingIntervalMillis()
- Returns:
- an integer representing the milliseconds between starts of polls
-
getMaxPollingErrorsBeforeRemoval
int getMaxPollingErrorsBeforeRemoval()
- Returns:
- an integer representing a upper limit of consecutive errors during a poll. If this limit is exceeded, the polling will not be scheduled for this adapter anymore and the adapter gets stopped.
-
-