|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.prosysopc.ua.client.SubscriptionNotificationAdapter
public class SubscriptionNotificationAdapter
A default, empty implementation of the SubscriptionNotificationListener. You can use the adapter to enable more flexible implementation of the interface in your applications. Instead of implementing all methods of the interface, you can just override the methods that you wish to react to.
SubscriptionNotificationAdapter,
SubscriptionAliveListener| Constructor Summary | |
|---|---|
SubscriptionNotificationAdapter()
|
|
| 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SubscriptionNotificationAdapter()
| Method Detail |
|---|
public void onBufferOverflow(Subscription subscription,
org.opcfoundation.ua.builtintypes.UnsignedInteger sequenceNumber,
org.opcfoundation.ua.builtintypes.ExtensionObject[] notificationData)
SubscriptionNotificationListenerSubscription.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.
onBufferOverflow in interface SubscriptionNotificationListenersubscription - 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.
public void onDataChange(Subscription subscription,
MonitoredDataItem item,
org.opcfoundation.ua.builtintypes.DataValue newValue)
SubscriptionNotificationListener
onDataChange in interface SubscriptionNotificationListenersubscription - the subscription that is sending the notificationitem - the MonitoredItem that changednewValue - the new value for the item
public void onError(Subscription subscription,
Object notification,
Exception exception)
SubscriptionNotificationListener
onError in interface SubscriptionNotificationListenersubscription - 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
public void onEvent(Subscription subscription,
MonitoredEventItem item,
org.opcfoundation.ua.builtintypes.Variant[] eventFields)
SubscriptionNotificationListener
onEvent in interface SubscriptionNotificationListenersubscription - 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.
public long onMissingData(org.opcfoundation.ua.builtintypes.UnsignedInteger lastSequenceNumber,
long sequenceNumber,
long newSequenceNumber,
org.opcfoundation.ua.builtintypes.StatusCode serviceResult)
SubscriptionNotificationListener
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.
onMissingData in interface SubscriptionNotificationListenerlastSequenceNumber - 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.
public void onNotificationData(Subscription subscription,
org.opcfoundation.ua.core.NotificationData notification)
SubscriptionNotificationListener
onNotificationData in interface SubscriptionNotificationListenersubscription - the subscription that is sending the notificationnotification - the notification "packet"
public void onStatusChange(Subscription subscription,
org.opcfoundation.ua.builtintypes.StatusCode oldStatus,
org.opcfoundation.ua.builtintypes.StatusCode newStatus,
org.opcfoundation.ua.builtintypes.DiagnosticInfo diagnosticInfo)
SubscriptionNotificationListener
onStatusChange in interface SubscriptionNotificationListenersubscription - 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 | |||||||||