com.prosysopc.ua.server
Class MonitoredEventItem

java.lang.Object
  extended by com.prosysopc.ua.MonitoredItemBase
      extended by com.prosysopc.ua.server.MonitoredItem
          extended by com.prosysopc.ua.server.MonitoredEventItem

public class MonitoredEventItem
extends MonitoredItem

A monitored item for event monitoring, in the server side.


Field Summary
protected  EventListener eventListener
           
 
Fields inherited from class com.prosysopc.ua.server.MonitoredItem
links, node, subscription
 
Fields inherited from class com.prosysopc.ua.MonitoredItemBase
attributeId, clientHandle, dataEncoding, discardOldest, maxQueueSize, monitoredItemId, monitoringMode, nodeId, queueSize
 
Constructor Summary
MonitoredEventItem(ServiceContext serviceContext, Subscription subscription, org.opcfoundation.ua.builtintypes.UnsignedInteger monitoredItemId, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.core.EventFilter filter, org.opcfoundation.ua.core.EventFilterResult filterResult)
           
 
Method Summary
 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()
           
 org.opcfoundation.ua.core.EventFilter getEventFilter()
           
 org.opcfoundation.ua.core.EventFilterResult getEventFilterResult()
           
protected  void getEvents(List<org.opcfoundation.ua.core.EventFieldList> events)
           
static int getMaxQueueSize()
          Deprecated. Use MonitoredItem.getMaxQueueSize()
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 onEvent(UaNode node, EventData eventData)
          Deprecated. use notifyEvent(EventData) instead.
protected  void plugNodeListener()
           
protected  void setEventFilter(org.opcfoundation.ua.core.EventFilter eventFilter)
           
protected  void setEventFilterResult(org.opcfoundation.ua.core.EventFilterResult eventFilterResult)
           
static void setMaxQueueSize(int maxQueueSize)
          Deprecated. Use MonitoredItem.setMaxQueueSize(int)
protected  void unPlugNodeListener()
           
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.server.MonitoredItem
addLink, close, equals, getNode, getServiceContext, getSubscription, getTimestampsToReturn, hashCode, monitoringModeChanged, removeLink, setClientHandle, setFilter, setFilterResult, setNode, setServiceContext, setTimestampsToReturn
 
Methods inherited from class com.prosysopc.ua.MonitoredItemBase
getAttributeId, getClientHandle, getDataEncoding, getFilter, getFilterResult, getIndexRange, getMonitoredItemId, getMonitoringMode, getNodeId, getQueueSize, getSamplingInterval, isDiscardOldest, setDiscardOldest, setMonitoredItemId, setMonitoringMode, setQueueSize, setQueueSize, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

eventListener

protected EventListener eventListener
Constructor Detail

MonitoredEventItem

public MonitoredEventItem(ServiceContext serviceContext,
                          Subscription subscription,
                          org.opcfoundation.ua.builtintypes.UnsignedInteger monitoredItemId,
                          org.opcfoundation.ua.builtintypes.NodeId nodeId,
                          org.opcfoundation.ua.core.EventFilter filter,
                          org.opcfoundation.ua.core.EventFilterResult filterResult)
                   throws StatusException
Parameters:
subscription -
monitoredItemId -
nodeId -
filter -
filterResult -
Throws:
StatusException - if the filter is not valid
Method Detail

getMaxQueueSize

@Deprecated
public static int getMaxQueueSize()
Deprecated. Use MonitoredItem.getMaxQueueSize()

The maximum size of the queue of MonitoredEventItems.

Returns:
the maxQueueSize

setMaxQueueSize

@Deprecated
public static void setMaxQueueSize(int maxQueueSize)
Deprecated. Use MonitoredItem.setMaxQueueSize(int)

Define the maximum size of the queue of each MonitoredEventItem.

Default: 1000000

Parameters:
maxQueueSize - the maxQueueSize to set, must be bigger than 0

filter

public boolean filter(EventData eventData)
Checks if an event occurrence is filtered by the current EventFilter.

The method evaluates the whereClause of the EventFilter using the provided eventData.

Parameters:
eventData - The event data structure that is being checked. Only the fields that are defined in the EventData are checked.
Returns:
true if the event passes the filter, i.e. it would be sent to the client of this monitored item. If the filter evaluates to null, returns false.

filter

public Boolean filter(EventData eventData,
                      Boolean defaultResult)
Checks if an event occurrence is filtered by the current EventFilter.

The method evaluates the whereClause of the EventFilter using the provided eventData.

Parameters:
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.
Returns:
true if the event passes the filter, i.e. it would be sent to the client of this monitored item.

getCurrentQueueSize

public int getCurrentQueueSize()
Current number of items in the event queue. Read the value to find out how many events are currently pending in the internal queue to be sent for the client. The queue is drained and sent to the client every PublishingInterval. For event items, the queue size should be unlimited, but if you add too many events it may result to a too big notification.

Returns:
the current number of items in the internal queue.

getEventFilter

public org.opcfoundation.ua.core.EventFilter getEventFilter()

getEventFilterResult

public org.opcfoundation.ua.core.EventFilterResult getEventFilterResult()
Returns:
the eventFilterResult

isMonitored

public boolean isMonitored(UaNode event)

notifyEvent

public void notifyEvent(EventData eventData)
Send an event notification to the client via the monitored item.

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.

Parameters:
eventData - values of the event fields to send

notifyEvent

public void notifyEvent(EventData eventData,
                        boolean applyFilter)
Send an event notification to the client via the monitored item.

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, unless applyFilter is false.

Parameters:
eventData - values of the event fields to send
applyFilter - if true, the normal filter will be applied. Provide false, to omit the filtering. Used for RefreshStart and RefreshEnd events. Default is true.

onEvent

@Deprecated
public void onEvent(UaNode node,
                               EventData eventData)
Deprecated. use notifyEvent(EventData) instead.

Send an event notification to the client via the monitored item.

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.

Parameters:
node - not used
eventData - values of the event fields to send

getDefaultQueueSize

protected long getDefaultQueueSize()
Specified by:
getDefaultQueueSize in class MonitoredItemBase
Returns:

getEvents

protected void getEvents(List<org.opcfoundation.ua.core.EventFieldList> events)
Parameters:
events -

getNodeManagerRoot

protected NodeManagerRoot getNodeManagerRoot()
Returns:

plugNodeListener

protected void plugNodeListener()
Overrides:
plugNodeListener in class MonitoredItem

setEventFilter

protected final void setEventFilter(org.opcfoundation.ua.core.EventFilter eventFilter)
                             throws ServiceException
Throws:
ServiceException

setEventFilterResult

protected void setEventFilterResult(org.opcfoundation.ua.core.EventFilterResult eventFilterResult)
Parameters:
eventFilterResult - the eventFilterResult to set

unPlugNodeListener

protected void unPlugNodeListener()
Overrides:
unPlugNodeListener in class MonitoredItem

updateFilter

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

Overrides:
updateFilter in class MonitoredItemBase

updateQueue

protected void updateQueue()
Update the queue, when it's size has changed.

Overrides:
updateQueue in class MonitoredItemBase


Copyright © 2018. All rights reserved.