public abstract class MonitoredItem extends MonitoredItemBase
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.
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger |
attributeId, clientHandle, dataEncoding, discardOldest, maxQueueSize, monitoredItemId, monitoringMode, nodeId, prevMonitoringMode, queueSize| Modifier | Constructor and Description |
|---|---|
protected |
MonitoredItem(ExpandedNodeId expandedNodeId,
UnsignedInteger attributeId,
MonitoringMode monitoringMode)
Create a new monitored item in a subscription.
|
protected |
MonitoredItem(NodeId nodeId,
UnsignedInteger attributeId,
MonitoringMode monitoringMode)
Create a new monitored item in a subscription.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
clearModified() |
protected void |
clearMonitoringModeModified() |
boolean |
equals(Object obj) |
protected void |
fireError(StatusCode newErrorCode)
Triggers
MonitoredItemErrorListener.onError(MonitoredItem, StatusCode), if listener set
to this item. |
StatusCode |
getErrorCode()
Item error status.
|
MonitoredItemErrorListener |
getErrorListener()
Returns the current error listener.
|
ExpandedNodeId |
getExpandedNodeId() |
StatusCode |
getInitialStatus()
The initial status tells if the creation of the MonitoredItem succeeded in the first
createMonitoredItems.
|
NodeId |
getNodeId() |
protected String |
getNodeIdAsString() |
Subscription |
getSubscription() |
int |
hashCode() |
boolean |
isModified() |
boolean |
isMonitoringModeModified() |
protected void |
itemChanged() |
protected void |
monitoringModeChanged() |
protected void |
setClientHandle(int i) |
protected void |
setErrorCode(StatusCode statusCode) |
void |
setErrorListener(MonitoredItemErrorListener statusListener)
Sets a listener for observing when
getErrorCode() changes. |
protected void |
setFilterResult(MonitoringFilterResult filterResult) |
protected void |
setMonitoredItemId(UnsignedInteger monitoredItemId) |
protected void |
setRevisedQueueSize(UnsignedInteger revisedQueueSize) |
protected void |
updateFilter()
React to changes in the filter.
|
protected void |
updateQueue()
Update the queue, when it's size has changed.
|
close, getAttributeId, getClientHandle, getDataEncoding, getDefaultQueueSize, getFilter, getFilterResult, getIndexRange, getMonitoredItemId, getMonitoringMode, getPrevMonitoringMode, getQueueSize, getSamplingInterval, getUserData, isDiscardOldest, setDiscardOldest, setFilter, setMonitoringMode, setQueueSize, setQueueSize, setUserData, toStringprotected MonitoredItem(ExpandedNodeId expandedNodeId, UnsignedInteger attributeId, MonitoringMode monitoringMode)
expandedNodeId - the NodeId (in ExpandedNodeId form) of the node to monitorattributeId - the attribute to monitormonitoringMode - the initial monitoring mode for the item. Specifies whether sampling and
reporting are enabled or disabled for a MonitoredItem.protected MonitoredItem(NodeId nodeId, UnsignedInteger attributeId, MonitoringMode monitoringMode)
nodeId - the NodeId of the node to monitorattributeId - the attribute to monitormonitoringMode - the initial monitoring mode for the item. Specifies whether sampling and
reporting are enabled or disabled for a MonitoredItem.public boolean equals(Object obj)
equals in class MonitoredItemBasepublic StatusCode getErrorCode()
public MonitoredItemErrorListener getErrorListener()
public ExpandedNodeId getExpandedNodeId()
public StatusCode getInitialStatus()
Subscription.isRecreateFailedItems() to define if
the item should be retried - if it never succeeded, it probably doesn't make sense to try to
recreate it, since the item is truly invalid. But if it has succeeded, the chances are that the
item really is in the server, but not yet, after a server restart.public NodeId getNodeId()
getNodeId in class MonitoredItemBasepublic Subscription getSubscription()
public int hashCode()
hashCode in class MonitoredItemBasepublic boolean isModified()
public boolean isMonitoringModeModified()
public void setErrorListener(MonitoredItemErrorListener statusListener)
getErrorCode() changes. This is related to the item
creation on the server.protected void clearModified()
protected void clearMonitoringModeModified()
protected void fireError(StatusCode newErrorCode)
MonitoredItemErrorListener.onError(MonitoredItem, StatusCode), if listener set
to this item.protected String getNodeIdAsString()
getNodeIdAsString in class MonitoredItemBaseprotected void itemChanged()
throws ServiceException
ServiceExceptionprotected void monitoringModeChanged()
throws ServiceException
monitoringModeChanged in class MonitoredItemBaseServiceExceptionprotected void setClientHandle(int i)
i - protected void setErrorCode(StatusCode statusCode)
statusCode - protected void setFilterResult(MonitoringFilterResult filterResult)
setFilterResult in class MonitoredItemBasefilterResult - protected void setMonitoredItemId(UnsignedInteger monitoredItemId)
setMonitoredItemId in class MonitoredItemBaseprotected void setRevisedQueueSize(UnsignedInteger revisedQueueSize)
revisedQueueSize - protected void updateFilter()
throws ServiceException
MonitoredItemBaseupdateFilter in class MonitoredItemBaseServiceExceptionprotected void updateQueue()
throws ServiceException
MonitoredItemBaseupdateQueue in class MonitoredItemBaseServiceExceptionCopyright © 2026. All rights reserved.