|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.prosysopc.ua.server.SubscriptionManager
public class SubscriptionManager
A standard implementation of the subscription manager of an OPC UA client.
The subscription manager requires a NodeManager which it uses to locate the nodes.
| Field Summary | |
|---|---|
protected List<SubscriptionManagerListener> |
listeners
|
protected NodeManagerTable |
nodeManagerTable
|
protected SessionManager |
sessionManager
|
| Constructor Summary | |
|---|---|
SubscriptionManager(SessionManager sessionManager,
NodeManagerTable nodeManagerTable)
|
|
| Method Summary | |
|---|---|
protected void |
acknowledge(ServiceContext serviceContext,
org.opcfoundation.ua.core.PublishRequest request,
org.opcfoundation.ua.core.PublishResponse response)
|
protected void |
acknowledgeSubscriptions(ServiceContext serviceContext,
org.opcfoundation.ua.core.SubscriptionAcknowledgement[] acks,
org.opcfoundation.ua.builtintypes.StatusCode[] results,
org.opcfoundation.ua.builtintypes.DiagnosticInfo[] diagnostics)
|
void |
addListener(SubscriptionManagerListener listener)
Add a new SubscriptionManagerListener. |
protected SubscriptionBase |
addSubscription(ServiceContext serviceContext,
org.opcfoundation.ua.core.CreateSubscriptionRequest request)
Add a new subscription. |
protected void |
addTriggeringLink(Subscription s,
MonitoredItemBase triggeringItem,
org.opcfoundation.ua.builtintypes.UnsignedInteger linkToAdd)
|
protected org.opcfoundation.ua.utils.NumericRange |
checkIndexRangeForMonitoredItem(String indexRange,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
|
protected void |
checkSession(ServiceContext serviceContext,
Subscription subscription)
|
protected void |
close()
|
protected MonitoredDataItem |
createMonitoredDataItem(ServiceContext serviceContext,
Subscription subscription,
org.opcfoundation.ua.core.MonitoredItemCreateRequest itemToCreate,
org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn,
org.opcfoundation.ua.core.MonitoringFilter filter)
|
protected MonitoredItem |
createMonitoredEventItem(ServiceContext serviceContext,
Subscription subscription,
org.opcfoundation.ua.core.MonitoredItemCreateRequest itemToCreate,
org.opcfoundation.ua.core.EventFilter eventFilter)
|
protected MonitoredItem |
createMonitoredItem(ServiceContext serviceContext,
Subscription subscription,
org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn,
org.opcfoundation.ua.core.MonitoredItemCreateRequest itemToCreate)
|
protected MonitoredItemBase |
deleteMonitoredItem(ServiceContext serviceContext,
Subscription subscription,
org.opcfoundation.ua.builtintypes.UnsignedInteger itemId)
|
protected void |
finalize()
|
int |
getMaxNotificationsPerPublish()
The limit for the maximum number of notifications parameter which is defined per subscription. |
double |
getMaxPublishingInterval()
|
int |
getMaxPublishRequestCount()
|
int |
getMaxRetransmissionQueueSize()
The maximum number of notification messages to keep in the retransmit queue, which is used to enable Republish calls from the client. |
double |
getMaxSamplingInterval()
|
int |
getMaxSubscriptionCount()
Maximum number of concurrent subscriptions per session. |
double |
getMinPublishingInterval()
|
double |
getMinSamplingInterval()
|
protected Subscription |
getNextSubscriptionToPublish(ServiceContext serviceContext,
long timeoutHint)
Find the next subscription from the publish queue |
NodeManagerTable |
getNodeManagerTable()
|
protected BlockingQueue<SubscriptionBase> |
getPublishQueue(Session session)
|
SessionManager |
getSessionManager()
|
Subscription |
getSubscription(org.opcfoundation.ua.builtintypes.UnsignedInteger subscriptionId)
Find the subscription by a subscriptionId |
int |
getSubscriptionCount()
Number of managed subscriptions. |
boolean |
hasListener(SubscriptionManagerListener listener)
Check if the manager already has the specified listener. |
boolean |
isRunning()
|
protected MonitoredItem |
modifyMonitoredItem(ServiceContext serviceContext,
Subscription subscription,
org.opcfoundation.ua.core.MonitoredItemModifyRequest request,
org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn,
org.opcfoundation.ua.core.MonitoringParameters params)
|
protected SubscriptionBase |
modifySubscription(ServiceContext serviceContext,
org.opcfoundation.ua.core.ModifySubscriptionRequest request)
|
protected org.opcfoundation.ua.builtintypes.UnsignedInteger |
nextSubscriptionId()
Find the next Subscription ID. |
protected void |
publish(ServiceContext serviceContext,
org.opcfoundation.ua.core.PublishRequest request,
org.opcfoundation.ua.core.PublishResponse response)
|
void |
removeListener(SubscriptionManagerListener listener)
Remove a SubscriptionManagerListener. |
protected void |
removeSubscription(ServiceContext serviceContext,
Subscription subscription,
boolean removeFromQueue)
|
protected void |
removeTriggeringLink(SubscriptionBase s,
MonitoredItemBase triggeringItem,
org.opcfoundation.ua.builtintypes.UnsignedInteger linkToRemove)
|
protected void |
republish(ServiceContext serviceContext,
org.opcfoundation.ua.core.RepublishRequest request,
org.opcfoundation.ua.core.RepublishResponse response)
|
void |
setMaxNotificationsPerPublish(int maxNotificationsPerPublish)
Define the limit for MaxNotificationsPerPublish that the clients may define for each subscription. |
void |
setMaxPublishingInterval(double maxPublishingInterval)
Define the maximum value for PublishingInterval of any subscription. |
void |
setMaxPublishRequestCount(int maxPublishRequestCount)
Define the maximum number of PublishRequests to accept from the client at a time. |
void |
setMaxRetransmissionQueueSize(int maxRetransmissionQueueSize)
Define the maximum number of notification messages to keep in the retransmit queue, which is used to enable Republish calls from the client. |
void |
setMaxSamplingInterval(double maxSamplingInterval)
Define the maximum value for SamplingInterval of any MonitoredItem. |
void |
setMaxSubscriptionCount(int maxSubscriptionCount)
Define the maximum number of Subscriptions to enable per session. |
void |
setMinPublishingInterval(double minPublishingInterval)
Define the minimum value for PublishingInterval of any subscription. |
void |
setMinSamplingInterval(double minSamplingInterval)
Define the minimum value for SamplingInterval of any MonitoredItem. |
protected void |
setMonitoringMode(ServiceContext serviceContext,
Subscription subscription,
org.opcfoundation.ua.builtintypes.UnsignedInteger monitoredItemId,
org.opcfoundation.ua.core.MonitoringMode mode)
|
protected void |
setPublishingMode(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.UnsignedInteger subscriptionId,
Boolean publishingEnabled)
|
protected void |
setTriggering(ServiceContext serviceContext,
org.opcfoundation.ua.core.SetTriggeringRequest request,
org.opcfoundation.ua.core.SetTriggeringResponse response)
|
protected void |
start()
Starts the manager. |
protected Subscription |
transferSubscription(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.UnsignedInteger subscriptionId)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final List<SubscriptionManagerListener> listeners
protected final NodeManagerTable nodeManagerTable
protected final SessionManager sessionManager
| Constructor Detail |
|---|
public SubscriptionManager(SessionManager sessionManager,
NodeManagerTable nodeManagerTable)
sessionManager - nodeManagerTable - | Method Detail |
|---|
public void addListener(SubscriptionManagerListener listener)
listener - the listener to add. Must not be nullpublic int getMaxNotificationsPerPublish()
If this value is defined, the client requested values are modified down to this value, if they would exceed it.
Default: 50000
setMaxNotificationsPerPublish(int)public double getMaxPublishingInterval()
setMaxPublishingInterval(double)public int getMaxPublishRequestCount()
public int getMaxRetransmissionQueueSize()
public double getMaxSamplingInterval()
setMaxSamplingInterval(double)public int getMaxSubscriptionCount()
public double getMinPublishingInterval()
setMinPublishingInterval(double)public double getMinSamplingInterval()
setMinSamplingInterval(double)public NodeManagerTable getNodeManagerTable()
public SessionManager getSessionManager()
public Subscription getSubscription(org.opcfoundation.ua.builtintypes.UnsignedInteger subscriptionId)
throws ServiceException
subscriptionId - the ID
StatusException - if no subscription is found
ServiceExceptionpublic int getSubscriptionCount()
public boolean hasListener(SubscriptionManagerListener listener)
listener - the listener to checklistener -
public boolean isRunning()
public void removeListener(SubscriptionManagerListener listener)
listener - public void setMaxNotificationsPerPublish(int maxNotificationsPerPublish)
Default: 50000
maxNotificationsPerPublish - getMaxNotificationsPerPublish()public void setMaxPublishingInterval(double maxPublishingInterval)
Default: 3600000
maxPublishingInterval - the maxPublishingInterval to set (in milliseconds)public void setMaxPublishRequestCount(int maxPublishRequestCount)
The value defines the maximum per client session.
maxPublishRequestCount - the new limit. Default is 100. Use 0 to set the default value.public void setMaxRetransmissionQueueSize(int maxRetransmissionQueueSize)
maxRetransmissionQueueSize - the new size (default is 10)public void setMaxSamplingInterval(double maxSamplingInterval)
Default: 3600000
maxSamplingInterval - the maxSamplingInterval to set (in milliseconds)public void setMaxSubscriptionCount(int maxSubscriptionCount)
maxSubscriptionCount - the maxSubscriptionCount to set. Default is INTEGER.MAX_VALUEpublic void setMinPublishingInterval(double minPublishingInterval)
Default: 100
minPublishingInterval - the minPublishingInterval to set (in milliseconds). The value must
be greater than 0.public void setMinSamplingInterval(double minSamplingInterval)
Default: 1
minSamplingInterval - the minSamplingInterval to set. (in milliseconds)
protected void acknowledge(ServiceContext serviceContext,
org.opcfoundation.ua.core.PublishRequest request,
org.opcfoundation.ua.core.PublishResponse response)
protected void acknowledgeSubscriptions(ServiceContext serviceContext,
org.opcfoundation.ua.core.SubscriptionAcknowledgement[] acks,
org.opcfoundation.ua.builtintypes.StatusCode[] results,
org.opcfoundation.ua.builtintypes.DiagnosticInfo[] diagnostics)
protected SubscriptionBase addSubscription(ServiceContext serviceContext,
org.opcfoundation.ua.core.CreateSubscriptionRequest request)
throws ServiceException
serviceContext - request -
ServiceException
protected void addTriggeringLink(Subscription s,
MonitoredItemBase triggeringItem,
org.opcfoundation.ua.builtintypes.UnsignedInteger linkToAdd)
throws StatusException
s - triggeringItem - unsignedInteger -
StatusException
protected org.opcfoundation.ua.utils.NumericRange checkIndexRangeForMonitoredItem(String indexRange,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
throws ServiceException
indexRange - attributeId -
org.opcfoundation.ua.common.ServiceResultException
ServiceException
protected void checkSession(ServiceContext serviceContext,
Subscription subscription)
throws ServiceException
serviceContext - subscription -
ServiceExceptionprotected void close()
protected MonitoredDataItem createMonitoredDataItem(ServiceContext serviceContext,
Subscription subscription,
org.opcfoundation.ua.core.MonitoredItemCreateRequest itemToCreate,
org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn,
org.opcfoundation.ua.core.MonitoringFilter filter)
throws ServiceException,
StatusException
serviceContext - subscription - itemToCreate - timestampsToReturn - filter -
StatusException
ServiceException
protected MonitoredItem createMonitoredEventItem(ServiceContext serviceContext,
Subscription subscription,
org.opcfoundation.ua.core.MonitoredItemCreateRequest itemToCreate,
org.opcfoundation.ua.core.EventFilter eventFilter)
throws StatusException
serviceContext - subscription - itemToCreate - eventFilter -
StatusException
protected MonitoredItem createMonitoredItem(ServiceContext serviceContext,
Subscription subscription,
org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn,
org.opcfoundation.ua.core.MonitoredItemCreateRequest itemToCreate)
throws StatusException,
ServiceException
serviceContext - subscription - timestampsToReturn - itemToCreate -
StatusException
ServiceException
protected MonitoredItemBase deleteMonitoredItem(ServiceContext serviceContext,
Subscription subscription,
org.opcfoundation.ua.builtintypes.UnsignedInteger itemId)
throws StatusException
serviceContext - subscription - itemId -
StatusException
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
protected Subscription getNextSubscriptionToPublish(ServiceContext serviceContext,
long timeoutHint)
throws ServiceException
serviceContext - timeoutHint -
ServiceExceptionprotected BlockingQueue<SubscriptionBase> getPublishQueue(Session session)
session -
protected MonitoredItem modifyMonitoredItem(ServiceContext serviceContext,
Subscription subscription,
org.opcfoundation.ua.core.MonitoredItemModifyRequest request,
org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn,
org.opcfoundation.ua.core.MonitoringParameters params)
throws StatusException
serviceContext - subscription - request - timestampsToReturn - params -
StatusException
protected SubscriptionBase modifySubscription(ServiceContext serviceContext,
org.opcfoundation.ua.core.ModifySubscriptionRequest request)
throws ServiceException
serviceContext - request -
ServiceException
StatusExceptionprotected org.opcfoundation.ua.builtintypes.UnsignedInteger nextSubscriptionId()
protected void publish(ServiceContext serviceContext,
org.opcfoundation.ua.core.PublishRequest request,
org.opcfoundation.ua.core.PublishResponse response)
throws ServiceException
ServiceException
protected void removeSubscription(ServiceContext serviceContext,
Subscription subscription,
boolean removeFromQueue)
throws ServiceException
serviceContext - subscription -
ServiceException
protected void removeTriggeringLink(SubscriptionBase s,
MonitoredItemBase triggeringItem,
org.opcfoundation.ua.builtintypes.UnsignedInteger linkToRemove)
throws StatusException
s - triggeringItem - unsignedInteger -
StatusException
protected void republish(ServiceContext serviceContext,
org.opcfoundation.ua.core.RepublishRequest request,
org.opcfoundation.ua.core.RepublishResponse response)
throws ServiceException
ServiceException
protected void setMonitoringMode(ServiceContext serviceContext,
Subscription subscription,
org.opcfoundation.ua.builtintypes.UnsignedInteger monitoredItemId,
org.opcfoundation.ua.core.MonitoringMode mode)
throws ServiceException,
StatusException
serviceContext - subscription - monitoredItemId -
StatusException
ServiceException
protected void setPublishingMode(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.UnsignedInteger subscriptionId,
Boolean publishingEnabled)
throws ServiceException,
StatusException
serviceContext - subscriptionId - publishingEnabled -
ServiceException
StatusException
protected void setTriggering(ServiceContext serviceContext,
org.opcfoundation.ua.core.SetTriggeringRequest request,
org.opcfoundation.ua.core.SetTriggeringResponse response)
throws ServiceException
ServiceExceptionprotected void start()
protected Subscription transferSubscription(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.UnsignedInteger subscriptionId)
throws ServiceException
serviceContext - subscriptionId -
ServiceException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||