|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.prosysopc.ua.SubscriptionBase
com.prosysopc.ua.server.Subscription
public class Subscription
An OPC UA subscription. Subscriptions are used to report Notifications to the Client.
| Nested Class Summary | |
|---|---|
class |
Subscription.PublishTask
A task for publishing the data change notifications. |
| Field Summary |
|---|
| Fields inherited from class com.prosysopc.ua.SubscriptionBase |
|---|
items, lifetimeCount, maxKeepAliveCount, maxNotificationsPerPublish, priority, publishingEnabled, publishingInterval, updateCount |
| Constructor Summary | |
|---|---|
Subscription(SubscriptionManager subscriptionManager,
org.opcfoundation.ua.builtintypes.UnsignedInteger id,
Boolean publishingEnabled,
Double requestedPublishingInterval,
org.opcfoundation.ua.builtintypes.UnsignedInteger requestedLifetimeCount,
org.opcfoundation.ua.builtintypes.UnsignedInteger requestedMaxKeepAliveCount,
org.opcfoundation.ua.builtintypes.UnsignedInteger maxNotificationsPerPublish,
org.opcfoundation.ua.builtintypes.UnsignedByte priority)
Create a new subscription. |
|
| Method Summary | |
|---|---|
protected void |
acknowledge(org.opcfoundation.ua.builtintypes.UnsignedInteger sequenceNumber)
Acknowledge that a notification was received by the client. |
MonitoredDataItem |
addDataItem(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.utils.NumericRange indexRange,
org.opcfoundation.ua.builtintypes.QualifiedName dataEncoding,
org.opcfoundation.ua.core.MonitoringMode monitoringMode)
Add a new monitoring item to the subscription. |
MonitoredDataItem |
addDataItem(ServiceContext serviceContext,
UaNode node,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.utils.NumericRange indexRange,
org.opcfoundation.ua.builtintypes.QualifiedName dataEncoding,
org.opcfoundation.ua.core.MonitoringMode monitoringMode)
Add a new monitoring item to the subscription. |
MonitoredEventItem |
addEventItem(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.core.EventFilter eventFilter,
org.opcfoundation.ua.core.EventFilterResult filterResult)
Add a new item to event monitoring. |
protected void |
addToPublishQueue(long time,
boolean needsKeepAlive)
|
void |
close()
Close the subscription. |
int |
compareTo(SubscriptionBase s)
|
protected void |
enabledChanged()
Handles a change in PublishingEnabled |
boolean |
equals(Object obj)
|
org.opcfoundation.ua.builtintypes.UnsignedInteger[] |
getAvailableSequenceNumbers()
|
SubscriptionDiagnostics |
getDiagnostics()
|
MonitoredItem |
getItem(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
Find the item that is listening to the specified node attribute. |
int |
getMaxNotificationsPerPublish()
The maximum number of notifications that the Client wishes to receive in a single Publish response. |
protected org.opcfoundation.ua.core.NotificationMessage |
getNextNotificationMessage(Session session)
|
protected org.opcfoundation.ua.builtintypes.UnsignedInteger |
getNextSequenceNumber(boolean isKeepAliveMessage)
|
protected org.opcfoundation.ua.core.NotificationMessage |
getNotificationMessage(org.opcfoundation.ua.builtintypes.UnsignedInteger retransmitSequenceNumber)
|
protected BlockingQueue<SubscriptionBase> |
getPublishQueue()
|
Session |
getSession()
|
SubscriptionManager |
getSubscriptionManager()
|
boolean |
hasExpired()
|
int |
hashCode()
|
Boolean |
hasMoreNotifications()
|
protected void |
internalClose(boolean removeFromQueue)
Close the subscription. |
protected void |
internalRemoveItem(MonitoredItem item)
The actual method that will remove the item from the Subscription. |
boolean |
isClosed()
|
protected boolean |
isTimeToPublish(long now)
|
protected void |
monitoringModeChanged(MonitoredItem monitoredItem)
|
protected void |
needTrigger(MonitoredItem triggeringItem,
boolean isDataChange,
boolean isEventChange)
|
protected void |
newEventAvailable(MonitoredEventItem monitoredEventItem)
|
protected void |
newSampleAvailable(MonitoredItem monitoredItem)
|
protected void |
paramChanged()
Parameter change "event". |
MonitoredItemBase |
removeItem(MonitoredItemBase item)
Remove an item from the subscription. |
MonitoredItemBase |
removeItem(org.opcfoundation.ua.builtintypes.UnsignedInteger itemId)
Remove an item from the subscription. |
protected void |
resetKeepAliveCounter()
|
protected void |
resetLastAliveTime()
|
protected void |
setPublishQueue(BlockingQueue<SubscriptionBase> queue)
|
protected static void |
setPublishTimeCheckAllowedThresholdMS(int value)
Set allowed threshold for publish checks. |
protected void |
setSession(Session session)
|
void |
start()
Close the subscription. |
protected void |
startPublishing()
Starts the publish timer. |
protected void |
stopPublishing()
Stops the publish timer. |
protected void |
updateDiagnostics()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Subscription(SubscriptionManager subscriptionManager,
org.opcfoundation.ua.builtintypes.UnsignedInteger id,
Boolean publishingEnabled,
Double requestedPublishingInterval,
org.opcfoundation.ua.builtintypes.UnsignedInteger requestedLifetimeCount,
org.opcfoundation.ua.builtintypes.UnsignedInteger requestedMaxKeepAliveCount,
org.opcfoundation.ua.builtintypes.UnsignedInteger maxNotificationsPerPublish,
org.opcfoundation.ua.builtintypes.UnsignedByte priority)
publishingEnabled - requestedPublishingInterval - requestedLifetimeCount - requestedMaxKeepAliveCount - maxNotificationsPerPublish - priority - | Method Detail |
|---|
protected static void setPublishTimeCheckAllowedThresholdMS(int value)
value -
public MonitoredDataItem addDataItem(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.utils.NumericRange indexRange,
org.opcfoundation.ua.builtintypes.QualifiedName dataEncoding,
org.opcfoundation.ua.core.MonitoringMode monitoringMode)
nodeId - dataEncoding - indexRange - attributeId - monitoringMode - serviceContext -
public MonitoredDataItem addDataItem(ServiceContext serviceContext,
UaNode node,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.utils.NumericRange indexRange,
org.opcfoundation.ua.builtintypes.QualifiedName dataEncoding,
org.opcfoundation.ua.core.MonitoringMode monitoringMode)
node - dataEncoding - indexRange - attributeId - monitoringMode -
public MonitoredEventItem addEventItem(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.core.EventFilter eventFilter,
org.opcfoundation.ua.core.EventFilterResult filterResult)
throws StatusException
nodeId - the node to monitordataEncoding - eventFilter - the event filter definition.filterResult -
StatusException
public void close()
throws ServiceException
ServiceException - if the SubscriptionManager throws the exceptionpublic int compareTo(SubscriptionBase s)
compareTo in interface Comparable<SubscriptionBase>compareTo in class SubscriptionBasepublic boolean equals(Object obj)
equals in class Objectpublic org.opcfoundation.ua.builtintypes.UnsignedInteger[] getAvailableSequenceNumbers()
public SubscriptionDiagnostics getDiagnostics()
public MonitoredItem getItem(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
SubscriptionBase
getItem in class SubscriptionBasenodeId - the listened nodeattributeId - the attribute
public int getMaxNotificationsPerPublish()
SubscriptionBase
getMaxNotificationsPerPublish in class SubscriptionBaseSubscriptionBase.setMaxNotificationsPerPublish(long)public Session getSession()
public SubscriptionManager getSubscriptionManager()
public boolean hasExpired()
public int hashCode()
hashCode in class Objectpublic Boolean hasMoreNotifications()
public boolean isClosed()
public MonitoredItemBase removeItem(MonitoredItemBase item)
throws ServiceException,
StatusException
SubscriptionBase
removeItem in class SubscriptionBaseitem - The item to remove.
ServiceException - if the (possible) service call to delete the item from the server
fails.
StatusException - if the subscription does not contain the item
public MonitoredItemBase removeItem(org.opcfoundation.ua.builtintypes.UnsignedInteger itemId)
throws ServiceException,
StatusException
SubscriptionBase
removeItem in class SubscriptionBaseitemId - The ID of the item to remove. In the client side this should be the ClientHandle,
but on server side, the MonitoredItemId is used.
ServiceException - if the service call to delete the item from the server fails.
StatusException - if the delete response from the server is badpublic void start()
protected void acknowledge(org.opcfoundation.ua.builtintypes.UnsignedInteger sequenceNumber)
throws ServiceException
sequenceNumber - the message to acknowledge
ServiceException - Bad_SequenceNumberUnknown if the seuqnceNumber is not recognized
protected void addToPublishQueue(long time,
boolean needsKeepAlive)
time -
protected void enabledChanged()
throws ServiceException
enabledChanged in class SubscriptionBaseServiceExceptionprotected org.opcfoundation.ua.core.NotificationMessage getNextNotificationMessage(Session session)
ServiceExceptionprotected org.opcfoundation.ua.builtintypes.UnsignedInteger getNextSequenceNumber(boolean isKeepAliveMessage)
protected org.opcfoundation.ua.core.NotificationMessage getNotificationMessage(org.opcfoundation.ua.builtintypes.UnsignedInteger retransmitSequenceNumber)
throws ServiceException
retransmitSequenceNumber -
StatusException
ServiceExceptionprotected BlockingQueue<SubscriptionBase> getPublishQueue()
protected void internalClose(boolean removeFromQueue)
protected void internalRemoveItem(MonitoredItem item)
throws ServiceException,
StatusException
item -
StatusException
ServiceExceptionprotected boolean isTimeToPublish(long now)
protected void monitoringModeChanged(MonitoredItem monitoredItem)
protected void needTrigger(MonitoredItem triggeringItem,
boolean isDataChange,
boolean isEventChange)
protected void newEventAvailable(MonitoredEventItem monitoredEventItem)
monitoredEventItem - protected void newSampleAvailable(MonitoredItem monitoredItem)
monitoredItem - value -
protected void paramChanged()
throws ServiceException
paramChanged in class SubscriptionBaseServiceExceptionprotected void resetKeepAliveCounter()
protected void resetLastAliveTime()
protected void setPublishQueue(BlockingQueue<SubscriptionBase> queue)
queue - the publishQueue to setprotected void setSession(Session session)
session - protected void startPublishing()
protected void stopPublishing()
protected void updateDiagnostics()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||