Interface OpcUaSubscription.SubscriptionListener
- Enclosing class:
- OpcUaSubscription
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonDataReceived(OpcUaSubscription subscription, List<OpcUaMonitoredItem> items, List<org.eclipse.milo.opcua.stack.core.types.builtin.DataValue> values) Called when a Subscription receives a data change notification from the Server.default voidonEventReceived(OpcUaSubscription subscription, List<OpcUaMonitoredItem> items, List<org.eclipse.milo.opcua.stack.core.types.builtin.Variant[]> fields) Called when a Subscription receives an event notification from the Server.default voidonKeepAliveReceived(OpcUaSubscription subscription) Called when a Subscription receives a keep-alive notification from the Server.default voidonNotificationDataLost(OpcUaSubscription subscription) Called when attempts to recover missed data notifications have failed, i.e. the Republish service was called for one or more missing sequence numbers but the Server was unable to fulfill the requests.default voidonStatusChanged(OpcUaSubscription subscription, org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode status) Called when the status of the Subscription has changed.default voidonTransferFailed(OpcUaSubscription subscription, org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode status) Called when a new Session is established after reconnecting, but transferring this Subscription to the new Session was unsuccessful.default voidonWatchdogTimerElapsed(OpcUaSubscription subscription) The Subscription's watchdog timer has elapsed.
-
Method Details
-
onDataReceived
default void onDataReceived(OpcUaSubscription subscription, List<OpcUaMonitoredItem> items, List<org.eclipse.milo.opcua.stack.core.types.builtin.DataValue> values) Called when a Subscription receives a data change notification from the Server.Take care not to block unnecessarily in this callback because subscription notifications are processed synchronously as a backpressure mechanism. Blocking inside this callback will prevent subsequent notifications from being processed and new PublishRequests from being sent.
- Parameters:
subscription- the Subscription that received the data change notification.items- the List of MonitoredItems targeted by the data change notification.values- the corresponding List of DataValues for the MonitoredItems.
-
onEventReceived
default void onEventReceived(OpcUaSubscription subscription, List<OpcUaMonitoredItem> items, List<org.eclipse.milo.opcua.stack.core.types.builtin.Variant[]> fields) Called when a Subscription receives an event notification from the Server.Take care not to block unnecessarily in this callback because subscription notifications are processed synchronously as a backpressure mechanism. Blocking inside this callback will prevent subsequent notifications from being processed and new PublishRequests from being sent.
- Parameters:
subscription- the Subscription that received the event notification.items- the List of MonitoredItems targeted by the event notification.fields- the corresponding List of EventFields for the MonitoredItems.
-
onKeepAliveReceived
Called when a Subscription receives a keep-alive notification from the Server.- Parameters:
subscription- the Subscription that received the keep-alive notification.
-
onNotificationDataLost
Called when attempts to recover missed data notifications have failed, i.e. the Republish service was called for one or more missing sequence numbers but the Server was unable to fulfill the requests.- Parameters:
subscription- the Subscription that missed data notifications.
-
onWatchdogTimerElapsed
The Subscription's watchdog timer has elapsed.The timer elapses when the configurable multiplier applied to the keep-alive interval has elapsed without receiving a PublishResponse for this Subscription.
This is an indication that the Server may be experiencing problems servicing this Subscription, and the absence of data change notifications no longer implies that values are not changing. Consider deleting and creating a new Subscription.
- Parameters:
subscription- the Subscription whose watchdog timer has elapsed.
-
onStatusChanged
default void onStatusChanged(OpcUaSubscription subscription, org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode status) Called when the status of the Subscription has changed.Expected status updates include:
- Bad_Timeout: the Subscription has timed out and no longer exists on the Server.
- Good_Transferred: the Subscription was transferred to another Session.
- Parameters:
subscription- the Subscription whose status has changed.status- the new status of the Subscription.
-
onTransferFailed
default void onTransferFailed(OpcUaSubscription subscription, org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode status) Called when a new Session is established after reconnecting, but transferring this Subscription to the new Session was unsuccessful.- Parameters:
subscription- the Subscription that failed to transfer to the new Session.status- theStatusCodefor the transfer failure.
-