|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface SubscriptionNotificationListener
Event listener for OPC UA Notification events from a Subscription.
Whenever a new subscription response is received from the server, the notifications in it are
broken down and the data is taken to the monitored items. You can listen to the changes either in
every MonitoredItem ( MonitoredDataItemListener) or in the Subscription. These events are
from the subscription.
onDataChange(com.prosysopc.ua.client.Subscription, com.prosysopc.ua.client.MonitoredDataItem, org.opcfoundation.ua.builtintypes.DataValue) is called for every data change in the message.
onStatusChange is called for the StatusChangeNotification, if it is in the message.
onEvent is called for every event in the message.
onError is called for every error while handling the item data.
onNotification is called once for each notificationData (which can be a DataChange, EventNotification or StatusChangeNotification) after the notification is taken to the items and the other events are called.
| Method Summary | |
|---|---|
void |
onBufferOverflow(Subscription subscription,
org.opcfoundation.ua.builtintypes.UnsignedInteger sequenceNumber,
org.opcfoundation.ua.builtintypes.ExtensionObject[] notificationData)
Notification that the internal buffer for notificationData has overflown. |
void |
onDataChange(Subscription subscription,
MonitoredDataItem item,
org.opcfoundation.ua.builtintypes.DataValue newValue)
Notification of a value change. |
void |
onError(Subscription subscription,
Object notification,
Exception exception)
Notification of an error while handling the subscription notification. |
void |
onEvent(Subscription subscription,
MonitoredEventItem item,
org.opcfoundation.ua.builtintypes.Variant[] eventFields)
Notification of event data. |
long |
onMissingData(org.opcfoundation.ua.builtintypes.UnsignedInteger lastSequenceNumber,
long sequenceNumber,
long newSequenceNumber,
org.opcfoundation.ua.builtintypes.StatusCode serviceResult)
Notification of a missing notificationData packet. |
void |
onNotificationData(Subscription subscription,
org.opcfoundation.ua.core.NotificationData notification)
Notification of a new notificationData. |
void |
onStatusChange(Subscription subscription,
org.opcfoundation.ua.builtintypes.StatusCode oldStatus,
org.opcfoundation.ua.builtintypes.StatusCode newStatus,
org.opcfoundation.ua.builtintypes.DiagnosticInfo diagnosticInfo)
Notification of the subscription status change. |
| Method Detail |
|---|
void onBufferOverflow(Subscription subscription,
org.opcfoundation.ua.builtintypes.UnsignedInteger sequenceNumber,
org.opcfoundation.ua.builtintypes.ExtensionObject[] notificationData)
Subscription.setNotificationBufferSize(int) or modify the
Subscription parameters so that you are not requesting that much data.
Although you get the discarded data in the event, you should not normally try to handle it, since it will not help. But you may record it as a reference.
subscription - the subscription that is sending the notificationsequenceNumber - the oldest sequence number in the buffer - this one is being discarded.notificationData - the data that is being discarded.
void onDataChange(Subscription subscription,
MonitoredDataItem item,
org.opcfoundation.ua.builtintypes.DataValue newValue)
subscription - the subscription that is sending the notificationitem - the MonitoredItem that changednewValue - the new value for the item
void onError(Subscription subscription,
Object notification,
Exception exception)
subscription - the subscription whose notification was handled when the error occurrednotification - the notification, either a MonitoredItemNotification or an EventList or an
ExtensionObject in case it cannot be decodedexception - the error that occurred, usually a StatusException or ClassCastException
void onEvent(Subscription subscription,
MonitoredEventItem item,
org.opcfoundation.ua.builtintypes.Variant[] eventFields)
subscription - the subscription that is sending the notificationitem - the monitored item to which this event applies toeventFields - the values for the event fields that were "ordered" in the item. Refer to
the item for the respective fields.
long onMissingData(org.opcfoundation.ua.builtintypes.UnsignedInteger lastSequenceNumber,
long sequenceNumber,
long newSequenceNumber,
org.opcfoundation.ua.builtintypes.StatusCode serviceResult)
If Subscription.isRetransmissionEnabled() is true, the client will try to get the
missing data automatically from the server using the Republish service. However, if the server
no longer has this packet available, there is a chance that data has been missed. In this case,
this event is called to notify your application.
You should return 0 or (modified) newSequenceNumber if you wish to proceed with Republish. Note that the client use the AvailableSequenceNumbers that it has received from the server in previous PublishResponse messages. As necessary, the client will also skip SequenceNumbers, if the server responds that the numbers are no longer available.
lastSequenceNumber - the sequenceNumber of the previous packet receivedsequenceNumber - the sequenceNumber of the next packet receivednewSequenceNumber - the sequenceNumber that the client will try to fetch next with a
Republish service. If Republish is not used, it is 0.serviceResult - The statusCode of the failed Republish call. If the packet is missing,
serviceResult.getValue() equals to StatusCodes.Bad_MessageNotAvailable. Otherwise it may
be a call failure error. If Republish is not used, the error is null.
void onNotificationData(Subscription subscription,
org.opcfoundation.ua.core.NotificationData notification)
subscription - the subscription that is sending the notificationnotification - the notification "packet"
void onStatusChange(Subscription subscription,
org.opcfoundation.ua.builtintypes.StatusCode oldStatus,
org.opcfoundation.ua.builtintypes.StatusCode newStatus,
org.opcfoundation.ua.builtintypes.DiagnosticInfo diagnosticInfo)
subscription - the subscription that is sending the notificationoldStatus - the previous statusnewStatus - the new statusdiagnosticInfo - optional diagnostic information related to the status change
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||