|
||||||||||
| 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.MonitoredEventItem
public class MonitoredEventItem
Monitored Item to use for event subscriptions.
Use the MonitoredEventItem to add new items to Subscription when you wish to monitor
events from event notifier nodes in the server.
MonitoredDataItem| Field Summary |
|---|
| 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 | |
|---|---|
MonitoredEventItem(org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId)
Create a new monitored item for listening server events. |
|
MonitoredEventItem(org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId,
org.opcfoundation.ua.core.EventFilter filter)
Create a new monitored item for listening server events. |
|
MonitoredEventItem(org.opcfoundation.ua.builtintypes.NodeId nodeId)
Create a new monitored item for listening server events. |
|
MonitoredEventItem(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.core.EventFilter filter)
Create a new monitored item for listening server events. |
|
| Method Summary | |
|---|---|
void |
addEventListener(MonitoredEventItemListener listener)
Deprecated. the items no longer support multicasting: use setEventListener(MonitoredEventItemListener) instead. |
static org.opcfoundation.ua.builtintypes.QualifiedName[] |
createBrowsePath(org.opcfoundation.ua.builtintypes.QualifiedName qualifiedName)
Create a BrowsePath from a string, using the default separators: pathSeparator="/", namespaceSeparator=":". |
static org.opcfoundation.ua.builtintypes.QualifiedName[] |
createBrowsePath(org.opcfoundation.ua.builtintypes.QualifiedName qualifiedName,
String pathSeparator,
String namespaceSeparator)
Create a BrowsePath from a string, separated by the defined pathSeparator string. |
protected void |
doEvent(org.opcfoundation.ua.builtintypes.Variant[] eventFields)
|
static org.opcfoundation.ua.builtintypes.QualifiedName[] |
getDefaultEventFields()
|
protected long |
getDefaultQueueSize()
|
org.opcfoundation.ua.core.EventFilter |
getEventFilter()
The current event filter. |
MonitoredEventItemListener |
getEventListener()
|
MonitoredEventItemListener[] |
getEventListeners()
Deprecated. the items no longer support multicasting: use getEventListener() instead. |
boolean |
hasEventListener(MonitoredEventItemListener listener)
Deprecated. the items no longer support multicasting: use getEventListener() instead. |
boolean |
removeEventListener(MonitoredEventItemListener listener)
Deprecated. the items no longer support multicasting: use getEventListener() instead. |
static void |
setDefaultEventFields(org.opcfoundation.ua.builtintypes.QualifiedName[] defaultEventFields)
Define the default fields to use for new items. |
void |
setEventFilter(org.opcfoundation.ua.core.EventFilter filter)
Define the event filter. |
void |
setEventListener(MonitoredEventItemListener listener)
Define the listener object to listen to the events from this monitored item. |
| 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, getIndexRange, getMonitoredItemId, getMonitoringMode, getQueueSize, getSamplingInterval, isDiscardOldest, setDiscardOldest, setFilter, setMonitoringMode, setQueueSize, setQueueSize, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MonitoredEventItem(org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId)
expandedNodeId - the node to listen to. Note that the server should return all events in
"sub nodes" of the defined node as well. The sub nodes are defined by the HasEventSource
references.
public MonitoredEventItem(org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId,
org.opcfoundation.ua.core.EventFilter filter)
expandedNodeId - the node to listen to. Note that the server should return all events in
"sub nodes" of the defined node as well. The sub nodes are defined by the HasEventSource
references.filter - the event filter, which defines the event types and fields that you wish to
listen to.public MonitoredEventItem(org.opcfoundation.ua.builtintypes.NodeId nodeId)
nodeId - the node to listen to. Note that the server should return all events in "sub
nodes" of the defined node as well. The sub nodes are defined by the HasEventSource
references.
public MonitoredEventItem(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.core.EventFilter filter)
nodeId - the node to listen to. Note that the server should return all events in "sub
nodes" of the defined node as well. The sub nodes are defined by the HasEventSource
references.filter - the event filter, which defines the event types and fields that you wish to
listen to.| Method Detail |
|---|
public static org.opcfoundation.ua.builtintypes.QualifiedName[] createBrowsePath(org.opcfoundation.ua.builtintypes.QualifiedName qualifiedName)
qualifiedName - The QualifiedName to parse
public static org.opcfoundation.ua.builtintypes.QualifiedName[] createBrowsePath(org.opcfoundation.ua.builtintypes.QualifiedName qualifiedName,
String pathSeparator,
String namespaceSeparator)
QualifiedName[] path1 = createBrowsePath(new QualifiedName("ActiveState/Id"), "/", null);
QualifiedName[] path2 = createBrowsePath(new QualifiedName("2:MyEventField/2:MyId"), "/", ":");
qualifiedName - The QualifiedName to parsepathSeparator - The string used to separate the parts of the browse pathnamespaceSeparator - The string used to separate the namespaceIndex in every part of the
path. Use null to use the index of the qualifiedName for every part.
public static org.opcfoundation.ua.builtintypes.QualifiedName[] getDefaultEventFields()
setDefaultEventFields(QualifiedName[])public static void setDefaultEventFields(org.opcfoundation.ua.builtintypes.QualifiedName[] defaultEventFields)
These fields are used to create the default filter for new items, unless EventFilter is defined.
Note that the NodeId field will be appended to the filter by default.
This is initialized to an empty array by default.
defaultEventFields - @Deprecated public void addEventListener(MonitoredEventItemListener listener)
setEventListener(MonitoredEventItemListener) instead.
listener - Object that implements the MonitoredDataItemListener. Must not be nullpublic org.opcfoundation.ua.core.EventFilter getEventFilter()
MonitoredItemBase.setFilter(org.opcfoundation.ua.core.MonitoringFilter) for a description of the filter fields.
public MonitoredEventItemListener getEventListener()
@Deprecated public MonitoredEventItemListener[] getEventListeners()
getEventListener() instead.
@Deprecated public boolean hasEventListener(MonitoredEventItemListener listener)
getEventListener() instead.
listener - the listener to check. Must not be null
@Deprecated public boolean removeEventListener(MonitoredEventItemListener listener)
getEventListener() instead.
listener - the listener to remove from the item
public void setEventFilter(org.opcfoundation.ua.core.EventFilter filter)
throws ServiceException
The EventFilter provides for the filtering and content selection of Event Subscriptions. If an Event Notification conforms to the filter defined by the where parameter of the EventFilter, then the Notification is sent to the Client.
Each Event Notification shall include the fields defined by the selectClauses parameter of the EventFilter. The defined EventTypes are specified in Part 5 of the OPC UA specification.
The selectClause and whereClause parameters are specified with the SimpleAttributeOperand structure. This structure requires the NodeId of an EventType supported by the Server and a path to an InstanceDeclaration. An InstanceDeclaration is a Node which can be found by following forward hierarchical references from the fully inherited EventType where the Node is also the source of a HasModellingRule reference. EventTypes, InstanceDeclarations and Modeling Rules are described completely in Part 3 of the specification.
In some cases the same BrowsePath will apply to multiple EventTypes. If the Client specifies the BaseEventType in the SimpleAttributeOperand then the Server shall evaluate the BrowsePath without considering the Type.
Each InstanceDeclaration in the path shall be Object or Variable Node. The final Node in the path may be an Object Node, however, Object Nodes are only available for Events which are visible in the Server's Address Space.
The SimpleAttributeOperand structure allows the Client to specify any Attribute, however, the Server is only required to support the Value Attribute for Variable Nodes and the NodeId Attribute for Object Nodes.
The SimpleAttributeOperand structure is used in the selectClause to select the value to return if an Event meets the criteria specified by the whereClause. A null value is returned in the corresponding event field in the Publish response if the selected field is not part of the Event or an error was returned in the selectClauseResults of the EventFilterResult. If the selected field is available but cannot be returned to Client then the Server shall return a StatusCode that indicates the reason for the error. For example, the Server shall return a Bad_UserAccessDenied error if the value is not accessible to the user associated with the Session. If a Value Attribute has an uncertain or bad StatusCode associated with it then the Server shall return the StatusCode instead of the Value. The Server shall validate the selectClauses when a Client creates or updates the EventFilter. Any errors which are true for all possible Events are returned in the selectClauseResults parameter. The Server shall not report errors that might occur depending on the state or the Server or type of Event. For example, a selectClause that requests a single element in an array would always produce an error if the DataType of the Attribute is a scalar. However, even if the DataType is an array an error could occur if the requested index does not exist for a particular Event, the Server would not report an error in the selectClauseResults parameter if the latter situation existed.
The SimpleAttributeOperand is used in the whereClause to select a value which forms part of a logical expression. These logical expressions are then used to determine whether a particular Event should be reported to the Client. The Server shall use a null value for if any error occurs when a whereClause is evaluated for a particular Event. If a Value Attribute has an uncertain or bad StatusCode associated with it then the Server shall use a null value instead of the Value.
Any basic FilterOperator may be used in the whereClause, however, only the OfType FilterOperator from the complex filters is permitted.
The Server shall validate the whereClauses when a Client creates or updates the EventFilter. Any structural errors in the construction of the filter and any errors which are true for all possible Events are returned in the whereClauseResult parameter. Errors that could occur depending on the state of the Server or the Event are not reported.
SubscriptionControlEvents are special Events which are used to provide control information to the Client. These Events are only published to the MonitoredItems in the Subscription that produced the SubscriptionControlEvent. These Events bypass the whereClause.
filter - the new event filter. If set to null, the default event filter will be used
(initialized with getDefaultEventFields())
ServiceException - if the filter update fails in the serverpublic void setEventListener(MonitoredEventItemListener listener)
listener - Object that implements the MonitoredDataItemListener. Use null to remove the
listener.protected void doEvent(org.opcfoundation.ua.builtintypes.Variant[] eventFields)
eventFields - protected long getDefaultQueueSize()
getDefaultQueueSize in class MonitoredItemBase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||