|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.prosysopc.ua.MonitoredItemBase
com.prosysopc.ua.client.MonitoredItem
com.prosysopc.ua.client.MonitoredDataItem
public class MonitoredDataItem
Monitored Item for data change notifications from the server.
Use the MonitoredDataItem to add new items to Subscription when you wish to monitor
changes in attribute values - typically in Variable Value attribute.
MonitoredEventItem| Field Summary | |
|---|---|
protected MonitoredDataItemListener |
dataChangeListener
|
| Fields inherited from class com.prosysopc.ua.client.MonitoredItem |
|---|
logger |
| Fields inherited from class com.prosysopc.ua.MonitoredItemBase |
|---|
attributeId, clientHandle, dataEncoding, discardOldest, maxQueueSize, monitoredItemId, monitoringMode, nodeId, queueSize |
| Constructor Summary | |
|---|---|
MonitoredDataItem(org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId)
Create a new monitored item for data changes. |
|
MonitoredDataItem(org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
Create a new monitored item for data changes. |
|
MonitoredDataItem(org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.core.MonitoringMode monitoringMode)
Create a new monitored item for data changes with sampling interval as -1 (i.e. uses the subscription rate by default) If the item is an array item, use #setIndexRange(String) to define an optional range to
monitor to. |
|
MonitoredDataItem(org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.core.MonitoringMode monitoringMode,
double samplingInterval)
Create a new monitored item for data changes. |
|
MonitoredDataItem(org.opcfoundation.ua.builtintypes.NodeId nodeId)
Create a new monitored item for data changes. |
|
MonitoredDataItem(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
Create a new monitored item for data changes. |
|
MonitoredDataItem(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.core.MonitoringMode monitoringMode)
Create a new monitored item for data changes with sampling interval as -1 (i.e. uses the subscription rate by default) If the item is an array item, use #setIndexRange(String) to define an optional range to
monitor to. |
|
MonitoredDataItem(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.core.MonitoringMode monitoringMode,
double samplingInterval)
Create a new monitored item for data changes. |
|
| Method Summary | |
|---|---|
void |
addChangeListener(MonitoredDataItemListener listener)
Deprecated. the items no longer support multicasting: use setDataChangeListener(MonitoredDataItemListener) instead. |
protected void |
fireDataChange(org.opcfoundation.ua.builtintypes.DataValue prevValue,
org.opcfoundation.ua.builtintypes.DataValue newValue)
Fire the DataChange notification event. |
org.opcfoundation.ua.core.DataChangeFilter |
getDataChangeFilter()
Current data change filter. |
MonitoredDataItemListener |
getDataChangeListener()
|
MonitoredDataItemListener[] |
getDataChangeListeners()
Deprecated. the items no longer support multicasting: use getDataChangeListener()
instead. |
protected long |
getDefaultQueueSize()
|
org.opcfoundation.ua.utils.NumericRange |
getIndexRange()
Optional subrange of an array to monitor to. |
double |
getSamplingInterval()
The SamplingInterval. |
org.opcfoundation.ua.builtintypes.DataValue |
getValue()
|
boolean |
hasChangeListener(MonitoredDataItemListener listener)
Deprecated. the items no longer support multicasting, so this method is obsolete as well: use #getChangeListener() instead. |
boolean |
removeChangeListener(MonitoredDataItemListener listener)
Deprecated. the items no longer support multicasting: use setDataChangeListener(MonitoredDataItemListener) instead. |
void |
setAggregateFilter(org.opcfoundation.ua.core.AggregateFilter filter)
|
void |
setDataChangeFilter(org.opcfoundation.ua.core.DataChangeFilter filter)
Define the filter for selecting which notification the server should send. |
void |
setDataChangeListener(MonitoredDataItemListener listener)
Define the listener for the DataChange notifications. |
void |
setIndexRange(org.opcfoundation.ua.utils.NumericRange indexRange)
Define the range of array indexes to monitor. |
protected void |
setRevisedSamplingInterval(Double revisedSamplingInterval)
|
void |
setSamplingInterval(double samplingInterval)
The interval that defines the fastest rate at which the MonitoredItem(s) should be accessed and evaluated. |
void |
setSamplingInterval(long samplingInterval,
TimeUnit unit)
The interval that defines the fastest rate at which the MonitoredItem(s) should be accessed and evaluated. |
protected void |
setValue(org.opcfoundation.ua.builtintypes.DataValue value)
|
| Methods inherited from class com.prosysopc.ua.client.MonitoredItem |
|---|
clearModified, clearMonitoringModeModified, equals, getErrorCode, getExpandedNodeId, getNodeId, getSubscription, hashCode, isModified, isMonitoringModeModified, itemChanged, monitoringModeChanged, setClientHandle, setErrorCode, setFilterResult, setMonitoredItemId, setRevisedQueueSize, updateFilter, updateQueue |
| Methods inherited from class com.prosysopc.ua.MonitoredItemBase |
|---|
close, getAttributeId, getClientHandle, getDataEncoding, getFilter, getFilterResult, getMonitoredItemId, getMonitoringMode, getQueueSize, isDiscardOldest, setDiscardOldest, setFilter, setMonitoringMode, setQueueSize, setQueueSize, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected volatile MonitoredDataItemListener dataChangeListener
| Constructor Detail |
|---|
public MonitoredDataItem(org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId)
expandedNodeId - the node to listen to
public MonitoredDataItem(org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
expandedNodeId - the node to listen toattributeId - the attribute to listen to
public MonitoredDataItem(org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.core.MonitoringMode monitoringMode)
If the item is an array item, use #setIndexRange(String) to define an optional range to
monitor to.
expandedNodeId - the node to listen toattributeId - the attribute to listen tomonitoringMode - monitoring mode to use
public MonitoredDataItem(org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.core.MonitoringMode monitoringMode,
double samplingInterval)
If the item is an array item, use #setIndexRange(String) to define an optional range to
monitor to.
expandedNodeId - the node to listen toattributeId - the attribute to listen tomonitoringMode - monitoring mode to usesamplingInterval - the sampling interval for the item in milliseconds.public MonitoredDataItem(org.opcfoundation.ua.builtintypes.NodeId nodeId)
nodeId - the node to listen to
public MonitoredDataItem(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
nodeId - the node to listen toattributeId - the attribute to listen to
public MonitoredDataItem(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.core.MonitoringMode monitoringMode)
If the item is an array item, use #setIndexRange(String) to define an optional range to
monitor to.
nodeId - the node to listen toattributeId - the attribute to listen tomonitoringMode - monitoring mode to use
public MonitoredDataItem(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.core.MonitoringMode monitoringMode,
double samplingInterval)
If the item is an array item, use #setIndexRange(String) to define an optional range to
monitor to.
nodeId - the node to listen toattributeId - the attribute to listen tomonitoringMode - monitoring mode to usesamplingInterval - the sampling interval for the item in milliseconds.| Method Detail |
|---|
@Deprecated public void addChangeListener(MonitoredDataItemListener listener)
setDataChangeListener(MonitoredDataItemListener) instead.
listener - Object that implements the MonitoredDataItemListener. Use null to remove the
listener.
RuntimeException - if the listener is already definedpublic org.opcfoundation.ua.core.DataChangeFilter getDataChangeFilter()
setDataChangeFilter(org.opcfoundation.ua.core.DataChangeFilter)public MonitoredDataItemListener getDataChangeListener()
@Deprecated public MonitoredDataItemListener[] getDataChangeListeners()
getDataChangeListener()
instead.
public org.opcfoundation.ua.utils.NumericRange getIndexRange()
MonitoredItemBase
getIndexRange in class MonitoredItemBasepublic double getSamplingInterval()
MonitoredItemBase
getSamplingInterval in class MonitoredItemBasepublic org.opcfoundation.ua.builtintypes.DataValue getValue()
@Deprecated public boolean hasChangeListener(MonitoredDataItemListener listener)
#getChangeListener() instead.
listener - the listener to check
@Deprecated public boolean removeChangeListener(MonitoredDataItemListener listener)
setDataChangeListener(MonitoredDataItemListener) instead.
listener - Object that implements the MonitoredDataItemListener
public void setAggregateFilter(org.opcfoundation.ua.core.AggregateFilter filter)
throws ServiceException,
StatusException
ServiceException
StatusException
public void setDataChangeFilter(org.opcfoundation.ua.core.DataChangeFilter filter)
throws ServiceException,
StatusException
The DataChangeFilter defines the conditions under which a data change notification should be reported and, optionally, a range or band for value changes where no DataChange Notification is generated. This range is called Deadband.
The fields of the filter are defined as follows
| Name | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| trigger | Specifies the conditions under which a data change notification should be reported. It has
the following values :
| ||||||||
| deadbandType | A value that defines the Deadband type and behaviour.
| ||||||||
| deadbandValue | The Deadband is applied only if
DeadbandType = AbsoluteDeadband: For this type the deadbandValue contains the absolute change in a data value that shall cause a Notification to be generated. This parameter applies only to Variables with any number data type. An exception that causes a DataChange Notification based on an AbsoluteDeadband is determined as follows:
The last cached value is defined as the most recent value previously sent to the Notification channel. If the item is an array of values, the entire array is returned if any array element exceeds the AbsoluteDeadband. DeadbandType = PercentDeadband: For this type of deadband the deadbandValue is defined as the percentage of the EURange. That is, it applies only to AnalogItems with an EURange Property that defines the typical value range for the item. This range shall be multiplied with the deadbandValue to generate an exception limit. An exception is determined as follows:
If the item is an array of values and any array element exceeds the deadbandValue, the entire monitored array is returned. |
filter - the new filter
StatusException
ServiceExceptionpublic void setDataChangeListener(MonitoredDataItemListener listener)
listener - Object that implements the MonitoredDataItemListener. Use null to remove the
listener.
public void setIndexRange(org.opcfoundation.ua.utils.NumericRange indexRange)
throws ServiceException
This parameter is used to identify a single element of an array, or a single range of indexes for arrays. If a range of elements is specified, the values are returned as a composite. The first element is identified by index 0 (zero).
This parameter is null if the specified Attribute is not an array. However, if the specified Attribute is an array, and this parameter is null, then all elements are to be included in the range.
The format of the parameter is defined formally in the OPC UA specification (Part 4), using BNF notation. In short, the following alternatives can be used:
All indexes start with 0. The maximum value for any index is one less than the length of the dimension.
When reading a value the indexes may not specify a range that is within the bounds of the array. The Server shall return a partial result if some elements exist within the range. The Server shall return a Bad_OutOfRange If no elements exist within the range.
indexRange - A number or a numeric range. Null or empty string indicates that this
parameter is not used.
ServiceException - if the service call to update the value to the server fails
public void setSamplingInterval(double samplingInterval)
throws ServiceException
The value 0 indicates that the Server should use the fastest practical rate.
The value -1 indicates that the default sampling interval defined by the publishing rate of the Subscription is used.
The Server uses this parameter to assign the MonitoredItems to a sampling interval that it supports.
samplingInterval - the interval in milliseconds
ServiceException - if the service call to update the value to the server fails
public void setSamplingInterval(long samplingInterval,
TimeUnit unit)
throws ServiceException
The value 0 indicates that the Server should use the fastest practical rate.
The value -1 indicates that the default sampling interval defined by the publishing rate of the Subscription is used.
The Server uses this parameter to assign the MonitoredItems to a sampling interval that it supports.
samplingInterval - the interval in millisecondsunit - the time unit of the requestedPublishingInterval argument
ServiceException - if the service call to update the value to the server fails
protected void fireDataChange(org.opcfoundation.ua.builtintypes.DataValue prevValue,
org.opcfoundation.ua.builtintypes.DataValue newValue)
prevValue - newValue - protected long getDefaultQueueSize()
getDefaultQueueSize in class MonitoredItemBaseprotected void setRevisedSamplingInterval(Double revisedSamplingInterval)
revisedSamplingInterval - protected void setValue(org.opcfoundation.ua.builtintypes.DataValue value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||