|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.prosysopc.ua.server.ServiceManagerBase
com.prosysopc.ua.server.NodeManager
com.prosysopc.ua.server.NodeManagerUaNode
public class NodeManagerUaNode
Main implementation of the NodeManager. NodeManagerUaNode manages a part of the OPC UA Server's address space, consisting of UaNode instances.
UseaddNode(UaNode) or addNodeAndReference(UaNode, UaNode, NodeId) to add your
node objects into the NodeManager. You can add references to the nodes using
addReference(org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.ExpandedNodeId, org.opcfoundation.ua.builtintypes.NodeId, boolean).
| Field Summary |
|---|
| Fields inherited from class com.prosysopc.ua.server.NodeManager |
|---|
initialized, started |
| Constructor Summary | |
|---|---|
NodeManagerUaNode(UaServer server,
String namespaceUri)
The default constructor |
|
| Method Summary | ||
|---|---|---|
void |
addComponent(UaNode parent,
UaInstance component)
Add a node as a component of another node into the address space. |
|
protected org.opcfoundation.ua.builtintypes.NodeId |
addNode(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.NodeId parentNodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.core.NodeClass nodeClass,
org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId,
org.opcfoundation.ua.core.NodeAttributes attributes,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
Handle adding a new node. |
|
UaNode |
addNode(UaNode newNode)
Adds a new node - unless it already exists in the node manager. |
|
UaNode |
addNodeAndReference(UaNode parent,
UaNode newNode,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
|
|
void |
addReference(org.opcfoundation.ua.builtintypes.NodeId sourceId,
org.opcfoundation.ua.builtintypes.ExpandedNodeId targetId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
Adds a Reference. |
|
void |
addReference(org.opcfoundation.ua.builtintypes.NodeId sourceId,
org.opcfoundation.ua.builtintypes.NodeId targetId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
Adds a reference to the Node Manager, if both the source and target are found. |
|
protected void |
addReference(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.NodeId sourceNodeId,
org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isForward,
org.opcfoundation.ua.core.NodeClass targetNodeClass,
String targetServerUri)
Handle adding a reference. |
|
void |
addReference(UaNode sourceNode,
UaNode targetNode,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
Add a new reference between the source and target node. |
|
|
addType(org.opcfoundation.ua.builtintypes.ExpandedNodeId newTypeDefinitionId,
String name,
T baseType)
|
|
|
addType(org.opcfoundation.ua.builtintypes.NodeId nodeId,
String name,
T baseType)
Add a new Object type Node to the Node Manager. |
|
protected void |
close()
Close the node manager, when the serve closes. |
|
|
createEvent(Class<T> clazz)
Creates a new event instance to be triggered. |
|
|
createEvent(org.opcfoundation.ua.builtintypes.ExpandedNodeId eventTypeId)
Creates a new event instance to be triggered. |
|
|
createEvent(org.opcfoundation.ua.builtintypes.NodeId eventTypeId)
Creates a new event instance to be triggered. |
|
FolderType |
createFolder(String name,
org.opcfoundation.ua.builtintypes.NodeId newNodeId)
Convenience method for creating a FolderType UaObject |
|
|
createInstance(Class<T> clazz,
org.opcfoundation.ua.builtintypes.NodeId newNodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Creates new UA instance. |
|
|
createInstance(Class<T> clazz,
String name)
Creates new UA instance. |
|
|
createInstance(Class<T> clazz,
String name,
org.opcfoundation.ua.builtintypes.NodeId newNodeId)
Creates new UA instance. |
|
UaInstance |
createInstance(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeId,
org.opcfoundation.ua.builtintypes.NodeId newNodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Creates new UA instance. |
|
UaInstance |
createInstance(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeId,
String name)
Creates new UA instance. |
|
UaInstance |
createInstance(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeId,
String name,
org.opcfoundation.ua.builtintypes.NodeId newNodeId)
Creates new UA instance. |
|
UaInstance |
createInstance(org.opcfoundation.ua.builtintypes.NodeId typeId,
org.opcfoundation.ua.builtintypes.NodeId newNodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Creates new UA instance. |
|
UaInstance |
createInstance(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId,
String name)
Creates new UA instance. |
|
UaInstance |
createInstance(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId,
String name,
org.opcfoundation.ua.builtintypes.NodeId newNodeId)
Creates new UA instance. |
|
protected void |
createMonitoredDataItem(ServiceContext serviceContext,
Subscription subscription,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.utils.NumericRange indexRange,
org.opcfoundation.ua.core.MonitoringParameters params,
org.opcfoundation.ua.core.MonitoringFilter filter,
org.opcfoundation.ua.core.AggregateFilterResult filterResult,
org.opcfoundation.ua.core.MonitoringMode monitoringMode)
Check that the monitored item request is valid. |
|
|
createNodeBuilder(Class<T> clazz)
Creates a NodeBuilder for given type. |
|
|
createNodeBuilder(Class<T> clazz,
UaNodeBuilderConfiguration configuration)
Creates a NodeBuilder for given type. |
|
|
createNodeBuilder(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId)
Creates a NodeBuilder for given type. |
|
|
createNodeBuilder(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeId,
UaNodeBuilderConfiguration configuration)
Creates a NodeBuilder for given type. |
|
|
createNodeBuilder(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId)
Creates a NodeBuilder for given type. |
|
|
createNodeBuilder(org.opcfoundation.ua.builtintypes.NodeId typeId,
UaNodeBuilderConfiguration configuration)
Creates a NodeBuilder for given type. |
|
protected UaNode |
createNodeForAddNodesRequest(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.core.NodeClass nodeClass,
org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Create node(s) for a single AddNodesRequest. |
|
protected UaNode |
createNodeForNodeSet2(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.core.NodeClass nodeClass,
org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Create a node for ModelParser loading NodeSet2. |
|
org.opcfoundation.ua.builtintypes.NodeId |
createNodeId(UaNode parent,
org.opcfoundation.ua.builtintypes.QualifiedName name)
Convenience method for createNodeId(UaNode, QualifiedName, int) that uses this NodeManager's NamespaceIndex. |
|
org.opcfoundation.ua.builtintypes.NodeId |
createNodeId(UaNode parent,
org.opcfoundation.ua.builtintypes.QualifiedName name,
int namespaceIndex)
Creates a new string type NodeId as |
|
org.opcfoundation.ua.builtintypes.NodeId |
createNodeId(UaNode parent,
String name)
Create a new string type NodeId as " |
|
org.opcfoundation.ua.builtintypes.NodeId |
createNodeId(UaNode parent,
String name,
int namespaceIndex)
Create a new string type NodeId as "[ParentNodeId]. |
|
protected NodeMap |
createNodeMap()
|
|
UaNode |
deleteNode(org.opcfoundation.ua.builtintypes.NodeId nodeId,
boolean deleteTargetReferences,
boolean deleteChildren)
Delete a node from the node manager. |
|
protected void |
deleteNode(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
Boolean deleteTargetReferences)
|
|
UaNode |
deleteNode(UaNode node,
boolean deleteTargetReferences,
boolean deleteChildren)
Delete a node from the node manager. |
|
protected UaNode |
deleteNode(UaNode node,
boolean deleteTargetReferences,
boolean deleteChildren,
boolean doNotDeleteIfInverseHierarchicalRefs)
|
|
void |
deleteReference(org.opcfoundation.ua.builtintypes.NodeId sourceNodeId,
org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
Delete a reference between the source and target node. |
|
protected void |
deleteReference(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.NodeId sourceNodeId,
org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
Boolean isForward,
Boolean deleteBidirectional)
|
|
void |
deleteReference(UaNode sourceNode,
org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
Delete a reference between the source and target node. |
|
void |
deleteReference(UaNode sourceNode,
UaNode targetNode,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
Delete a reference between the source and target node. |
|
UaNode |
findNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
Find the UaNode corresponding to the nodeId, if the Node Manager NodeManager.supportsUaNode(). |
|
protected org.opcfoundation.ua.builtintypes.QualifiedName |
getBrowseName(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
UaNode node)
Get the BrowseName of a node. |
|
protected org.opcfoundation.ua.builtintypes.LocalizedText |
getDisplayName(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
UaNode node,
Locale locale)
Find the DisplayName of a node. |
|
IoManagerUaNode |
getIoManager()
|
|
protected UaNode |
getNode(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger errorCode)
Get the node or return a specific error. |
|
protected UaNode |
getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger errorCode)
Get the node or return a specific error. |
|
UaNodeBuilderConfiguration |
getNodeBuilderConfiguration()
Get the NodeBuilder configuration that this manager uses. |
|
protected org.opcfoundation.ua.core.NodeClass |
getNodeClass(org.opcfoundation.ua.builtintypes.NodeId nodeId,
UaNode node)
Return the node class of a node, owned by this NodeManager. |
|
UaNodeFactory |
getNodeFactory()
|
|
char |
getNodeIdDelimiter()
|
|
String |
getNodeIdFormat()
The current format for new nodeIds created for internal nodes of UA objects, such as the ConditionType objects. |
|
UaNode |
getNodeOrExternal(org.opcfoundation.ua.builtintypes.NodeId nodeId)
|
|
NodeMap |
getNodes()
|
|
protected UaReference[] |
getReferences(org.opcfoundation.ua.builtintypes.NodeId nodeId,
UaNode node)
Get all references of a node. |
|
UaType |
getType(org.opcfoundation.ua.builtintypes.NodeId typeId)
Find the type node with a specific Id |
|
protected org.opcfoundation.ua.builtintypes.ExpandedNodeId |
getTypeDefinition(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
UaNode node)
Get the TypeDefinition of a node. |
|
org.opcfoundation.ua.builtintypes.NodeId |
getVariableDataType(org.opcfoundation.ua.builtintypes.NodeId nodeId,
UaValueNode variable)
Get the data type of a variable node, managed by this node manager. |
|
boolean |
hasNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
Check if the node manager has a certain node. |
|
protected void |
replaceExternalNode(UaExternalNode oldNode,
UaNode newNode)
|
|
protected boolean |
requireUaNode()
|
|
void |
setNodeBuilderConfiguration(UaNodeBuilderConfiguration nodeBuilderConfiguration)
Override the NodeBuilder configuration for this manager. |
|
void |
setNodeFactory(UaNodeFactory nodeFactory)
Define the NodeFactory to use for creating new nodes. |
|
void |
setNodeIdDelimiter(char nodeIdDelimiter)
|
|
boolean |
supportsUaNode()
Whether the NodeManager supports UaNode instances. |
|
| Methods inherited from class com.prosysopc.ua.server.ServiceManagerBase |
|---|
arrayDimensionsMatch, checkIsMethod, checkIsValueNode, checkIsVariable, checkIsVariableOrVariableType, dataTypeEquals, getNode, getNode, getNode, getNodeManagerTable, getServer, getSubscriptionManager, isValueNode, isVariable, listenerError |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NodeManagerUaNode(UaServer server,
String namespaceUri)
server - namespaceUri - | Method Detail |
|---|
public void addComponent(UaNode parent,
UaInstance component)
throws StatusException
addNodeAndReference(parent, variable, Identifiers.HasComponent);
parent - component -
StatusException
public UaNode addNode(UaNode newNode)
throws StatusException
addNode in class NodeManagernewNode - the node to add. The NodeId of the node must have the same namepsaceIndex as the
node manager.
StatusException - if the NodeId exists or is invalid (i.e. null)
NullPointerException - if the newNode parameter is null
public UaNode addNodeAndReference(UaNode parent,
UaNode newNode,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
throws StatusException
parent - newNode - referenceTypeId -
StatusException
public void addReference(org.opcfoundation.ua.builtintypes.NodeId sourceId,
org.opcfoundation.ua.builtintypes.ExpandedNodeId targetId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
throws StatusException
sourceId - id for the sourcetargetId - id for the target, may contain ServerIndexreferenceTypeId - id of the ReferenceTypeisInverse - Is the reference inverse
StatusException - if the source node cannot be found
public void addReference(org.opcfoundation.ua.builtintypes.NodeId sourceId,
org.opcfoundation.ua.builtintypes.NodeId targetId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
throws StatusException
sourceId - Id for sourcetargetId - Id for targetreferenceTypeId - Id for reference typeisInverse - Is this an inverse reference
StatusException - If the source node cannot be found.
public void addReference(UaNode sourceNode,
UaNode targetNode,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
sourceNode - the source nodetargetNode - the target nodereferenceTypeId - the reference typeisInverse - is this an inverse reference
public <T extends UaType> T addType(org.opcfoundation.ua.builtintypes.ExpandedNodeId newTypeDefinitionId,
String name,
T baseType)
throws UaNodeFactoryException,
StatusException
UaNodeFactoryException
StatusException
public <T extends UaType> T addType(org.opcfoundation.ua.builtintypes.NodeId nodeId,
String name,
T baseType)
throws StatusException,
UaNodeFactoryException
nodeId - The ID of the node. May not be a Null NodeId (or you get StatusException)name - The Node Name, which is used to initialize the BrowseName and DisplayName (with
defaultLocale)baseType - The "parent" type in the address space. Must be defined.
StatusException - if the NodeId exists or is null.
UaNodeFactoryException - if the new node cannot be created. Check NodeFactory that it
defines a proper type for the type nodes.public <T extends BaseEventType> T createEvent(Class<T> clazz)
After you have created the event, you need to set the field values and call
BaseEventTypeNode.triggerEvent(org.opcfoundation.ua.builtintypes.ByteString) for the object.
clazz - The event class
public <T extends BaseEventType> T createEvent(org.opcfoundation.ua.builtintypes.ExpandedNodeId eventTypeId)
After you have created the event, you need to set the field values and call
BaseEventTypeNode.triggerEvent(org.opcfoundation.ua.builtintypes.ByteString) for the object.
eventTypeId - The event type to create
public <T extends BaseEventType> T createEvent(org.opcfoundation.ua.builtintypes.NodeId eventTypeId)
After you have created the event, you need to set the field values and call
BaseEventTypeNode.triggerEvent(org.opcfoundation.ua.builtintypes.ByteString) for the object.
eventTypeId - The event type to create
public FolderType createFolder(String name,
org.opcfoundation.ua.builtintypes.NodeId newNodeId)
public <T extends UaInstance> T createInstance(Class<T> clazz,
org.opcfoundation.ua.builtintypes.NodeId newNodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.
If you wish to parameterize the node builder, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:
UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration(); conf.addOptional(...); NodeBuildernb = createNodeBuilder(YourClass.class, conf); nb.setBrowseName(browseName); nb.setDisplayName(displayName); nb.setNodeId(newNodeId); YourClass instance = nb.build();
clazz - The instance class to create. It must have the TypeDefinitionId
annotation.newNodeId - The requested NodeId of the new instance. This is also used as a basis for the
sub-nodes of the instance.browseName - The browse name for the instance.displayName - The localizable display name for the instance.
UaInstantiationException - if the instance cannot be created.createNodeBuilder(java.lang.Class)
public <T extends UaInstance> T createInstance(Class<T> clazz,
String name)
The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.
NodeId of the new instance will be generated from the name. You can use the other (overloaded) versions of the method to provide a specific NodeId instead.
If you wish to parameterize the node builder more, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:
UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration(); conf.addOptional(...); NodeBuildernb = createNodeBuilder(typeDefinitionId, conf); nb.setBrowseName(browseName); nb.setDisplayName(displayName); nb.setNodeId(newNodeId); YourClass instance = nb.build();
clazz - The instance class to create. It must have the TypeDefinitionId
annotation.name - Name of the new instance: this is used to create the NodeId and as a basis for the
BrowseName and DisplayName.
UaInstantiationException - if the instance cannot be created.createNodeBuilder(java.lang.Class)
public <T extends UaInstance> T createInstance(Class<T> clazz,
String name,
org.opcfoundation.ua.builtintypes.NodeId newNodeId)
The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.
If you wish to parameterize the node builder, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:
UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration(); conf.addOptional(...); NodeBuildernb = createNodeBuilder(YourClass.class, conf); nb.setBrowseName(browseName); nb.setDisplayName(displayName); nb.setNodeId(newNodeId); YourClass instance = nb.build();
clazz - The instance class to create. It must have the TypeDefinitionId
annotation.name - Name of the new instance: this is used as a basis for the BrowseName and
DisplayName.newNodeId - The NodeId of the new instance.
UaInstantiationException - if the instance cannot be created.createNodeBuilder(java.lang.Class)
public UaInstance createInstance(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeId,
org.opcfoundation.ua.builtintypes.NodeId newNodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.
If you wish to parameterize the node builder, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:
UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration(); conf.addOptional(...); NodeBuildernb = createNodeBuilder(YourClass.class, conf); nb.setBrowseName(browseName); nb.setDisplayName(displayName); nb.setNodeId(newNodeId); YourClass instance = nb.build();
clazz - The instance class to create. It must have the TypeDefinitionId
annotation.name - Name of the new instance: this is used to create the NodeId and as a basis for the
BrowseName and DisplayName.
UaInstantiationException - if the instance cannot be created.createNodeBuilder(java.lang.Class)
public UaInstance createInstance(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeId,
String name)
The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.
NodeId of the new instance will be generated from the name. You can use the other (overloaded) versions of the method to provide a specific NodeId instead.
If you wish to parameterize the node builder more, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:
UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration(); conf.addOptional(...); NodeBuildernb = createNodeBuilder(typeDefinitionId, conf); nb.setBrowseName(browseName); nb.setDisplayName(displayName); nb.setNodeId(newNodeId); YourClass instance = nb.build();
clazz - The instance class to create. It must have the TypeDefinitionId
annotation.name - Name of the new instance: this is used to create the NodeId and as a basis for the
BrowseName and DisplayName.
UaInstantiationException - if the instance cannot be created.createNodeBuilder(java.lang.Class)
public UaInstance createInstance(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeId,
String name,
org.opcfoundation.ua.builtintypes.NodeId newNodeId)
The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.
If you wish to parameterize the node builder, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:
UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration(); conf.addOptional(...); NodeBuildernb = createNodeBuilder(YourClass.class, conf); nb.setBrowseName(browseName); nb.setDisplayName(displayName); nb.setNodeId(newNodeId); YourClass instance = nb.build();
clazz - The instance class to create. It must have the TypeDefinitionId
annotation.name - Name of the new instance: this is used as a basis for the BrowseName and
DisplayName.newNodeId - The NodeId of the new instance.
UaInstantiationException - if the instance cannot be created.createNodeBuilder(java.lang.Class)
public UaInstance createInstance(org.opcfoundation.ua.builtintypes.NodeId typeId,
org.opcfoundation.ua.builtintypes.NodeId newNodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.
If you wish to parameterize the node builder, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:
UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration(); conf.addOptional(...); NodeBuildernb = createNodeBuilder(YourClass.class, conf); nb.setBrowseName(browseName); nb.setDisplayName(displayName); nb.setNodeId(newNodeId); YourClass instance = nb.build();
clazz - The instance class to create. It must have the TypeDefinitionId
annotation.newNodeId - The requested NodeId of the new instance. This is also used as a basis for the
sub-nodes of the instance.browseName - The browse name for the instance.displayName - The localizable display name for the instance.
UaInstantiationException - if the instance cannot be created.createNodeBuilder(java.lang.Class)
public UaInstance createInstance(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId,
String name)
The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.
NodeId of the new instance will be generated from the name. You can use the other (overloaded) versions of the method to provide a specific NodeId instead.
If you wish to parameterize the node builder more, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:
UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration(); conf.addOptional(...); NodeBuildernb = createNodeBuilder(typeDefinitionId, conf); nb.setBrowseName(browseName); nb.setDisplayName(displayName); nb.setNodeId(newNodeId); YourClass instance = nb.build();
typeDefinitionId - The UA type of the instance to create. Will use this to determine the
respective instance class to create.name - Name of the new instance: this is used to create the NodeId and as a basis for the
BrowseName and DisplayName.
UaInstantiationException - if the instance cannot be created.createNodeBuilder(java.lang.Class)
public UaInstance createInstance(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId,
String name,
org.opcfoundation.ua.builtintypes.NodeId newNodeId)
The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.
If you wish to parameterize the node builder, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:
UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration(); conf.addOptional(...); NodeBuildernb = createNodeBuilder(typeDefinitionId, conf); nb.setBrowseName(browseName); nb.setDisplayName(displayName); nb.setNodeId(newNodeId); YourClass instance = nb.build();
typeDefinitionId - The UA type of the instance to create. Will use this to determine the
respective instance class to create.name - Name of the new instance: this is used as a basis for the BrowseName and
DisplayName.newNodeId - The NodeId of the new instance.
UaInstantiationException - if the instance cannot be created.createNodeBuilder(java.lang.Class) public <T extends UaInstance> NodeBuilder<T> createNodeBuilder(Class<T> clazz)
clazz - The class of the instance to build. It must have the TypeDefinitionId
annotation.
UaInstantiationException - if the type node does not exist or it is invalid for
instantiation.createInstance(java.lang.Class, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText)
public <T extends UaInstance> NodeBuilder<T> createNodeBuilder(Class<T> clazz,
UaNodeBuilderConfiguration configuration)
Used to customize the node to be built more than what is possible with createInstance(java.lang.Class
UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration(); conf.addOptional(...); NodeBuildernb = createNodeBuilder(YourClass.class, conf); nb.setBrowseName(browseName); nb.setDisplayName(displayName); nb.setNodeId(newNodeId); YourClass instance = nb.build();
clazz - The class of the instance to build. It must have the TypeDefinitionId
annotation.configuration - The configuration to use for the builder.
UaInstantiationException - if the type node does not exist or it is invalid for
instantiation.createInstance(java.lang.Class, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText) public <T extends UaInstance> NodeBuilder<T> createNodeBuilder(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId)
typeDefinitionId - The ExpandedNodeId of the instantiated type.
UaInstantiationException - if the type node does not exist or it is invalid for
instantiation.createInstance(java.lang.Class, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText)
public <T extends UaInstance> NodeBuilder<T> createNodeBuilder(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeId,
UaNodeBuilderConfiguration configuration)
Used to customize the node to be built more than what is possible with createInstance(java.lang.Class
UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration(); conf.addOptional(...); NodeBuildernb = createNodeBuilder(typeDefinitionId, conf); nb.setBrowseName(browseName); nb.setDisplayName(displayName); nb.setNodeId(newNodeId); YourClass instance = nb.build();
typeDefinitionId - The ExpandedNodeId of the instantiated type.configuration - The configuration to use for the builder.
UaInstantiationException - if the type node does not exist or it is invalid for
instantiation.createInstance(java.lang.Class, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText) public <T extends UaInstance> NodeBuilder<T> createNodeBuilder(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId)
typeDefinitionId - The NodeId of the instantiated type.
UaInstantiationException - if the type node does not exist or it is invalid for
instantiation.createInstance(java.lang.Class, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText)
public <T extends UaInstance> NodeBuilder<T> createNodeBuilder(org.opcfoundation.ua.builtintypes.NodeId typeId,
UaNodeBuilderConfiguration configuration)
Used to customize the node to be built more than what is possible with createInstance(java.lang.Class
UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration(); conf.addOptional(...); NodeBuildernb = createNodeBuilder(typeDefinitionId, conf); nb.setBrowseName(browseName); nb.setDisplayName(displayName); nb.setNodeId(newNodeId); YourClass instance = nb.build();
typeDefinitionId - The NodeId of the instantiated type.configuration - The configuration to use for the builder.
UaInstantiationException - if the type node does not exist or it is invalid for
instantiation.createInstance(java.lang.Class, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText)
public org.opcfoundation.ua.builtintypes.NodeId createNodeId(UaNode parent,
org.opcfoundation.ua.builtintypes.QualifiedName name)
createNodeId(UaNode, QualifiedName, int)
public org.opcfoundation.ua.builtintypes.NodeId createNodeId(UaNode parent,
org.opcfoundation.ua.builtintypes.QualifiedName name,
int namespaceIndex)
parent - the parent node, must not be nullname - the name of the sub-nodenamespaceIndex - the namespacIndex to use for the NodeId
public org.opcfoundation.ua.builtintypes.NodeId createNodeId(UaNode parent,
String name)
parent - the parent node - must not be nullname - the name of the property, used for both BrowseName and DisplayName
public org.opcfoundation.ua.builtintypes.NodeId createNodeId(UaNode parent,
String name,
int namespaceIndex)
parent - the parent node - must not be nullname - the [Name] to append to the ID of the parentnamespaceIndex - the namespacIndex to use for the NodeId. If you omit it, the
namespaceIndex of the NodeManager is used.
public UaNode deleteNode(org.opcfoundation.ua.builtintypes.NodeId nodeId,
boolean deleteTargetReferences,
boolean deleteChildren)
throws StatusException
nodeId - the node to deletedeleteTargetReferences - whether to also delete references in which this node is the
targetdeleteChildren - whether to also remove all child nodes, i.e.those that are connected to
this node using a forward HasChild reference.
StatusException - if the deletion fails. Possible status codes: Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_UserAccessDenied, Bad_NoDeleteRights,
Uncertain_ReferenceNotDeleted
public UaNode deleteNode(UaNode node,
boolean deleteTargetReferences,
boolean deleteChildren)
throws StatusException
node - the node to delete, if null, null is returneddeleteTargetReferences - whether to also delete references in which this node is the
target. If this cannot be done, a StatusException(Uncertain_ReferenceNotDeleted) is
thrown.deleteChildren - whether to also remove all child nodes, i.e. those that are connected to
this node using a forward HasChild reference. The removal of children works for nodes
that are in the same NodeManager or on some other NodeManagerUaNode.
StatusException - if the deletion fails. Possible status codes: Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_UserAccessDenied, Bad_NoDeleteRights,
Uncertain_ReferenceNotDeleted
public void deleteReference(org.opcfoundation.ua.builtintypes.NodeId sourceNodeId,
org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
throws StatusException
sourceNodeId - the source node of the referencetargetNodeId - the target of the referencereferenceTypeId - reference type
StatusException - if targetNodeId refers to a local node, which does not exist
public void deleteReference(UaNode sourceNode,
org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
throws StatusException
sourceNode - the source node of the referencetargetNodeId - the target of the referencereferenceTypeId - reference type
StatusException - if targetNodeId refers to a local node, which does not exist
public void deleteReference(UaNode sourceNode,
UaNode targetNode,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
throws StatusException
sourceNode - the source node of the referencetargetNode - the target of the referencereferenceTypeId - reference type
StatusException - if targetNodeId refers to a local node, which does not existpublic UaNode findNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
NodeManagerNodeManager.supportsUaNode(). You
should use NodeManager.hasNode(org.opcfoundation.ua.builtintypes.NodeId) to check if the Node Manager has a node
findNode in class NodeManagernodeId - the nodeId to look for
ServiceManagerBase.getNode(NodeId)public IoManagerUaNode getIoManager()
getIoManager in class NodeManagerpublic UaNodeBuilderConfiguration getNodeBuilderConfiguration()
NodeBuilder configuration that this manager uses. NOTE! by default the
NodeManagerUaNode uses the configuration from
NodeManagerTable.getNodeBuilderConfiguration(), therefore unless this has been
overridden by calling
setNodeBuilderConfiguration(UaNodeBuilderConfiguration), this method
will return the configuration defined in NodeManagerTable.
public UaNodeFactory getNodeFactory()
public char getNodeIdDelimiter()
public String getNodeIdFormat()
public UaNode getNodeOrExternal(org.opcfoundation.ua.builtintypes.NodeId nodeId)
public NodeMap getNodes()
public UaType getType(org.opcfoundation.ua.builtintypes.NodeId typeId)
throws StatusException
typeId - the NodeId of the type
StatusException - if the node is not found
public org.opcfoundation.ua.builtintypes.NodeId getVariableDataType(org.opcfoundation.ua.builtintypes.NodeId nodeId,
UaValueNode variable)
throws StatusException
NodeManager
getVariableDataType in class NodeManagernodeId - The NodeId of the variable, whose data type is requested.variable - the variable or variableType node, if such exists
StatusExceptionpublic boolean hasNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
NodeManagerOverride in your own NodeManager to return true for your own nodes.
hasNode in class NodeManagerpublic void setNodeBuilderConfiguration(UaNodeBuilderConfiguration nodeBuilderConfiguration)
NodeBuilder configuration for this manager. NOTE! in most cases, it is
easier to override the configuration by calling
NodeManagerTable.setNodeBuilderConfiguration(UaNodeBuilderConfiguration), so it affects
all managers. Use this only when you need different configuration per manager. NOTE! calling
with null parameter resets this manager to default to the configuration defined in
NodeManagerTable.
nodeBuilderConfiguration - the nodeBuilderConfiguration to setpublic void setNodeFactory(UaNodeFactory nodeFactory)
nodeFactory - the nodeFactory to setpublic void setNodeIdDelimiter(char nodeIdDelimiter)
nodeIdDelimiter - the nodeIdDelimiter to setpublic boolean supportsUaNode()
NodeManagerChange in your own node manager, if you want to use UaNode. In that case, also consider inheriting your NodeManager from NodeManagerUaNode instead.
Note: If you define supportsUaNode = true, you must also implement
NodeManager.findNode(ExpandedNodeId)!
supportsUaNode in class NodeManagerUaNode objects are supported.
protected org.opcfoundation.ua.builtintypes.NodeId addNode(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.NodeId parentNodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.core.NodeClass nodeClass,
org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId,
org.opcfoundation.ua.core.NodeAttributes attributes,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
throws StatusException
NodeManager
addNode in class NodeManagerStatusException
protected void addReference(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.NodeId sourceNodeId,
org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isForward,
org.opcfoundation.ua.core.NodeClass targetNodeClass,
String targetServerUri)
throws StatusException
NodeManager
addReference in class NodeManagerStatusExceptionprotected void close()
NodeManager
close in class NodeManager
protected void createMonitoredDataItem(ServiceContext serviceContext,
Subscription subscription,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.utils.NumericRange indexRange,
org.opcfoundation.ua.core.MonitoringParameters params,
org.opcfoundation.ua.core.MonitoringFilter filter,
org.opcfoundation.ua.core.AggregateFilterResult filterResult,
org.opcfoundation.ua.core.MonitoringMode monitoringMode)
throws StatusException
NodeManager
createMonitoredDataItem in class NodeManagerserviceContext - the client calling contextsubscription - the subscription in which the item is being created.nodeId - the node ID: get the respective node from from the nodeManager.attributeId - the attribute ID: check from the node that it supports the attribute.indexRange - the index range specificationparams - the monitoring parametersfilter - an optional filter for the item. This may be a DataChangeFilter or
AggregateFilterResultfilterResult - results for the aggregateFilter, if such is providedmonitoringMode - the requested MonitoringMode
StatusException - if the node is invalid (Bad_NodeIdUnknown) or the attributeId is not
supported by the node (Bad_AttributeIdInvalid).
protected UaNode createNodeForAddNodesRequest(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.core.NodeClass nodeClass,
org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
protected UaNode createNodeForNodeSet2(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.core.NodeClass nodeClass,
org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
protected NodeMap createNodeMap()
protected void deleteNode(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
Boolean deleteTargetReferences)
throws StatusException
deleteNode in class NodeManagerStatusException
protected UaNode deleteNode(UaNode node,
boolean deleteTargetReferences,
boolean deleteChildren,
boolean doNotDeleteIfInverseHierarchicalRefs)
throws StatusException
StatusException
protected void deleteReference(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.NodeId sourceNodeId,
org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
Boolean isForward,
Boolean deleteBidirectional)
throws StatusException
deleteReference in class NodeManagerStatusException
protected org.opcfoundation.ua.builtintypes.QualifiedName getBrowseName(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
UaNode node)
NodeManagerNodeManagerUaNode implements the method by getting the BrowseName from the targetNode.
For custom NodeManagers this must be implemented.
getBrowseName in class NodeManagernodeId - the ID of the nodenode - the node, if it is a UaNode. May be null.
protected org.opcfoundation.ua.builtintypes.LocalizedText getDisplayName(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
UaNode node,
Locale locale)
NodeManagerNodeManagerUaNode implements the method by getting the DisplayName from the targetNode
For custom NodeManagers this must be implemented.
getDisplayName in class NodeManagernodeId - the ID of the nodelocale - The locale in which the name is requested. May be null.
protected UaNode getNode(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger errorCode)
throws StatusException
nodeId - the ID of the nodeerrorCode - The error code to return, instead of Bad_NodeIdUnknown, if the node is not
found
StatusException - if the node is not found or the ID is invalid
protected UaNode getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.UnsignedInteger errorCode)
throws StatusException
nodeId - the ID of the nodeerrorCode - The error code to return, instead of Bad_NodeIdUnknown, if the node is not
found
StatusException - if the node is not found or the ID is invalid
protected org.opcfoundation.ua.core.NodeClass getNodeClass(org.opcfoundation.ua.builtintypes.NodeId nodeId,
UaNode node)
NodeManagerNodeManager.findNodeClass(ExpandedNodeId, UaNode) to search for the NodeClass of any node,
possibly owned by some other NodeManager.
getNodeClass in class NodeManagernodeId - node -
protected UaReference[] getReferences(org.opcfoundation.ua.builtintypes.NodeId nodeId,
UaNode node)
NodeManager
getReferences in class NodeManagernodeId - the ID of the nodenode - the node object, if available
protected org.opcfoundation.ua.builtintypes.ExpandedNodeId getTypeDefinition(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
UaNode node)
NodeManagerNodeManagerUaNode implements the method by getting the TypeDefinitionId from the node.
For custom NodeManagers this must be implemented.
getTypeDefinition in class NodeManagernodeId - the ID of the nodenode - the node, if it is a UaNode. May be null.
protected void replaceExternalNode(UaExternalNode oldNode,
UaNode newNode)
throws StatusException
oldNode - newNode -
StatusExceptionprotected boolean requireUaNode()
requireUaNode in class ServiceManagerBase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||