public class MonitoredEventItem extends MonitoredItem
| Modifier and Type | Field and Description |
|---|---|
protected EventListener |
eventListener |
links, node, subscriptionattributeId, clientHandle, dataEncoding, discardOldest, maxQueueSize, monitoredItemId, monitoringMode, nodeId, prevMonitoringMode, queueSize| Constructor and Description |
|---|
MonitoredEventItem(ServiceContext serviceContext,
Subscription subscription,
UnsignedInteger monitoredItemId,
NodeId nodeId,
EventFilter filter,
EventFilterResult filterResult) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
filter(EventData eventData)
Checks if an event occurrence is filtered by the current EventFilter.
|
Boolean |
filter(EventData eventData,
Boolean defaultResult)
Checks if an event occurrence is filtered by the current EventFilter.
|
int |
getCurrentQueueSize()
Current number of items in the event queue.
|
protected long |
getDefaultQueueSize() |
EventFilter |
getEventFilter() |
EventFilterResult |
getEventFilterResult() |
protected void |
getEvents(List<EventFieldList> events) |
static int |
getMaxQueueSize()
Deprecated.
|
protected NodeManagerRoot |
getNodeManagerRoot() |
boolean |
isMonitored(UaNode event) |
void |
notifyEvent(EventData eventData)
Send an event notification to the client via the monitored item.
|
void |
notifyEvent(EventData eventData,
boolean applyFilter)
Send an event notification to the client via the monitored item.
|
void |
notifyEvent(Variant[] eventData)
Send raw data as an event notification to the client via the monitored item.
|
void |
onEvent(UaNode node,
EventData eventData)
Deprecated.
use
notifyEvent(EventData) instead. |
protected void |
plugNodeListener() |
protected void |
setEventFilter(EventFilter eventFilter) |
protected void |
setEventFilterResult(EventFilterResult eventFilterResult) |
static void |
setMaxQueueSize(int maxQueueSize)
Deprecated.
|
protected void |
unPlugNodeListener() |
protected void |
updateFilter()
React to changes in the filter.
|
protected void |
updateQueue()
Update the queue, when it's size has changed.
|
addLink, close, equals, getNode, getServiceContext, getSubscription, getTimestampsToReturn, hashCode, monitoringModeChanged, removeLink, setClientHandle, setFilter, setFilterResult, setNode, setServiceContext, setTimestampsToReturngetAttributeId, getClientHandle, getDataEncoding, getFilter, getFilterResult, getIndexRange, getMonitoredItemId, getMonitoringMode, getNodeId, getNodeIdAsString, getPrevMonitoringMode, getQueueSize, getSamplingInterval, getUserData, isDiscardOldest, setDiscardOldest, setMonitoredItemId, setMonitoringMode, setQueueSize, setQueueSize, setUserData, toStringprotected EventListener eventListener
public MonitoredEventItem(ServiceContext serviceContext, Subscription subscription, UnsignedInteger monitoredItemId, NodeId nodeId, EventFilter filter, EventFilterResult filterResult) throws StatusException
subscription - monitoredItemId - nodeId - filter - filterResult - StatusException - if the filter is not valid@Deprecated public static int getMaxQueueSize()
MonitoredItem.getMaxQueueSize()@Deprecated public static void setMaxQueueSize(int maxQueueSize)
MonitoredItem.setMaxQueueSize(int)Default: 1000000
maxQueueSize - the maxQueueSize to set, must be bigger than 0public boolean filter(EventData eventData)
The method evaluates the whereClause of the EventFilter using the provided eventData.
eventData - The event data structure that is being checked. Only the fields that are
defined in the EventData are checked.public Boolean filter(EventData eventData, Boolean defaultResult)
The method evaluates the whereClause of the EventFilter using the provided eventData.
eventData - The event data structure that is being checked. Only the fields that are
defined in the EventData are checked.defaultResult - the result in case the whereClause of the filter evaluates to null, due to
missing fields or fields that have value null.public int getCurrentQueueSize()
public EventFilter getEventFilter()
public EventFilterResult getEventFilterResult()
public boolean isMonitored(UaNode event)
public void notifyEvent(EventData eventData)
eventData - values of the event fields to sendpublic void notifyEvent(EventData eventData, boolean applyFilter)
eventData - values of the event fields to sendapplyFilter - if true, the normal filter will be applied. Provide false, to omit the
filtering. Used for RefreshStart and RefreshEnd events. Default is true.public void notifyEvent(Variant[] eventData)
EventData-based overloads, this one is
specifically designed for aggregation scenarios where this data originates from a Client side
MonitoredItem and is passed raw (with possibly some data translations regarding
namespace-indexes) here to route through the server. This method does not apply the filter
part, it is assumed data is already filtered, i.e. this method shall not be called if the
filter of this item would filter it out. The given array shall have exactly as many elements as
the event filter has selected fields or the result is undefined.@Deprecated public void onEvent(UaNode node, EventData eventData)
notifyEvent(EventData) instead.This method is used for non-UaNode items from your application to send a new event notification for the monitored item. UaNode-based items will monitor the nodes and send events automatically.
The event will be checked against the filter defined by the client to determine if it really needs to be sent.
node - not usedeventData - values of the event fields to sendprotected long getDefaultQueueSize()
getDefaultQueueSize in class MonitoredItemBaseprotected void getEvents(List<EventFieldList> events)
events - protected NodeManagerRoot getNodeManagerRoot()
protected void plugNodeListener()
plugNodeListener in class MonitoredItemprotected final void setEventFilter(EventFilter eventFilter) throws ServiceException
ServiceExceptionprotected void setEventFilterResult(EventFilterResult eventFilterResult)
eventFilterResult - the eventFilterResult to setprotected void unPlugNodeListener()
unPlugNodeListener in class MonitoredItemprotected void updateFilter()
MonitoredItemBaseupdateFilter in class MonitoredItemBaseprotected void updateQueue()
updateQueue in class MonitoredItemBaseCopyright © 2026. All rights reserved.