com.prosysopc.ua.client
Class MonitoredItem

java.lang.Object
  extended by com.prosysopc.ua.MonitoredItemBase
      extended by com.prosysopc.ua.client.MonitoredItem
Direct Known Subclasses:
MonitoredDataItem, MonitoredEventItem

public abstract class MonitoredItem
extends MonitoredItemBase

Clients define MonitoredItems to subscribe to data and Events. Each MonitoredItem identifies the item to be monitored and the Subscription to use to send Notifications. The item to be monitored may be any Node Attribute.

Notifications are data structures that describe the occurrence of data changes and Events. They are packaged into NotificationMessages for transfer to the Client. The Subscription periodically sends NotificationMessages at a user-specified publishing interval, and the cycle during which these messages are sent is called a publishing cycle.

Four primary parameters are defined for MonitoredItems that tell the Server how the item is to be sampled, evaluated and reported. These parameters are the sampling interval, the monitoring mode, the filter and the queue parameter.


Field Summary
protected static org.slf4j.Logger logger
           
 
Fields inherited from class com.prosysopc.ua.MonitoredItemBase
attributeId, clientHandle, dataEncoding, discardOldest, maxQueueSize, monitoredItemId, monitoringMode, nodeId, queueSize
 
Constructor Summary
protected MonitoredItem(org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId, org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, org.opcfoundation.ua.core.MonitoringMode monitoringMode)
          Create a new monitored item in a subscription.
protected MonitoredItem(org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, org.opcfoundation.ua.core.MonitoringMode monitoringMode)
          Create a new monitored item in a subscription.
 
Method Summary
protected  void clearModified()
           
protected  void clearMonitoringModeModified()
           
 boolean equals(Object obj)
           
 org.opcfoundation.ua.builtintypes.StatusCode getErrorCode()
          Item error status.
 org.opcfoundation.ua.builtintypes.ExpandedNodeId getExpandedNodeId()
           
 org.opcfoundation.ua.builtintypes.NodeId getNodeId()
           
 Subscription getSubscription()
           
 int hashCode()
           
 boolean isModified()
           
 boolean isMonitoringModeModified()
           
protected  void itemChanged()
           
protected  void monitoringModeChanged()
           
protected  void setClientHandle(int i)
           
protected  void setErrorCode(org.opcfoundation.ua.builtintypes.StatusCode statusCode)
           
protected  void setFilterResult(org.opcfoundation.ua.core.MonitoringFilterResult filterResult)
           
protected  void setMonitoredItemId(org.opcfoundation.ua.builtintypes.UnsignedInteger monitoredItemId)
           
protected  void setRevisedQueueSize(org.opcfoundation.ua.builtintypes.UnsignedInteger revisedQueueSize)
           
protected  void updateFilter()
          React to changes in the filter.
protected  void updateQueue()
          Update the queue, when it's size has changed.
 
Methods inherited from class com.prosysopc.ua.MonitoredItemBase
close, getAttributeId, getClientHandle, getDataEncoding, getDefaultQueueSize, getFilter, getFilterResult, getIndexRange, getMonitoredItemId, getMonitoringMode, getQueueSize, getSamplingInterval, isDiscardOldest, setDiscardOldest, setFilter, setMonitoringMode, setQueueSize, setQueueSize, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected static org.slf4j.Logger logger
Constructor Detail

MonitoredItem

protected MonitoredItem(org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId,
                        org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                        org.opcfoundation.ua.core.MonitoringMode monitoringMode)
Create a new monitored item in a subscription. The item is automatically assigned the next available ClientHandle.

Parameters:
nodeId - the NodeId of the node to monitor
attributeId - the attribute to monitor
monitoringMode - the initial monitoring mode for the item. Specifies whether sampling and reporting are enabled or disabled for a MonitoredItem.

MonitoredItem

protected MonitoredItem(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                        org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                        org.opcfoundation.ua.core.MonitoringMode monitoringMode)
Create a new monitored item in a subscription. The item is automatically assigned the next available ClientHandle.

Parameters:
nodeId - the NodeId of the node to monitor
attributeId - the attribute to monitor
monitoringMode - the initial monitoring mode for the item. Specifies whether sampling and reporting are enabled or disabled for a MonitoredItem.
Method Detail

equals

public boolean equals(Object obj)
Overrides:
equals in class MonitoredItemBase

getErrorCode

public org.opcfoundation.ua.builtintypes.StatusCode getErrorCode()
Item error status. If the item creation succeeds without a problem, the code should be StatusCode.GOOD.

Returns:
the status of the item after it is created. Null if not created or the create call failed.

getExpandedNodeId

public org.opcfoundation.ua.builtintypes.ExpandedNodeId getExpandedNodeId()
Returns:
the expandedNodeId

getNodeId

public org.opcfoundation.ua.builtintypes.NodeId getNodeId()
Overrides:
getNodeId in class MonitoredItemBase
Returns:
the node to monitor

getSubscription

public Subscription getSubscription()

hashCode

public int hashCode()
Overrides:
hashCode in class MonitoredItemBase

isModified

public boolean isModified()
Returns:
the modified state, which is true when there are modifications in the item that need to be applied to the server side item.

isMonitoringModeModified

public boolean isMonitoringModeModified()
Returns:
the monitoringModeModified

clearModified

protected void clearModified()

clearMonitoringModeModified

protected void clearMonitoringModeModified()

itemChanged

protected void itemChanged()
                    throws ServiceException
Throws:
ServiceException

monitoringModeChanged

protected void monitoringModeChanged()
                              throws ServiceException
Overrides:
monitoringModeChanged in class MonitoredItemBase
Throws:
ServiceException

setClientHandle

protected void setClientHandle(int i)
Parameters:
i -

setErrorCode

protected void setErrorCode(org.opcfoundation.ua.builtintypes.StatusCode statusCode)
Parameters:
statusCode -

setFilterResult

protected void setFilterResult(org.opcfoundation.ua.core.MonitoringFilterResult filterResult)
Overrides:
setFilterResult in class MonitoredItemBase
Parameters:
filterResult -

setMonitoredItemId

protected void setMonitoredItemId(org.opcfoundation.ua.builtintypes.UnsignedInteger monitoredItemId)
Overrides:
setMonitoredItemId in class MonitoredItemBase

setRevisedQueueSize

protected void setRevisedQueueSize(org.opcfoundation.ua.builtintypes.UnsignedInteger revisedQueueSize)
Parameters:
revisedQueueSize -

updateFilter

protected void updateFilter()
                     throws ServiceException
Description copied from class: MonitoredItemBase
React to changes in the filter.

Overrides:
updateFilter in class MonitoredItemBase
Throws:
ServiceException

updateQueue

protected void updateQueue()
                    throws ServiceException
Description copied from class: MonitoredItemBase
Update the queue, when it's size has changed.

Overrides:
updateQueue in class MonitoredItemBase
Throws:
ServiceException


Copyright © 2018. All rights reserved.