public class MonitoredDataItem extends MonitoredItem
MonitoredItem, that is used for data changes monitoring, i.e. for any all
Attributes except Attributes.EventNotifier.| Modifier and Type | Class and Description |
|---|---|
protected class |
MonitoredDataItem.AggregateFilterConfiguration |
| Modifier and Type | Field and Description |
|---|---|
protected MonitoredDataItem.AggregateFilterConfiguration |
aggregateFilter |
protected DataChangeListener |
dataChangeListener |
protected static DataValue |
DELAY_SAMPLE |
links, node, subscriptionattributeId, clientHandle, dataEncoding, discardOldest, maxQueueSize, monitoredItemId, monitoringMode, nodeId, prevMonitoringMode, queueSize| Constructor and Description |
|---|
MonitoredDataItem(ServiceContext serviceContext,
Subscription subscription,
UnsignedInteger monitoredItemId,
NodeId nodeId,
UnsignedInteger attributeId,
NumericRange indexRange,
MonitoringMode monitoringMode)
Creates a new
MonitoredDataItem with the given parameters. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addNewSample(DataValue value,
boolean mayReplaceLastSample) |
protected DataValue |
applyIndexRange(DataValue value) |
protected void |
assignEuRange(DataValue dataValue) |
protected boolean |
checkAggregate(DateTime currentTime) |
protected boolean |
checkDeadband(DataValue lastValue,
DataValue value,
DeadbandType deadbandType) |
protected boolean |
checkDeadband(DeadbandType deadbandType,
Object lastValue,
Object value) |
protected void |
clearQueue() |
AggregateFilter |
getAggregateFilter() |
protected MonitoredDataItem.AggregateFilterConfiguration |
getAggregateFilterConfiguration() |
DataChangeFilter |
getDataChangeFilter() |
DataChangeTrigger |
getDataChangeTrigger() |
DeadbandType |
getDeadbandType()
DeadbandType defines how the
getDeadbandValue() should be used. |
double |
getDeadbandValue()
Deadband defines the minimum change that is required for the monitored value before a data
change notifications should be sent to the client.
|
protected long |
getDefaultQueueSize() |
Range |
getEuRange()
The range defined for the monitoredItem
|
UaProperty |
getEuRangeProperty()
The property that defines the EuRange
|
NumericRange |
getIndexRange()
The range of array indexes to monitor with the monitored item.
|
DataValue |
getLastValue() |
protected DataValue |
getNextSample(boolean isTrigger) |
protected DataValue |
getPrevValue() |
protected BlockingDeque<DataValue> |
getQueue() |
double |
getSamplingInterval()
The SamplingInterval.
|
protected static long |
getServerTimestampInMillis(DataValue lrv) |
protected static long |
getSourceTimestampInMillis(DataValue lrv) |
protected double |
getValueRange() |
protected boolean |
hasAggregateFilter() |
boolean |
hasMoreSamples() |
protected void |
initAggregateFilter() |
protected boolean |
isAccessible()
Return true if the current Session of the item was allowed to access the node, note that this
is calculated once per session activation and any changes in user access levels later is not
taken into account.
|
protected boolean |
isInSameSamplingInterval(DataValue value,
DataValue prevSample,
DataValue lastValue)
Check if the new sample belongs to the same samplingInterval as lastValue, i.e.
|
protected void |
monitoringModeChanged() |
void |
notifyDataChange(DataValue value)
Report a new data change to the item.
|
void |
notifyDataChange(DataValue value,
boolean applyIndexRange)
Report a new data change to the item.
|
protected void |
notifyDataChange(DataValue value,
boolean applyIndexRange,
boolean cloneValue)
Handle reporting of new data change to the item.
|
void |
notifyResendData()
Resend the lastValue - as a response to a ResendData request from the client.
|
void |
onDataChange(UaNode sender,
DataValue prevValue,
DataValue value)
Deprecated.
use
notifyDataChange(DataValue) instead. |
protected void |
plugNodeListener() |
protected void |
setDataChangeFilter(DataChangeFilter filter) |
void |
setEuRange(Range range)
Define the EuRange corresponding to the monitored item.
|
void |
setEuRangeProperty(UaProperty euRangeProperty)
The property that defines the EuRange for the monitoredItem.
|
protected void |
setIndexRange(NumericRange indexRange) |
protected void |
setLastValue(DataValue value,
boolean updatePrevValue) |
protected DataValue |
setOverflowBit(DataValue value) |
void |
setSamplingInterval(double samplingInterval)
The interval that defines the fastest rate at which the MonitoredItem(s) should be accessed and
evaluated.
|
protected void |
startSampling(boolean sendInitialValues)
Start sampling for the item.
|
protected void |
unPlugNodeListener() |
protected void |
updateAccessible(Session session) |
protected void |
updateFilter()
React to changes in the filter.
|
protected void |
updateQueue()
Update the queue, when it's size has changed.
|
addLink, close, equals, getMaxQueueSize, getNode, getServiceContext, getSubscription, getTimestampsToReturn, hashCode, removeLink, setClientHandle, setFilter, setFilterResult, setMaxQueueSize, setNode, setServiceContext, setTimestampsToReturngetAttributeId, getClientHandle, getDataEncoding, getFilter, getFilterResult, getMonitoredItemId, getMonitoringMode, getNodeId, getNodeIdAsString, getPrevMonitoringMode, getQueueSize, getUserData, isDiscardOldest, setDiscardOldest, setMonitoredItemId, setMonitoringMode, setQueueSize, setQueueSize, setUserData, toStringprotected static final DataValue DELAY_SAMPLE
protected MonitoredDataItem.AggregateFilterConfiguration aggregateFilter
protected DataChangeListener dataChangeListener
public MonitoredDataItem(ServiceContext serviceContext, Subscription subscription, UnsignedInteger monitoredItemId, NodeId nodeId, UnsignedInteger attributeId, NumericRange indexRange, MonitoringMode monitoringMode)
MonitoredDataItem with the given parameters.protected static long getServerTimestampInMillis(DataValue lrv)
protected static long getSourceTimestampInMillis(DataValue lrv)
public AggregateFilter getAggregateFilter()
public DataChangeFilter getDataChangeFilter()
public DataChangeTrigger getDataChangeTrigger()
public DeadbandType getDeadbandType()
getDeadbandValue() should be used.getDeadbandValue()public double getDeadbandValue()
The value is applied depending on the getDeadbandType():
getEuRange()
public Range getEuRange()
setEuRange(Range),
setEuRangeProperty(UaProperty)public UaProperty getEuRangeProperty()
setEuRange(Range),
setEuRangeProperty(UaProperty)public NumericRange getIndexRange()
getIndexRange in class MonitoredItemBasepublic DataValue getLastValue()
public double getSamplingInterval()
MonitoredItemBasegetSamplingInterval in class MonitoredItemBasepublic boolean hasMoreSamples()
public void notifyDataChange(DataValue value)
This method is used for non-UaNode items from your application to report value changes in the monitored item. UaNode-based items will monitor the nodes automatically.
The value will be checked against the filter and deadband defined by the client to determine if
it really needs to be sent. getIndexRange() will be applied to the value, if defined.
value - the new value for the item.notifyDataChange(DataValue, boolean)public void notifyDataChange(DataValue value, boolean applyIndexRange)
This method is used for non-UaNode items from your application to report value changes in the monitored item. UaNode-based items will monitor the nodes automatically.
The value will be checked against the filter and deadband defined by the client to determine if
it really needs to be sent. You can define whether getIndexRange() should be applied
to the value.
value - the new value for the item.applyIndexRange - whether the getIndexRange() defined for the item should be
applied to the value. Default is true, but if you have already applied the range before
calling this method to notify the change, use false.notifyDataChange(DataValue)public void notifyResendData()
@Deprecated public void onDataChange(UaNode sender, DataValue prevValue, DataValue value)
notifyDataChange(DataValue) instead.This method is used for non-UaNode items from your application to report value changes in the monitored item. UaNode-based items will monitor the nodes automatically.
sender - not usedprevValue - not usedvalue - the new value for the item.public void setEuRange(Range range)
You can define the range for each item when they are created, in
NodeManager.afterCreateMonitoredDataItem(ServiceContext, Subscription, MonitoredDataItem)
or
NodeManagerListener.onAfterCreateMonitoredDataItem(ServiceContext, Subscription, MonitoredDataItem)
.
If the monitoredItem is linked to an UaVariable (in MonitoredItem.getNode()), the range is looked
among the properties of the variable. The property is then assigned to RangeProperty (with
setEuRangeProperty(UaProperty).
Instead of Range you may also define RangeProperty, if it is not assigned automatically.
range - the range to set setEuRangeProperty(UaProperty)public void setEuRangeProperty(UaProperty euRangeProperty)
euRangeProperty - the euRangeProperty to setsetEuRange(Range)public void setSamplingInterval(double samplingInterval)
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.
The value can be modified at NodeManager#afterCreateMonitoredDataItem() or
NodeManagerListener#onAfterCreateMonitoredDataItem() - and the updated value is
returned as a revised value back to the client.
samplingInterval - the interval in millisecondsprotected void addNewSample(DataValue value, boolean mayReplaceLastSample)
value - mayReplaceLastSample - protected void assignEuRange(DataValue dataValue)
dataValue - protected boolean checkAggregate(DateTime currentTime)
protected boolean checkDeadband(DataValue lastValue, DataValue value, DeadbandType deadbandType)
protected boolean checkDeadband(DeadbandType deadbandType, Object lastValue, Object value)
protected void clearQueue()
protected MonitoredDataItem.AggregateFilterConfiguration getAggregateFilterConfiguration()
protected long getDefaultQueueSize()
getDefaultQueueSize in class MonitoredItemBaseprotected DataValue getNextSample(boolean isTrigger)
protected DataValue getPrevValue()
protected BlockingDeque<DataValue> getQueue()
protected double getValueRange()
protected boolean hasAggregateFilter()
protected void initAggregateFilter()
protected boolean isAccessible()
protected boolean isInSameSamplingInterval(DataValue value, DataValue prevSample, DataValue lastValue)
value - the new sampleprevSample - the previous sample that was recordedlastValue - the last value that was recordedprotected void monitoringModeChanged()
throws ServiceException
monitoringModeChanged in class MonitoredItemServiceExceptionprotected void notifyDataChange(DataValue value, boolean applyIndexRange, boolean cloneValue)
protected void plugNodeListener()
plugNodeListener in class MonitoredItemprotected void setDataChangeFilter(DataChangeFilter filter) throws ServiceException
filter - StatusExceptionServiceExceptionprotected void setIndexRange(NumericRange indexRange)
indexRange - protected void setLastValue(DataValue value, boolean updatePrevValue)
value - updatePrevValue - protected void startSampling(boolean sendInitialValues)
protected void unPlugNodeListener()
unPlugNodeListener in class MonitoredItemprotected void updateAccessible(Session session)
protected void updateFilter()
MonitoredItemBaseupdateFilter in class MonitoredItemBaseprotected void updateQueue()
updateQueue in class MonitoredItemBaseCopyright © 2026. All rights reserved.