public class DataTypeDictionaryManager extends Object implements org.eclipse.milo.opcua.sdk.server.Lifecycle
| Modifier and Type | Field and Description |
|---|---|
private org.eclipse.milo.opcua.sdk.server.nodes.UaNodeContext |
context |
private org.eclipse.milo.opcua.stack.core.types.OpcUaBinaryDataTypeDictionary |
dictionary |
private org.eclipse.milo.opcua.stack.core.util.Lazy<File> |
dictionaryFile |
private org.eclipse.milo.opcua.sdk.server.model.nodes.variables.DataTypeDictionaryTypeNode |
dictionaryNode |
private Map<org.eclipse.milo.opcua.stack.core.types.builtin.NodeId,org.eclipse.milo.opcua.stack.core.types.structured.EnumDescription> |
enumDescriptions |
private org.slf4j.Logger |
logger |
private String |
namespaceUri |
private List<org.eclipse.milo.opcua.sdk.server.nodes.UaNode> |
nodes |
private Map<org.eclipse.milo.opcua.stack.core.types.builtin.NodeId,org.eclipse.milo.opcua.stack.core.types.structured.StructureDescription> |
structureDescriptions |
| Constructor and Description |
|---|
DataTypeDictionaryManager(org.eclipse.milo.opcua.sdk.server.nodes.UaNodeContext context,
String namespaceUri)
Create a BinaryDataTypeDictionaryManager for an
OpcUaBinaryDataTypeDictionary in namespaceUri. |
| Modifier and Type | Method and Description |
|---|---|
private void |
addNode(org.eclipse.milo.opcua.sdk.server.nodes.UaNode node)
Add
node to the UaNodeManager and our own bookkeeping so it can be deleted during shutdown. |
org.eclipse.milo.opcua.stack.core.types.OpcUaBinaryDataTypeDictionary |
getDictionary()
Returns the dictionary.
|
private org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UShort |
getNamespaceIndex()
Returns the namespace index of the namespace URI.
|
private org.eclipse.milo.opcua.sdk.server.nodes.UaNodeContext |
getNodeContext()
Returns the node context.
|
private org.eclipse.milo.opcua.sdk.server.UaNodeManager |
getNodeManager()
Returns the node manager.
|
private static org.eclipse.milo.opcua.binaryschema.generator.DataTypeDictionaryGenerator |
newDictionaryGenerator(String namespaceUri,
org.eclipse.milo.opcua.sdk.server.api.AddressSpaceManager addressSpaceManager)
Creates a new dictionary generator.
|
private org.eclipse.milo.opcua.stack.core.types.builtin.NodeId |
newNodeId(String id)
Returns a new node identification[factory].
|
private org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName |
newQualifiedName(String name)
Returns a new qualified name [factory].
|
void |
registerEnumCodec(org.eclipse.milo.opcua.stack.core.serialization.codecs.OpcUaBinaryDataTypeCodec<?> codec,
String description,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId)
Registers an enum codec.
|
void |
registerEnumDescription(org.eclipse.milo.opcua.stack.core.types.structured.EnumDescription description)
Registers an enumeration description.
|
void |
registerOptionSetCodec(org.eclipse.milo.opcua.stack.core.serialization.codecs.OpcUaBinaryDataTypeCodec<?> codec,
String description,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId binaryEncodingId)
Registers an option set codec.
|
void |
registerStructureCodec(org.eclipse.milo.opcua.stack.core.serialization.codecs.OpcUaBinaryDataTypeCodec<?> codec,
String description,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId binaryEncodingId)
Registers a structure codec.
|
void |
registerStructureCodec(org.eclipse.milo.opcua.stack.core.serialization.codecs.OpcUaBinaryDataTypeCodec<?> codec,
String description,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId binaryEncodingId,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId parentType)
Registers a structure codec.
|
void |
registerStructureDescription(org.eclipse.milo.opcua.stack.core.types.structured.StructureDescription description,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId binaryEncodingId)
Registeres a structure description.
|
void |
registerUnionCodec(org.eclipse.milo.opcua.stack.core.serialization.codecs.OpcUaBinaryDataTypeCodec<?> codec,
String description,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId binaryEncodingId)
Registers a union codec.
|
void |
shutdown() |
void |
startup() |
private File |
writeDictionaryToFile()
Writes the dictionary to a file.
|
private byte[] |
writeDictionaryToMemory()
Writes the dictionary to memory.
|
private void |
writeDictionaryToStream(OutputStream outputStream)
Writes the dictionary to a stream.
|
private final org.slf4j.Logger logger
private final List<org.eclipse.milo.opcua.sdk.server.nodes.UaNode> nodes
private final org.eclipse.milo.opcua.stack.core.util.Lazy<File> dictionaryFile
private final Map<org.eclipse.milo.opcua.stack.core.types.builtin.NodeId,org.eclipse.milo.opcua.stack.core.types.structured.EnumDescription> enumDescriptions
private final Map<org.eclipse.milo.opcua.stack.core.types.builtin.NodeId,org.eclipse.milo.opcua.stack.core.types.structured.StructureDescription> structureDescriptions
private final org.eclipse.milo.opcua.stack.core.types.OpcUaBinaryDataTypeDictionary dictionary
private org.eclipse.milo.opcua.sdk.server.model.nodes.variables.DataTypeDictionaryTypeNode dictionaryNode
private final org.eclipse.milo.opcua.sdk.server.nodes.UaNodeContext context
private final String namespaceUri
public DataTypeDictionaryManager(org.eclipse.milo.opcua.sdk.server.nodes.UaNodeContext context,
String namespaceUri)
OpcUaBinaryDataTypeDictionary in namespaceUri.
Note that the namespace URI is that of the dictionary, and is not necessarily the same as the namespace the Nodes created by the manager will reside in, i.e. datatype dictionaries are namespaced independently from the namespaces server Nodes reside in.
context - a UaNodeContext. Nodes will be created and added using this context.namespaceUri - the namespace URI of the dictionary.private org.eclipse.milo.opcua.sdk.server.nodes.UaNodeContext getNodeContext()
private org.eclipse.milo.opcua.sdk.server.UaNodeManager getNodeManager()
public void startup()
startup in interface org.eclipse.milo.opcua.sdk.server.Lifecyclepublic void shutdown()
shutdown in interface org.eclipse.milo.opcua.sdk.server.Lifecyclepublic org.eclipse.milo.opcua.stack.core.types.OpcUaBinaryDataTypeDictionary getDictionary()
public void registerEnumCodec(org.eclipse.milo.opcua.stack.core.serialization.codecs.OpcUaBinaryDataTypeCodec<?> codec,
String description,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId)
codec - the codecdescription - the description of the structuredataTypeId - the data type identificationregisterStructureCodec(OpcUaBinaryDataTypeCodec, String, NodeId, NodeId, NodeId)public void registerEnumDescription(org.eclipse.milo.opcua.stack.core.types.structured.EnumDescription description)
description - the description of the enumpublic void registerOptionSetCodec(org.eclipse.milo.opcua.stack.core.serialization.codecs.OpcUaBinaryDataTypeCodec<?> codec,
String description,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId binaryEncodingId)
codec - the codecdescription - the description of the structuredataTypeId - the data type identificationbinaryEncodingId - the binary encoding idregisterStructureCodec(OpcUaBinaryDataTypeCodec, String, NodeId, NodeId, NodeId)public void registerStructureCodec(org.eclipse.milo.opcua.stack.core.serialization.codecs.OpcUaBinaryDataTypeCodec<?> codec,
String description,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId binaryEncodingId)
codec - the codecdescription - the description of the structuredataTypeId - the data type identificationbinaryEncodingId - the binary encoding idregisterStructureCodec(OpcUaBinaryDataTypeCodec, String, NodeId, NodeId, NodeId)public void registerUnionCodec(org.eclipse.milo.opcua.stack.core.serialization.codecs.OpcUaBinaryDataTypeCodec<?> codec,
String description,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId binaryEncodingId)
codec - the codecdescription - the description of the structuredataTypeId - the data type identificationbinaryEncodingId - the binary encoding idregisterStructureCodec(OpcUaBinaryDataTypeCodec, String, NodeId, NodeId, NodeId)public void registerStructureCodec(org.eclipse.milo.opcua.stack.core.serialization.codecs.OpcUaBinaryDataTypeCodec<?> codec,
String description,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId binaryEncodingId,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId parentType)
codec - the codecdescription - the description of the structuredataTypeId - the data type identificationbinaryEncodingId - the binary encoding idparentType - the parent typepublic void registerStructureDescription(org.eclipse.milo.opcua.stack.core.types.structured.StructureDescription description,
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId binaryEncodingId)
description - the structure descriptionbinaryEncodingId - the node ID for binary encodingsprivate File writeDictionaryToFile() throws IOException
IOException - if writing failsprivate byte[] writeDictionaryToMemory()
throws IOException
IOException - if writing failsprivate void writeDictionaryToStream(OutputStream outputStream) throws IOException
outputStream - the stream to write toIOException - if writing failsprivate org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UShort getNamespaceIndex()
private org.eclipse.milo.opcua.stack.core.types.builtin.NodeId newNodeId(String id)
id - the id to be turned into a node idprivate org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName newQualifiedName(String name)
name - the name to be turned into a qualified nameprivate void addNode(org.eclipse.milo.opcua.sdk.server.nodes.UaNode node)
node to the UaNodeManager and our own bookkeeping so it can be deleted during shutdown.node - the UaNode to add.private static org.eclipse.milo.opcua.binaryschema.generator.DataTypeDictionaryGenerator newDictionaryGenerator(String namespaceUri, org.eclipse.milo.opcua.sdk.server.api.AddressSpaceManager addressSpaceManager)
namespaceUri - the namespace URIaddressSpaceManager - the address space managerCopyright © 2022. All rights reserved.