aliasTable,
553 | NamespaceTable currentNamespaceTable,
554 | NamespaceTable originalNamespaceTable
555 | ) {
556 |
557 | QualifiedName newName = reindex(
558 | QualifiedName.parse(field.getName()),
559 | currentNamespaceTable,
560 | originalNamespaceTable
561 | );
562 | field.setName(newName.toParseableString());
563 |
564 | String dataType = field.getDataType();
565 | if (dataType != null) {
566 | NodeId nodeId = aliasTable.get(dataType);
567 | if (nodeId == null) nodeId = NodeId.parse(dataType);
568 | NodeId newDataType = reindex(
569 | nodeId,
570 | currentNamespaceTable,
571 | originalNamespaceTable
572 | );
573 | field.setDataType(newDataType.toParseableString());
574 | }
575 |
576 | DataTypeDefinition innerDefinition = field.getDefinition();
577 | if (innerDefinition != null) {
578 | reindex(innerDefinition, aliasTable, currentNamespaceTable, originalNamespaceTable);
579 | }
580 | }
581 |
582 | /**
583 | * Re-indexes a {@link DataValue} if necessary.
584 | *
585 | * If {@code value} contains an ExtensionObject the encodingId is re-indexed. Then the struct is decoded and any
586 | * fields that qualify are also re-indexed (e.g. the dataType field in {@link Argument}).
587 | *
588 | * This is verging on major hack because the OPC UA modelling concept is somewhat flawed when it comes to encoding
589 | * embedded values that reference non-absolute namespaces.
590 | *
591 | * @param value the {@link DataValue} to re-index.
592 | * @return a {@link DataValue} that has been re-indexed for the current server.
593 | */
594 | private static DataValue reindex(
595 | DataValue value,
596 | NamespaceTable currentNamespaceTable,
597 | NamespaceTable originalNamespaceTable
598 | ) {
599 |
600 | try {
601 | if (value == null) return null;
602 | Variant variant = value.getValue();
603 | if (variant == null) return value;
604 | Object o = variant.getValue();
605 | if (o == null) return value;
606 | return new DataValue(new Variant(reindexValue(o, currentNamespaceTable, originalNamespaceTable)));
607 | } catch (Throwable t) {
608 | LOGGER.warn("Re-indexing failed: {}", value, t);
609 | return value;
610 | }
611 | }
612 |
613 | private static Object reindexValue(
614 | Object value,
615 | NamespaceTable currentNamespaceTable,
616 | NamespaceTable originalNamespaceTable
617 | ) {
618 |
619 | if (value == null) return null;
620 |
621 | Class> clazz = value.getClass();
622 |
623 | if (clazz.isArray()) {
624 | @SuppressWarnings("rawtypes")
625 | Class componentType = ArrayUtil.getType(value);
626 |
627 | if (componentType != NodeId.class
628 | && componentType != ExpandedNodeId.class
629 | && componentType != QualifiedName.class
630 | && componentType != ExtensionObject.class
631 | ) {
632 |
633 | return value;
634 | } else {
635 | //noinspection unchecked
636 | return ArrayUtil.transformArray(
637 | value,
638 | o -> reindexValue(o, currentNamespaceTable, originalNamespaceTable),
639 | componentType
640 | );
641 | }
642 | } else {
643 | if (clazz == NodeId.class) {
644 | return reindex((NodeId) value, currentNamespaceTable, originalNamespaceTable);
645 | } else if (clazz == ExpandedNodeId.class) {
646 | return reindex((ExpandedNodeId) value, currentNamespaceTable, originalNamespaceTable);
647 | } else if (clazz == QualifiedName.class) {
648 | return reindex((QualifiedName) value, currentNamespaceTable, originalNamespaceTable);
649 | } else if (clazz == ExtensionObject.class) {
650 | ExtensionObject xo = (ExtensionObject) value;
651 |
652 | if (xo.getBodyType() == ExtensionObject.BodyType.ByteString) {
653 | xo = new ExtensionObject(
654 | (ByteString) xo.getBody(),
655 | reindex(xo.getEncodingId(), currentNamespaceTable, originalNamespaceTable)
656 | );
657 | } else if (xo.getBodyType() == ExtensionObject.BodyType.XmlElement) {
658 | xo = new ExtensionObject(
659 | (XmlElement) xo.getBody(),
660 | reindex(xo.getEncodingId(), currentNamespaceTable, originalNamespaceTable)
661 | );
662 | }
663 |
664 | try {
665 | Object struct = xo.decode(SERIALIZATION_CONTEXT);
666 |
667 | if (struct instanceof Argument) {
668 | Argument argument = (Argument) struct;
669 |
670 | return ExtensionObject.encode(
671 | SERIALIZATION_CONTEXT,
672 | new Argument(
673 | argument.getName(),
674 | reindex(argument.getDataType(), currentNamespaceTable, originalNamespaceTable),
675 | argument.getValueRank(),
676 | argument.getArrayDimensions(),
677 | argument.getDescription()
678 | )
679 | );
680 | } else {
681 | return xo;
682 | }
683 | } catch (Throwable t) {
684 | LOGGER.warn("Decoding failed: {}", xo, t);
685 | return xo;
686 | }
687 | } else {
688 | return value;
689 | }
690 | }
691 | }
692 |
693 | /**
694 | * A default {@link SerializationContext} that can be used to decode OPC UA built-in types.
695 | */
696 | private static final SerializationContext SERIALIZATION_CONTEXT = new SerializationContext() {
697 |
698 | private final NamespaceTable namespaceTable = new NamespaceTable();
699 |
700 | @Override
701 | public EncodingLimits getEncodingLimits() {
702 | return EncodingLimits.DEFAULT;
703 | }
704 |
705 | @Override
706 | public NamespaceTable getNamespaceTable() {
707 | return namespaceTable;
708 | }
709 |
710 | @Override
711 | public DataTypeManager getDataTypeManager() {
712 | return OpcUaDataTypeManager.getInstance();
713 | }
714 |
715 | };
716 |
717 | }
718 |
--------------------------------------------------------------------------------
/src/main/java/com/digitalpetri/opcua/nodeset/attributes/DataTypeNodeAttributes.java:
--------------------------------------------------------------------------------
1 | package com.digitalpetri.opcua.nodeset.attributes;
2 |
3 | import org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText;
4 | import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
5 | import org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName;
6 | import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
7 | import org.eclipse.milo.opcua.stack.core.types.enumerated.NodeClass;
8 | import org.opcfoundation.ua.generated.UADataType;
9 |
10 | import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint;
11 |
12 | public class DataTypeNodeAttributes extends NodeAttributes {
13 |
14 | private final boolean isAbstract;
15 |
16 | public DataTypeNodeAttributes(
17 | NodeId nodeId,
18 | QualifiedName browseName,
19 | LocalizedText displayName,
20 | LocalizedText description,
21 | UInteger writeMask,
22 | UInteger userWriteMask,
23 | boolean isAbstract
24 | ) {
25 |
26 | super(nodeId, NodeClass.DataType, browseName, displayName, description, writeMask, userWriteMask);
27 |
28 | this.isAbstract = isAbstract;
29 | }
30 |
31 | public boolean isAbstract() {
32 | return isAbstract;
33 | }
34 |
35 | @Override
36 | public String toString() {
37 | return "DataTypeNodeAttributes{" +
38 | "isAbstract=" + isAbstract +
39 | "} " + super.toString();
40 | }
41 |
42 | public static DataTypeNodeAttributes fromGenerated(UADataType gNode) {
43 | NodeId nodeId = NodeId.parse(gNode.getNodeId());
44 | QualifiedName browseName = QualifiedName.parse(gNode.getBrowseName());
45 |
46 | LocalizedText displayName = gNode.getDisplayName().stream()
47 | .findFirst()
48 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
49 | .orElse(LocalizedText.english(browseName.getName()));
50 |
51 | LocalizedText description = gNode.getDescription().stream()
52 | .findFirst()
53 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
54 | .orElse(LocalizedText.NULL_VALUE);
55 |
56 | UInteger writeMask = uint(gNode.getWriteMask());
57 | UInteger userWriteMask = uint(gNode.getUserWriteMask());
58 |
59 | boolean isAbstract = gNode.isIsAbstract();
60 |
61 | return new DataTypeNodeAttributes(
62 | nodeId,
63 | browseName,
64 | displayName,
65 | description,
66 | writeMask,
67 | userWriteMask,
68 | isAbstract
69 | );
70 | }
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/src/main/java/com/digitalpetri/opcua/nodeset/attributes/MethodNodeAttributes.java:
--------------------------------------------------------------------------------
1 | package com.digitalpetri.opcua.nodeset.attributes;
2 |
3 | import org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText;
4 | import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
5 | import org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName;
6 | import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
7 | import org.eclipse.milo.opcua.stack.core.types.enumerated.NodeClass;
8 | import org.opcfoundation.ua.generated.UAMethod;
9 |
10 | import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint;
11 |
12 | public class MethodNodeAttributes extends NodeAttributes {
13 |
14 | private final boolean executable;
15 | private final boolean userExecutable;
16 |
17 | public MethodNodeAttributes(
18 | NodeId nodeId,
19 | QualifiedName browseName,
20 | LocalizedText displayName,
21 | LocalizedText description,
22 | UInteger writeMask,
23 | UInteger userWriteMask,
24 | boolean executable,
25 | boolean userExecutable
26 | ) {
27 |
28 | super(nodeId, NodeClass.Method, browseName, displayName, description, writeMask, userWriteMask);
29 |
30 | this.executable = executable;
31 | this.userExecutable = userExecutable;
32 | }
33 |
34 | public boolean isExecutable() {
35 | return executable;
36 | }
37 |
38 | public boolean isUserExecutable() {
39 | return userExecutable;
40 | }
41 |
42 | @Override
43 | public String toString() {
44 | return "MethodNodeAttributes{" +
45 | "executable=" + executable +
46 | ", userExecutable=" + userExecutable +
47 | "} " + super.toString();
48 | }
49 |
50 | public static MethodNodeAttributes fromGenerated(UAMethod gNode) {
51 | NodeId nodeId = NodeId.parse(gNode.getNodeId());
52 | QualifiedName browseName = QualifiedName.parse(gNode.getBrowseName());
53 |
54 | LocalizedText displayName = gNode.getDisplayName().stream()
55 | .findFirst()
56 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
57 | .orElse(LocalizedText.english(browseName.getName()));
58 |
59 | LocalizedText description = gNode.getDescription().stream()
60 | .findFirst()
61 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
62 | .orElse(LocalizedText.NULL_VALUE);
63 |
64 | UInteger writeMask = uint(gNode.getWriteMask());
65 | UInteger userWriteMask = uint(gNode.getUserWriteMask());
66 |
67 | boolean executable = gNode.isExecutable();
68 | boolean userExecutable = gNode.isUserExecutable();
69 |
70 | return new MethodNodeAttributes(
71 | nodeId,
72 | browseName,
73 | displayName,
74 | description,
75 | writeMask,
76 | userWriteMask,
77 | executable,
78 | userExecutable
79 | );
80 | }
81 |
82 | }
83 |
--------------------------------------------------------------------------------
/src/main/java/com/digitalpetri/opcua/nodeset/attributes/NodeAttributes.java:
--------------------------------------------------------------------------------
1 | package com.digitalpetri.opcua.nodeset.attributes;
2 |
3 | import org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText;
4 | import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
5 | import org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName;
6 | import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
7 | import org.eclipse.milo.opcua.stack.core.types.enumerated.NodeClass;
8 |
9 | public abstract class NodeAttributes {
10 |
11 | private final NodeId nodeId;
12 | private final NodeClass nodeClass;
13 | private final QualifiedName browseName;
14 | private final LocalizedText displayName;
15 | private final LocalizedText description;
16 | private final UInteger writeMask;
17 | private final UInteger userWriteMask;
18 |
19 | public NodeAttributes(
20 | NodeId nodeId,
21 | NodeClass nodeClass,
22 | QualifiedName browseName,
23 | LocalizedText displayName,
24 | LocalizedText description,
25 | UInteger writeMask,
26 | UInteger userWriteMask
27 | ) {
28 |
29 | this.nodeId = nodeId;
30 | this.nodeClass = nodeClass;
31 | this.browseName = browseName;
32 | this.displayName = displayName;
33 | this.description = description;
34 | this.writeMask = writeMask;
35 | this.userWriteMask = userWriteMask;
36 | }
37 |
38 | public NodeId getNodeId() {
39 | return nodeId;
40 | }
41 |
42 | public NodeClass getNodeClass() {
43 | return nodeClass;
44 | }
45 |
46 | public QualifiedName getBrowseName() {
47 | return browseName;
48 | }
49 |
50 | public LocalizedText getDisplayName() {
51 | return displayName;
52 | }
53 |
54 | public LocalizedText getDescription() {
55 | return description;
56 | }
57 |
58 | public UInteger getWriteMask() {
59 | return writeMask;
60 | }
61 |
62 | public UInteger getUserWriteMask() {
63 | return userWriteMask;
64 | }
65 |
66 | @Override
67 | public String toString() {
68 | return "NodeAttributes{" +
69 | "nodeId=" + nodeId +
70 | ", nodeClass=" + nodeClass +
71 | ", browseName=" + browseName +
72 | ", displayName=" + displayName +
73 | ", description=" + description +
74 | ", writeMask=" + writeMask +
75 | ", userWriteMask=" + userWriteMask +
76 | '}';
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/src/main/java/com/digitalpetri/opcua/nodeset/attributes/ObjectNodeAttributes.java:
--------------------------------------------------------------------------------
1 | package com.digitalpetri.opcua.nodeset.attributes;
2 |
3 | import org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText;
4 | import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
5 | import org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName;
6 | import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UByte;
7 | import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
8 | import org.eclipse.milo.opcua.stack.core.types.enumerated.NodeClass;
9 | import org.opcfoundation.ua.generated.UAObject;
10 |
11 | import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ubyte;
12 | import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint;
13 |
14 | public class ObjectNodeAttributes extends NodeAttributes {
15 |
16 | private final UByte eventNotifier;
17 |
18 | public ObjectNodeAttributes(
19 | NodeId nodeId,
20 | QualifiedName browseName,
21 | LocalizedText displayName,
22 | LocalizedText description,
23 | UInteger writeMask,
24 | UInteger userWriteMask,
25 | UByte eventNotifier
26 | ) {
27 |
28 | super(nodeId, NodeClass.Object, browseName, displayName, description, writeMask, userWriteMask);
29 |
30 | this.eventNotifier = eventNotifier;
31 | }
32 |
33 | public UByte getEventNotifier() {
34 | return eventNotifier;
35 | }
36 |
37 | @Override
38 | public String toString() {
39 | return "ObjectNodeAttributes{" +
40 | "eventNotifier=" + eventNotifier +
41 | "} " + super.toString();
42 | }
43 |
44 | public static ObjectNodeAttributes fromGenerated(UAObject gNode) {
45 | NodeId nodeId = NodeId.parse(gNode.getNodeId());
46 | QualifiedName browseName = QualifiedName.parse(gNode.getBrowseName());
47 |
48 | LocalizedText displayName = gNode.getDisplayName().stream()
49 | .findFirst()
50 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
51 | .orElse(LocalizedText.english(browseName.getName()));
52 |
53 | LocalizedText description = gNode.getDescription().stream()
54 | .findFirst()
55 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
56 | .orElse(LocalizedText.NULL_VALUE);
57 |
58 | UInteger writeMask = uint(gNode.getWriteMask());
59 | UInteger userWriteMask = uint(gNode.getUserWriteMask());
60 |
61 | UByte eventNotifier = ubyte(gNode.getEventNotifier());
62 |
63 | return new ObjectNodeAttributes(
64 | nodeId,
65 | browseName,
66 | displayName,
67 | description,
68 | writeMask,
69 | userWriteMask,
70 | eventNotifier
71 | );
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/src/main/java/com/digitalpetri/opcua/nodeset/attributes/ObjectTypeNodeAttributes.java:
--------------------------------------------------------------------------------
1 | package com.digitalpetri.opcua.nodeset.attributes;
2 |
3 | import org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText;
4 | import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
5 | import org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName;
6 | import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
7 | import org.eclipse.milo.opcua.stack.core.types.enumerated.NodeClass;
8 | import org.opcfoundation.ua.generated.UAObjectType;
9 |
10 | import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint;
11 |
12 | public class ObjectTypeNodeAttributes extends NodeAttributes {
13 |
14 | private final boolean isAbstract;
15 |
16 | public ObjectTypeNodeAttributes(
17 | NodeId nodeId,
18 | QualifiedName browseName,
19 | LocalizedText displayName,
20 | LocalizedText description,
21 | UInteger writeMask,
22 | UInteger userWriteMask,
23 | boolean isAbstract
24 | ) {
25 |
26 | super(nodeId, NodeClass.ObjectType, browseName, displayName, description, writeMask, userWriteMask);
27 |
28 | this.isAbstract = isAbstract;
29 | }
30 |
31 | public boolean isAbstract() {
32 | return isAbstract;
33 | }
34 |
35 | @Override
36 | public String toString() {
37 | return "ObjectTypeNodeAttributes{" +
38 | "isAbstract=" + isAbstract +
39 | "} " + super.toString();
40 | }
41 |
42 | public static ObjectTypeNodeAttributes fromGenerated(UAObjectType gNode) {
43 | NodeId nodeId = NodeId.parse(gNode.getNodeId());
44 | QualifiedName browseName = QualifiedName.parse(gNode.getBrowseName());
45 |
46 | LocalizedText displayName = gNode.getDisplayName().stream()
47 | .findFirst()
48 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
49 | .orElse(LocalizedText.english(browseName.getName()));
50 |
51 | LocalizedText description = gNode.getDescription().stream()
52 | .findFirst()
53 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
54 | .orElse(LocalizedText.NULL_VALUE);
55 |
56 | UInteger writeMask = uint(gNode.getWriteMask());
57 | UInteger userWriteMask = uint(gNode.getUserWriteMask());
58 |
59 | boolean isAbstract = gNode.isIsAbstract();
60 |
61 | return new ObjectTypeNodeAttributes(
62 | nodeId,
63 | browseName,
64 | displayName,
65 | description,
66 | writeMask,
67 | userWriteMask,
68 | isAbstract
69 | );
70 | }
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/src/main/java/com/digitalpetri/opcua/nodeset/attributes/ReferenceTypeNodeAttributes.java:
--------------------------------------------------------------------------------
1 | package com.digitalpetri.opcua.nodeset.attributes;
2 |
3 | import org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText;
4 | import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
5 | import org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName;
6 | import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
7 | import org.eclipse.milo.opcua.stack.core.types.enumerated.NodeClass;
8 | import org.opcfoundation.ua.generated.UAReferenceType;
9 |
10 | import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint;
11 |
12 | public class ReferenceTypeNodeAttributes extends NodeAttributes {
13 |
14 | private final boolean isAbstract;
15 | private final boolean symmetric;
16 | private final LocalizedText inverseName;
17 |
18 | public ReferenceTypeNodeAttributes(
19 | NodeId nodeId,
20 | QualifiedName browseName,
21 | LocalizedText displayName,
22 | LocalizedText description,
23 | UInteger writeMask,
24 | UInteger userWriteMask,
25 | boolean isAbstract,
26 | boolean symmetric,
27 | LocalizedText inverseName
28 | ) {
29 |
30 | super(nodeId, NodeClass.ReferenceType, browseName, displayName, description, writeMask, userWriteMask);
31 |
32 | this.isAbstract = isAbstract;
33 | this.symmetric = symmetric;
34 | this.inverseName = inverseName;
35 | }
36 |
37 | public boolean isAbstract() {
38 | return isAbstract;
39 | }
40 |
41 | public boolean isSymmetric() {
42 | return symmetric;
43 | }
44 |
45 | public LocalizedText getInverseName() {
46 | return inverseName;
47 | }
48 |
49 | @Override
50 | public String toString() {
51 | return "ReferenceTypeNodeAttributes{" +
52 | "isAbstract=" + isAbstract +
53 | ", symmetric=" + symmetric +
54 | ", inverseName=" + inverseName +
55 | "} " + super.toString();
56 | }
57 |
58 | public static ReferenceTypeNodeAttributes fromGenerated(UAReferenceType gNode) {
59 | NodeId nodeId = NodeId.parse(gNode.getNodeId());
60 | QualifiedName browseName = QualifiedName.parse(gNode.getBrowseName());
61 |
62 | LocalizedText displayName = gNode.getDisplayName().stream()
63 | .findFirst()
64 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
65 | .orElse(LocalizedText.english(browseName.getName()));
66 |
67 | LocalizedText description = gNode.getDescription().stream()
68 | .findFirst()
69 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
70 | .orElse(LocalizedText.NULL_VALUE);
71 |
72 | UInteger writeMask = uint(gNode.getWriteMask());
73 | UInteger userWriteMask = uint(gNode.getUserWriteMask());
74 |
75 | boolean isAbstract = gNode.isIsAbstract();
76 | boolean symmetric = gNode.isSymmetric();
77 |
78 | LocalizedText inverseName = gNode.getInverseName().stream()
79 | .findFirst()
80 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
81 | .orElse(LocalizedText.NULL_VALUE);
82 |
83 | return new ReferenceTypeNodeAttributes(
84 | nodeId,
85 | browseName,
86 | displayName,
87 | description,
88 | writeMask,
89 | userWriteMask,
90 | isAbstract,
91 | symmetric,
92 | inverseName
93 | );
94 | }
95 |
96 | }
97 |
--------------------------------------------------------------------------------
/src/main/java/com/digitalpetri/opcua/nodeset/attributes/VariableNodeAttributes.java:
--------------------------------------------------------------------------------
1 | package com.digitalpetri.opcua.nodeset.attributes;
2 |
3 | import java.util.Arrays;
4 | import java.util.Map;
5 | import javax.xml.bind.Marshaller;
6 |
7 | import com.digitalpetri.opcua.nodeset.util.AttributeUtil;
8 | import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
9 | import org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText;
10 | import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
11 | import org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName;
12 | import org.eclipse.milo.opcua.stack.core.types.builtin.Variant;
13 | import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UByte;
14 | import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
15 | import org.eclipse.milo.opcua.stack.core.types.enumerated.NodeClass;
16 | import org.opcfoundation.ua.generated.UAVariable;
17 |
18 | import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ubyte;
19 | import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint;
20 |
21 | public class VariableNodeAttributes extends NodeAttributes {
22 |
23 | private final DataValue value;
24 | private final NodeId dataType;
25 | private final int valueRank;
26 | private final UInteger[] arrayDimensions;
27 | private final UByte accessLevel;
28 | private final UByte userAccessLevel;
29 | private final Double minimumSamplingInterval;
30 | private final boolean historizing;
31 |
32 | public VariableNodeAttributes(
33 | NodeId nodeId,
34 | QualifiedName browseName,
35 | LocalizedText displayName,
36 | LocalizedText description,
37 | UInteger writeMask,
38 | UInteger userWriteMask,
39 | DataValue value,
40 | NodeId dataType,
41 | int valueRank,
42 | UInteger[] arrayDimensions,
43 | UByte accessLevel,
44 | UByte userAccessLevel,
45 | Double minimumSamplingInterval,
46 | boolean historizing
47 | ) {
48 |
49 | super(nodeId, NodeClass.Variable, browseName, displayName, description, writeMask, userWriteMask);
50 |
51 | this.value = value;
52 | this.dataType = dataType;
53 | this.valueRank = valueRank;
54 | this.arrayDimensions = arrayDimensions;
55 | this.accessLevel = accessLevel;
56 | this.userAccessLevel = userAccessLevel;
57 | this.minimumSamplingInterval = minimumSamplingInterval;
58 | this.historizing = historizing;
59 | }
60 |
61 | public DataValue getValue() {
62 | return value;
63 | }
64 |
65 | public NodeId getDataType() {
66 | return dataType;
67 | }
68 |
69 | public int getValueRank() {
70 | return valueRank;
71 | }
72 |
73 | public UInteger[] getArrayDimensions() {
74 | return arrayDimensions;
75 | }
76 |
77 | public UByte getAccessLevel() {
78 | return accessLevel;
79 | }
80 |
81 | public UByte getUserAccessLevel() {
82 | return userAccessLevel;
83 | }
84 |
85 | public Double getMinimumSamplingInterval() {
86 | return minimumSamplingInterval;
87 | }
88 |
89 | public boolean isHistorizing() {
90 | return historizing;
91 | }
92 |
93 | @Override
94 | public String toString() {
95 | return "VariableNodeAttributes{" +
96 | "value=" + value +
97 | ", dataType=" + dataType +
98 | ", valueRank=" + valueRank +
99 | ", arrayDimensions=" + Arrays.toString(arrayDimensions) +
100 | ", accessLevel=" + accessLevel +
101 | ", userAccessLevel=" + userAccessLevel +
102 | ", minimumSamplingInterval=" + minimumSamplingInterval +
103 | ", historizing=" + historizing +
104 | "} " + super.toString();
105 | }
106 |
107 | public static VariableNodeAttributes fromGenerated(
108 | UAVariable gNode,
109 | Marshaller marshaller,
110 | Map aliasMap,
111 | Map rawXmlValues
112 | ) {
113 |
114 | NodeId nodeId = NodeId.parse(gNode.getNodeId());
115 | QualifiedName browseName = QualifiedName.parse(gNode.getBrowseName());
116 |
117 | LocalizedText displayName = gNode.getDisplayName().stream()
118 | .findFirst()
119 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
120 | .orElse(LocalizedText.english(browseName.getName()));
121 |
122 | LocalizedText description = gNode.getDescription().stream()
123 | .findFirst()
124 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
125 | .orElse(LocalizedText.NULL_VALUE);
126 |
127 | UInteger writeMask = uint(gNode.getWriteMask());
128 | UInteger userWriteMask = uint(gNode.getUserWriteMask());
129 |
130 | DataValue value = value(gNode.getValue(), marshaller, nodeId, rawXmlValues);
131 | NodeId dataType = AttributeUtil.parseDataType(gNode.getDataType(), aliasMap);
132 | int valueRank = gNode.getValueRank();
133 | UInteger[] arrayDimensions = AttributeUtil.parseArrayDimensions(gNode.getArrayDimensions());
134 | UByte accessLevel = ubyte(gNode.getAccessLevel());
135 | UByte userAccessLevel = ubyte(gNode.getUserAccessLevel());
136 | Double minimumSamplingInterval = gNode.getMinimumSamplingInterval();
137 | boolean historizing = gNode.isHistorizing();
138 |
139 | return new VariableNodeAttributes(
140 | nodeId,
141 | browseName,
142 | displayName,
143 | description,
144 | writeMask,
145 | userWriteMask,
146 | value,
147 | dataType,
148 | valueRank,
149 | arrayDimensions,
150 | accessLevel,
151 | userAccessLevel,
152 | minimumSamplingInterval,
153 | historizing
154 | );
155 | }
156 |
157 | private static DataValue value(
158 | UAVariable.Value gValue,
159 | Marshaller marshaller,
160 | NodeId nodeId,
161 | Map rawXmlValues
162 | ) {
163 |
164 | if (gValue == null || gValue.getAny() == null) {
165 | return new DataValue(Variant.NULL_VALUE);
166 | }
167 |
168 | return AttributeUtil.parseValue(gValue.getAny(), marshaller, nodeId, rawXmlValues);
169 | }
170 |
171 | }
172 |
--------------------------------------------------------------------------------
/src/main/java/com/digitalpetri/opcua/nodeset/attributes/VariableTypeNodeAttributes.java:
--------------------------------------------------------------------------------
1 | package com.digitalpetri.opcua.nodeset.attributes;
2 |
3 | import java.util.Arrays;
4 | import java.util.Map;
5 | import java.util.Optional;
6 | import javax.xml.bind.Marshaller;
7 |
8 | import com.digitalpetri.opcua.nodeset.util.AttributeUtil;
9 | import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
10 | import org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText;
11 | import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
12 | import org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName;
13 | import org.eclipse.milo.opcua.stack.core.types.builtin.Variant;
14 | import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
15 | import org.eclipse.milo.opcua.stack.core.types.enumerated.NodeClass;
16 | import org.opcfoundation.ua.generated.UAVariableType;
17 |
18 | import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint;
19 |
20 | public class VariableTypeNodeAttributes extends NodeAttributes {
21 |
22 | private final DataValue value;
23 | private final NodeId dataType;
24 | private final int valueRank;
25 | private final UInteger[] arrayDimensions;
26 | private final boolean isAbstract;
27 |
28 | public VariableTypeNodeAttributes(
29 | NodeId nodeId,
30 | QualifiedName browseName,
31 | LocalizedText displayName,
32 | LocalizedText description,
33 | UInteger writeMask,
34 | UInteger userWriteMask,
35 | DataValue value,
36 | NodeId dataType,
37 | int valueRank,
38 | UInteger[] arrayDimensions,
39 | boolean isAbstract
40 | ) {
41 |
42 | super(nodeId, NodeClass.VariableType, browseName, displayName, description, writeMask, userWriteMask);
43 |
44 | this.value = value;
45 | this.dataType = dataType;
46 | this.valueRank = valueRank;
47 | this.arrayDimensions = arrayDimensions;
48 | this.isAbstract = isAbstract;
49 | }
50 |
51 | public DataValue getValue() {
52 | return value;
53 | }
54 |
55 | public NodeId getDataType() {
56 | return dataType;
57 | }
58 |
59 | public int getValueRank() {
60 | return valueRank;
61 | }
62 |
63 | public UInteger[] getArrayDimensions() {
64 | return arrayDimensions;
65 | }
66 |
67 | public boolean isAbstract() {
68 | return isAbstract;
69 | }
70 |
71 | @Override
72 | public String toString() {
73 | return "VariableTypeNodeAttributes{" +
74 | "value=" + value +
75 | ", dataType=" + dataType +
76 | ", valueRank=" + valueRank +
77 | ", arrayDimensions=" + Arrays.toString(arrayDimensions) +
78 | ", isAbstract=" + isAbstract +
79 | "} " + super.toString();
80 | }
81 |
82 | public static VariableTypeNodeAttributes fromGenerated(
83 | UAVariableType gNode,
84 | Marshaller marshaller,
85 | Map aliasMap, Map rawXmlValues) {
86 |
87 | NodeId nodeId = NodeId.parse(gNode.getNodeId());
88 | QualifiedName browseName = QualifiedName.parse(gNode.getBrowseName());
89 |
90 | LocalizedText displayName = gNode.getDisplayName().stream()
91 | .findFirst()
92 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
93 | .orElse(LocalizedText.english(browseName.getName()));
94 |
95 | LocalizedText description = gNode.getDescription().stream()
96 | .findFirst()
97 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
98 | .orElse(LocalizedText.NULL_VALUE);
99 |
100 | UInteger writeMask = uint(gNode.getWriteMask());
101 | UInteger userWriteMask = uint(gNode.getUserWriteMask());
102 |
103 | DataValue value = value(gNode.getValue(), marshaller, nodeId, rawXmlValues)
104 | .orElse(new DataValue(Variant.NULL_VALUE));
105 | NodeId dataType = AttributeUtil.parseDataType(gNode.getDataType(), aliasMap);
106 | int valueRank = gNode.getValueRank();
107 | UInteger[] arrayDimensions = AttributeUtil.parseArrayDimensions(gNode.getArrayDimensions());
108 | boolean isAbstract = gNode.isIsAbstract();
109 |
110 | return new VariableTypeNodeAttributes(
111 | nodeId,
112 | browseName,
113 | displayName,
114 | description,
115 | writeMask,
116 | userWriteMask,
117 | value,
118 | dataType,
119 | valueRank,
120 | arrayDimensions,
121 | isAbstract
122 | );
123 | }
124 |
125 | private static Optional value(
126 | UAVariableType.Value gValue,
127 | Marshaller marshaller,
128 | NodeId nodeId,
129 | Map rawXmlValues
130 | ) {
131 |
132 | if (gValue == null) return Optional.empty();
133 |
134 | return Optional.of(AttributeUtil.parseValue(gValue.getAny(), marshaller, nodeId, rawXmlValues));
135 | }
136 |
137 | }
138 |
--------------------------------------------------------------------------------
/src/main/java/com/digitalpetri/opcua/nodeset/attributes/ViewNodeAttributes.java:
--------------------------------------------------------------------------------
1 | package com.digitalpetri.opcua.nodeset.attributes;
2 |
3 | import org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText;
4 | import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
5 | import org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName;
6 | import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UByte;
7 | import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
8 | import org.eclipse.milo.opcua.stack.core.types.enumerated.NodeClass;
9 | import org.opcfoundation.ua.generated.UAView;
10 |
11 | import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ubyte;
12 | import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint;
13 |
14 | public class ViewNodeAttributes extends NodeAttributes {
15 |
16 | private final boolean containsNoLoops;
17 | private final UByte eventNotifier;
18 |
19 | public ViewNodeAttributes(
20 | NodeId nodeId,
21 | QualifiedName browseName,
22 | LocalizedText displayName,
23 | LocalizedText description,
24 | UInteger writeMask,
25 | UInteger userWriteMask,
26 | boolean containsNoLoops,
27 | UByte eventNotifier
28 | ) {
29 |
30 | super(nodeId, NodeClass.View, browseName, displayName, description, writeMask, userWriteMask);
31 |
32 | this.containsNoLoops = containsNoLoops;
33 | this.eventNotifier = eventNotifier;
34 | }
35 |
36 | public boolean isContainsNoLoops() {
37 | return containsNoLoops;
38 | }
39 |
40 | public UByte getEventNotifier() {
41 | return eventNotifier;
42 | }
43 |
44 | @Override
45 | public String toString() {
46 | return "ViewNodeAttributes{" +
47 | "containsNoLoops=" + containsNoLoops +
48 | ", eventNotifier=" + eventNotifier +
49 | "} " + super.toString();
50 | }
51 |
52 | public static ViewNodeAttributes fromGenerated(UAView gNode) {
53 | NodeId nodeId = NodeId.parse(gNode.getNodeId());
54 | QualifiedName browseName = QualifiedName.parse(gNode.getBrowseName());
55 |
56 | LocalizedText displayName = gNode.getDisplayName().stream()
57 | .findFirst()
58 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
59 | .orElse(LocalizedText.english(browseName.getName()));
60 |
61 | LocalizedText description = gNode.getDescription().stream()
62 | .findFirst()
63 | .map(gLocalizedText -> LocalizedText.english(gLocalizedText.getValue()))
64 | .orElse(LocalizedText.NULL_VALUE);
65 |
66 | UInteger writeMask = uint(gNode.getWriteMask());
67 | UInteger userWriteMask = uint(gNode.getUserWriteMask());
68 |
69 | boolean containsNoLoops = gNode.isContainsNoLoops();
70 | UByte eventNotifier = ubyte(gNode.getEventNotifier());
71 |
72 | return new ViewNodeAttributes(
73 | nodeId,
74 | browseName,
75 | displayName,
76 | description,
77 | writeMask,
78 | userWriteMask,
79 | containsNoLoops,
80 | eventNotifier
81 | );
82 | }
83 |
84 | }
85 |
--------------------------------------------------------------------------------
/src/main/java/com/digitalpetri/opcua/nodeset/util/AttributeUtil.java:
--------------------------------------------------------------------------------
1 | package com.digitalpetri.opcua.nodeset.util;
2 |
3 | import java.io.StringReader;
4 | import java.io.StringWriter;
5 | import java.util.Arrays;
6 | import java.util.List;
7 | import java.util.Map;
8 | import java.util.Optional;
9 | import javax.xml.bind.JAXBElement;
10 | import javax.xml.bind.JAXBException;
11 | import javax.xml.bind.Marshaller;
12 | import javax.xml.transform.Transformer;
13 | import javax.xml.transform.TransformerException;
14 | import javax.xml.transform.TransformerFactory;
15 | import javax.xml.transform.dom.DOMSource;
16 | import javax.xml.transform.stream.StreamResult;
17 |
18 | import org.eclipse.milo.opcua.stack.core.Identifiers;
19 | import org.eclipse.milo.opcua.stack.core.NamespaceTable;
20 | import org.eclipse.milo.opcua.stack.core.serialization.EncodingLimits;
21 | import org.eclipse.milo.opcua.stack.core.serialization.OpcUaXmlStreamDecoder;
22 | import org.eclipse.milo.opcua.stack.core.serialization.SerializationContext;
23 | import org.eclipse.milo.opcua.stack.core.types.DataTypeManager;
24 | import org.eclipse.milo.opcua.stack.core.types.OpcUaDataTypeManager;
25 | import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
26 | import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
27 | import org.eclipse.milo.opcua.stack.core.types.builtin.Variant;
28 | import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
29 | import org.opcfoundation.ua.generated.Reference;
30 | import org.slf4j.Logger;
31 | import org.slf4j.LoggerFactory;
32 | import org.w3c.dom.Node;
33 |
34 | import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint;
35 |
36 | public class AttributeUtil {
37 |
38 | private static final Logger LOGGER = LoggerFactory.getLogger(AttributeUtil.class);
39 |
40 | private static final SerializationContext SERIALIZATION_CONTEXT = new SerializationContext() {
41 |
42 | private final NamespaceTable namespaceTable = new NamespaceTable();
43 |
44 | @Override
45 | public EncodingLimits getEncodingLimits() {
46 | return EncodingLimits.DEFAULT;
47 | }
48 |
49 | @Override
50 | public NamespaceTable getNamespaceTable() {
51 | return namespaceTable;
52 | }
53 |
54 | @Override
55 | public DataTypeManager getDataTypeManager() {
56 | return OpcUaDataTypeManager.getInstance();
57 | }
58 | };
59 |
60 | public static NodeId parseDataType(String dataType, Map aliases) {
61 | return tryParseNodeId(dataType, aliases);
62 | }
63 |
64 | public static NodeId parseReferenceTypeId(Reference gReference, Map aliases) {
65 | String referenceType = gReference.getReferenceType();
66 |
67 | return tryParseNodeId(referenceType, aliases);
68 | }
69 |
70 | public static NodeId tryParseNodeId(String id, Map aliases) {
71 | return NodeId.parseSafe(id).orElseGet(() -> {
72 | if (aliases.containsKey(id)) {
73 | return aliases.get(id);
74 | } else {
75 | // Ok, last effort...
76 | Optional nodeId = Arrays.stream(Identifiers.class.getFields())
77 | .filter(field -> field.getName().equals(id))
78 | .findFirst()
79 | .map(field -> {
80 | try {
81 | return (NodeId) field.get(null);
82 | } catch (Throwable ex) {
83 | throw new RuntimeException("Couldn't get NodeId field: " + id, ex);
84 | }
85 | });
86 |
87 | return nodeId.orElseThrow(RuntimeException::new);
88 | }
89 | });
90 | }
91 |
92 | public static DataValue parseValue(
93 | Object value,
94 | Marshaller marshaller,
95 | NodeId nodeId,
96 | Map rawXmlValues
97 | ) {
98 |
99 | StringWriter sw = new StringWriter();
100 |
101 | if (value instanceof JAXBElement) {
102 | JAXBElement> jaxbElement = (JAXBElement) value;
103 |
104 | try {
105 | marshaller.marshal(jaxbElement, sw);
106 | } catch (JAXBException e) {
107 | LOGGER.warn("unable to marshal JAXB element: " + jaxbElement, e);
108 | return new DataValue(Variant.NULL_VALUE);
109 | }
110 | } else if (value instanceof Node) {
111 | Node node = (Node) value;
112 |
113 | try {
114 | Transformer transformer = TransformerFactory.newInstance().newTransformer();
115 | transformer.setOutputProperty("omit-xml-declaration", "yes");
116 | transformer.transform(new DOMSource(node), new StreamResult(sw));
117 | } catch (TransformerException e) {
118 | LOGGER.warn("unable to transform dom node: " + node, e);
119 | return new DataValue(Variant.NULL_VALUE);
120 | }
121 | }
122 |
123 | String xmlString = sw.toString();
124 | try {
125 | OpcUaXmlStreamDecoder xmlReader = new OpcUaXmlStreamDecoder(SERIALIZATION_CONTEXT);
126 | xmlReader.setInput(new StringReader(xmlString));
127 |
128 | Object valueObject = xmlReader.readVariantValue();
129 |
130 | rawXmlValues.put(nodeId, xmlString);
131 |
132 | return new DataValue(new Variant(valueObject));
133 | } catch (Throwable t) {
134 | LOGGER.warn("unable to parse Value: " + xmlString, t);
135 | return new DataValue(Variant.NULL_VALUE);
136 | }
137 | }
138 |
139 | public static UInteger[] parseArrayDimensions(List list) {
140 | if (list.isEmpty()) {
141 | return new UInteger[0];
142 | } else {
143 | String[] ss = list.get(0).split(",");
144 | UInteger[] dimensions = new UInteger[ss.length];
145 |
146 | for (int i = 0; i < ss.length; i++) {
147 | dimensions[i] = uint(Integer.parseInt(ss[i]));
148 | }
149 |
150 | return dimensions;
151 | }
152 | }
153 |
154 | public static class ParsedDataValue {
155 | final String rawXml;
156 | final DataValue value;
157 |
158 | public ParsedDataValue(String rawXml, DataValue value) {
159 | this.rawXml = rawXml;
160 | this.value = value;
161 | }
162 | }
163 |
164 | }
165 |
--------------------------------------------------------------------------------
/src/main/resources/UANodeSet.xsd:
--------------------------------------------------------------------------------
1 |
2 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
--------------------------------------------------------------------------------
/src/test/java/com/digitalpetri/opcua/nodeset/UaNodeSetTest.java:
--------------------------------------------------------------------------------
1 | package com.digitalpetri.opcua.nodeset;
2 |
3 | import java.io.InputStream;
4 | import javax.xml.bind.JAXBException;
5 |
6 | import org.junit.Test;
7 |
8 | public class UaNodeSetTest {
9 |
10 | @Test
11 | public void testParseNodeSet2() throws Exception {
12 | parse("Opc.Ua.NodeSet2.xml");
13 | }
14 |
15 | @Test
16 | public void testParseNodeSet2_Part3() throws Exception {
17 | parse("Opc.Ua.NodeSet2.Part3.xml");
18 | }
19 |
20 | @Test
21 | public void testParseNodeSet2_Part4() throws Exception {
22 | parse("Opc.Ua.NodeSet2.Part4.xml");
23 | }
24 |
25 | @Test
26 | public void testParseNodeSet2_Part5() throws Exception {
27 | parse("Opc.Ua.NodeSet2.Part5.xml");
28 | }
29 |
30 | @Test
31 | public void testParseNodeSet2_Part9() throws Exception {
32 | parse("Opc.Ua.NodeSet2.Part9.xml");
33 | }
34 |
35 | @Test
36 | public void testParseNodeSet2_Part10() throws Exception {
37 | parse("Opc.Ua.NodeSet2.Part10.xml");
38 | }
39 |
40 | @Test
41 | public void testParseNodeSet2_Part11() throws Exception {
42 | parse("Opc.Ua.NodeSet2.Part11.xml");
43 | }
44 |
45 | @Test
46 | public void testParseNodeSet2_Part13() throws Exception {
47 | parse("Opc.Ua.NodeSet2.Part13.xml");
48 | }
49 |
50 | @Test
51 | public void testParseAdiNodeSet() throws Exception {
52 | parse("adi/Opc.Ua.Adi.NodeSet2.xml");
53 | }
54 |
55 | @Test
56 | public void testParseAMLBaseTypes() throws Exception {
57 | parse("aml/Opc.Ua.AMLBaseTypes.NodeSet2.xml");
58 | }
59 |
60 | @Test
61 | public void testParseAMLLibraries() throws Exception {
62 | parse("aml/Opc.Ua.AMLLibraries.NodeSet2.xml");
63 | }
64 |
65 | @Test
66 | public void testParseAutoIdNodeSet() throws Exception {
67 | parse("autoid/Opc.Ua.AutoID.NodeSet2.xml");
68 | }
69 |
70 | @Test
71 | public void testParseDiNodeSet() throws Exception {
72 | parse("di/Opc.Ua.Di.NodeSet2.xml");
73 | }
74 |
75 | @Test
76 | public void testParseMdisNodeSet() throws Exception {
77 | parse("mdis/OPC.MDIS.NodeSet2.xml");
78 | }
79 |
80 | @Test
81 | public void testParsePlcNodeSet() throws Exception {
82 | parse("plc/Opc.Ua.Plc.NodeSet2.xml");
83 | }
84 |
85 | @Test
86 | public void testParseSchemaCheckNodeSet() throws Exception {
87 | parse("schema/Opc.Ua.NodeSet.Schema.Check.xml");
88 | }
89 |
90 | private void parse(String nodeSetFilename) throws JAXBException {
91 | InputStream nodeSetXml = getClass().getClassLoader().getResourceAsStream(nodeSetFilename);
92 |
93 | UaNodeSet nodeSet = UaNodeSet.parse(nodeSetXml);
94 |
95 | System.out.println("Parsed " + nodeSetFilename + " and generated " + nodeSet.getNodes().size() + " nodes.");
96 | }
97 |
98 | }
99 |
--------------------------------------------------------------------------------
/src/test/resources/Opc.Ua.NodeSet2.Part13.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | i=1
5 | i=2
6 | i=3
7 | i=4
8 | i=5
9 | i=6
10 | i=7
11 | i=8
12 | i=9
13 | i=10
14 | i=11
15 | i=13
16 | i=12
17 | i=15
18 | i=14
19 | i=16
20 | i=17
21 | i=18
22 | i=20
23 | i=21
24 | i=19
25 | i=22
26 | i=26
27 | i=27
28 | i=28
29 | i=47
30 | i=46
31 | i=35
32 | i=36
33 | i=48
34 | i=45
35 | i=40
36 | i=37
37 | i=38
38 | i=39
39 |
40 |
41 | AggregateConfigurationType
42 |
43 | i=11188
44 | i=11189
45 | i=11190
46 | i=11191
47 | i=58
48 |
49 |
50 |
51 | TreatUncertainAsBad
52 |
53 | i=68
54 | i=78
55 | i=11187
56 |
57 |
58 |
59 | PercentDataBad
60 |
61 | i=68
62 | i=78
63 | i=11187
64 |
65 |
66 |
67 | PercentDataGood
68 |
69 | i=68
70 | i=78
71 | i=11187
72 |
73 |
74 |
75 | UseSlopedExtrapolation
76 |
77 | i=68
78 | i=78
79 | i=11187
80 |
81 |
82 |
83 | Interpolative
84 | At the beginning of each interval, retrieve the calculated value from the data points on either side of the requested timestamp.
85 |
86 | i=2340
87 |
88 |
89 |
90 | Average
91 | Retrieve the average value of the data over the interval.
92 |
93 | i=2340
94 |
95 |
96 |
97 | TimeAverage
98 | Retrieve the time weighted average data over the interval using Interpolated Bounding Values.
99 |
100 | i=2340
101 |
102 |
103 |
104 | TimeAverage2
105 | Retrieve the time weighted average data over the interval using Simple Bounding Values.
106 |
107 | i=2340
108 |
109 |
110 |
111 | Total
112 | Retrieve the total (time integral) of the data over the interval using Interpolated Bounding Values.
113 |
114 | i=2340
115 |
116 |
117 |
118 | Total2
119 | Retrieve the total (time integral) of the data over the interval using Simple Bounding Values.
120 |
121 | i=2340
122 |
123 |
124 |
125 | Minimum
126 | Retrieve the minimum raw value in the interval with the timestamp of the start of the interval.
127 |
128 | i=2340
129 |
130 |
131 |
132 | Maximum
133 | Retrieve the maximum raw value in the interval with the timestamp of the start of the interval.
134 |
135 | i=2340
136 |
137 |
138 |
139 | MinimumActualTime
140 | Retrieve the minimum value in the interval and the Timestamp of the minimum value.
141 |
142 | i=2340
143 |
144 |
145 |
146 | MaximumActualTime
147 | Retrieve the maximum value in the interval and the Timestamp of the maximum value.
148 |
149 | i=2340
150 |
151 |
152 |
153 | Range
154 | Retrieve the difference between the minimum and maximum Value over the interval.
155 |
156 | i=2340
157 |
158 |
159 |
160 | Minimum2
161 | Retrieve the minimum value in the interval including the Simple Bounding Values.
162 |
163 | i=2340
164 |
165 |
166 |
167 | Maximum2
168 | Retrieve the maximum value in the interval including the Simple Bounding Values.
169 |
170 | i=2340
171 |
172 |
173 |
174 | MinimumActualTime2
175 | Retrieve the minimum value with the actual timestamp including the Simple Bounding Values.
176 |
177 | i=2340
178 |
179 |
180 |
181 | MaximumActualTime2
182 | Retrieve the maximum value with the actual timestamp including the Simple Bounding Values.
183 |
184 | i=2340
185 |
186 |
187 |
188 | Range2
189 | Retrieve the difference between the Minimum2 and Maximum2 value over the interval.
190 |
191 | i=2340
192 |
193 |
194 |
195 | AnnotationCount
196 | Retrieve the number of Annotations in the interval.
197 |
198 | i=2340
199 |
200 |
201 |
202 | Count
203 | Retrieve the number of raw values over the interval.
204 |
205 | i=2340
206 |
207 |
208 |
209 | DurationInStateZero
210 | Retrieve the time a Boolean or numeric was in a zero state using Simple Bounding Values.
211 |
212 | i=2340
213 |
214 |
215 |
216 | DurationInStateNonZero
217 | Retrieve the time a Boolean or numeric was in a non-zero state using Simple Bounding Values.
218 |
219 | i=2340
220 |
221 |
222 |
223 | NumberOfTransitions
224 | Retrieve the number of changes between zero and non-zero that a Boolean or Numeric value experienced in the interval.
225 |
226 | i=2340
227 |
228 |
229 |
230 | Start
231 | Retrieve the value at the beginning of the interval using Interpolated Bounding Values.
232 |
233 | i=2340
234 |
235 |
236 |
237 | End
238 | Retrieve the value at the end of the interval using Interpolated Bounding Values.
239 |
240 | i=2340
241 |
242 |
243 |
244 | Delta
245 | Retrieve the difference between the Start and End value in the interval.
246 |
247 | i=2340
248 |
249 |
250 |
251 | StartBound
252 | Retrieve the value at the beginning of the interval using Simple Bounding Values.
253 |
254 | i=2340
255 |
256 |
257 |
258 | EndBound
259 | Retrieve the value at the end of the interval using Simple Bounding Values.
260 |
261 | i=2340
262 |
263 |
264 |
265 | DeltaBounds
266 | Retrieve the difference between the StartBound and EndBound value in the interval.
267 |
268 | i=2340
269 |
270 |
271 |
272 | DurationGood
273 | Retrieve the total duration of time in the interval during which the data is good.
274 |
275 | i=2340
276 |
277 |
278 |
279 | DurationBad
280 | Retrieve the total duration of time in the interval during which the data is bad.
281 |
282 | i=2340
283 |
284 |
285 |
286 | PercentGood
287 | Retrieve the percent of data (0 to 100) in the interval which has a good StatusCode.
288 |
289 | i=2340
290 |
291 |
292 |
293 | PercentBad
294 | Retrieve the percent of data (0 to 100) in the interval which has a bad StatusCode.
295 |
296 | i=2340
297 |
298 |
299 |
300 | WorstQuality
301 | Retrieve the worst StatusCode of data in the interval.
302 |
303 | i=2340
304 |
305 |
306 |
307 | WorstQuality2
308 | Retrieve the worst StatusCode of data in the interval including the Simple Bounding Values.
309 |
310 | i=2340
311 |
312 |
313 |
314 | StandardDeviationSample
315 | Retrieve the standard deviation for the interval for a sample of the population (n-1).
316 |
317 | i=2340
318 |
319 |
320 |
321 | StandardDeviationPopulation
322 | Retrieve the standard deviation for the interval for a complete population (n) which includes Simple Bounding Values.
323 |
324 | i=2340
325 |
326 |
327 |
328 | VarianceSample
329 | Retrieve the variance for the interval as calculated by the StandardDeviationSample.
330 |
331 | i=2340
332 |
333 |
334 |
335 | VariancePopulation
336 | Retrieve the variance for the interval as calculated by the StandardDeviationPopulation which includes Simple Bounding Values.
337 |
338 | i=2340
339 |
340 |
341 |
--------------------------------------------------------------------------------
/src/test/resources/Opc.Ua.NodeSet2.Part8.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | i=1
5 | i=2
6 | i=3
7 | i=4
8 | i=5
9 | i=6
10 | i=7
11 | i=8
12 | i=9
13 | i=10
14 | i=11
15 | i=13
16 | i=12
17 | i=15
18 | i=14
19 | i=16
20 | i=17
21 | i=18
22 | i=20
23 | i=21
24 | i=19
25 | i=22
26 | i=26
27 | i=27
28 | i=28
29 | i=47
30 | i=46
31 | i=35
32 | i=36
33 | i=48
34 | i=45
35 | i=40
36 | i=37
37 | i=38
38 | i=39
39 |
40 |
41 | DataItemType
42 | A variable that contains live automation data.
43 |
44 | i=2366
45 | i=2367
46 | i=63
47 |
48 |
49 |
50 | Definition
51 | A vendor-specific, human readable string that specifies how the value of this DataItem is calculated.
52 |
53 | i=68
54 | i=80
55 | i=2365
56 |
57 |
58 |
59 | ValuePrecision
60 | The maximum precision that the server can maintain for the item based on restrictions in the target environment.
61 |
62 | i=68
63 | i=80
64 | i=2365
65 |
66 |
67 |
68 | AnalogItemType
69 |
70 | i=2370
71 | i=2369
72 | i=2371
73 | i=2365
74 |
75 |
76 |
77 | InstrumentRange
78 |
79 | i=68
80 | i=80
81 | i=2368
82 |
83 |
84 |
85 | EURange
86 |
87 | i=68
88 | i=78
89 | i=2368
90 |
91 |
92 |
93 | EngineeringUnits
94 |
95 | i=68
96 | i=80
97 | i=2368
98 |
99 |
100 |
101 | DiscreteItemType
102 |
103 | i=2365
104 |
105 |
106 |
107 | TwoStateDiscreteType
108 |
109 | i=2374
110 | i=2375
111 | i=2372
112 |
113 |
114 |
115 | FalseState
116 |
117 | i=68
118 | i=78
119 | i=2373
120 |
121 |
122 |
123 | TrueState
124 |
125 | i=68
126 | i=78
127 | i=2373
128 |
129 |
130 |
131 | MultiStateDiscreteType
132 |
133 | i=2377
134 | i=2372
135 |
136 |
137 |
138 | EnumStrings
139 |
140 | i=68
141 | i=78
142 | i=2376
143 |
144 |
145 |
146 | MultiStateValueDiscreteType
147 |
148 | i=11241
149 | i=11461
150 | i=2372
151 |
152 |
153 |
154 | EnumValues
155 |
156 | i=68
157 | i=78
158 | i=11238
159 |
160 |
161 |
162 | ValueAsText
163 |
164 | i=68
165 | i=78
166 | i=11238
167 |
168 |
169 |
170 | ArrayItemType
171 |
172 | i=12024
173 | i=12025
174 | i=12026
175 | i=12027
176 | i=12028
177 | i=2365
178 |
179 |
180 |
181 | InstrumentRange
182 |
183 | i=68
184 | i=80
185 | i=12021
186 |
187 |
188 |
189 | EURange
190 |
191 | i=68
192 | i=78
193 | i=12021
194 |
195 |
196 |
197 | EngineeringUnits
198 |
199 | i=68
200 | i=78
201 | i=12021
202 |
203 |
204 |
205 | Title
206 |
207 | i=68
208 | i=78
209 | i=12021
210 |
211 |
212 |
213 | AxisScaleType
214 |
215 | i=68
216 | i=78
217 | i=12021
218 |
219 |
220 |
221 | YArrayItemType
222 |
223 | i=12037
224 | i=12021
225 |
226 |
227 |
228 | XAxisDefinition
229 |
230 | i=68
231 | i=78
232 | i=12029
233 |
234 |
235 |
236 | XYArrayItemType
237 |
238 | i=12046
239 | i=12021
240 |
241 |
242 |
243 | XAxisDefinition
244 |
245 | i=68
246 | i=78
247 | i=12038
248 |
249 |
250 |
251 | ImageItemType
252 |
253 | i=12055
254 | i=12056
255 | i=12021
256 |
257 |
258 |
259 | XAxisDefinition
260 |
261 | i=68
262 | i=78
263 | i=12047
264 |
265 |
266 |
267 | YAxisDefinition
268 |
269 | i=68
270 | i=78
271 | i=12047
272 |
273 |
274 |
275 | CubeItemType
276 |
277 | i=12065
278 | i=12066
279 | i=12067
280 | i=12021
281 |
282 |
283 |
284 | XAxisDefinition
285 |
286 | i=68
287 | i=78
288 | i=12057
289 |
290 |
291 |
292 | YAxisDefinition
293 |
294 | i=68
295 | i=78
296 | i=12057
297 |
298 |
299 |
300 | ZAxisDefinition
301 |
302 | i=68
303 | i=78
304 | i=12057
305 |
306 |
307 |
308 | NDimensionArrayItemType
309 |
310 | i=12076
311 | i=12021
312 |
313 |
314 |
315 | AxisDefinition
316 |
317 | i=68
318 | i=78
319 | i=12068
320 |
321 |
322 |
323 | Range
324 |
325 | i=22
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 | EUInformation
334 |
335 | i=22
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 | AxisScaleEnumeration
346 |
347 | i=12078
348 | i=29
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 | EnumStrings
358 |
359 | i=68
360 | i=78
361 | i=12077
362 |
363 |
364 |
365 |
366 |
367 |
368 | Linear
369 |
370 |
371 |
372 |
373 | Log
374 |
375 |
376 |
377 |
378 | Ln
379 |
380 |
381 |
382 |
383 |
384 | ComplexNumberType
385 |
386 | i=22
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 | DoubleComplexNumberType
395 |
396 | i=22
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 | AxisInformation
405 |
406 | i=22
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 | XVType
418 |
419 | i=22
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 | Default XML
428 |
429 | i=884
430 | i=8873
431 | i=76
432 |
433 |
434 |
435 | Default XML
436 |
437 | i=887
438 | i=8876
439 | i=76
440 |
441 |
442 |
443 | Default XML
444 |
445 | i=12171
446 | i=12175
447 | i=76
448 |
449 |
450 |
451 | Default XML
452 |
453 | i=12172
454 | i=12178
455 | i=76
456 |
457 |
458 |
459 | Default XML
460 |
461 | i=12079
462 | i=12083
463 | i=76
464 |
465 |
466 |
467 | Default XML
468 |
469 | i=12080
470 | i=12086
471 | i=76
472 |
473 |
474 |
475 | Default Binary
476 |
477 | i=884
478 | i=8238
479 | i=76
480 |
481 |
482 |
483 | Default Binary
484 |
485 | i=887
486 | i=8241
487 | i=76
488 |
489 |
490 |
491 | Default Binary
492 |
493 | i=12171
494 | i=12183
495 | i=76
496 |
497 |
498 |
499 | Default Binary
500 |
501 | i=12172
502 | i=12186
503 | i=76
504 |
505 |
506 |
507 | Default Binary
508 |
509 | i=12079
510 | i=12091
511 | i=76
512 |
513 |
514 |
515 | Default Binary
516 |
517 | i=12080
518 | i=12094
519 | i=76
520 |
521 |
522 |
--------------------------------------------------------------------------------
/src/test/resources/aml/Opc.Ua.AMLBaseTypes.NodeSet2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | http://opcfoundation.org/UA/AML/
5 |
6 |
7 | i=1
8 | i=2
9 | i=3
10 | i=4
11 | i=5
12 | i=6
13 | i=7
14 | i=8
15 | i=9
16 | i=10
17 | i=11
18 | i=13
19 | i=12
20 | i=15
21 | i=14
22 | i=16
23 | i=17
24 | i=18
25 | i=20
26 | i=21
27 | i=19
28 | i=22
29 | i=26
30 | i=27
31 | i=28
32 | i=47
33 | i=46
34 | i=35
35 | i=36
36 | i=48
37 | i=45
38 | i=40
39 | i=37
40 | i=38
41 | i=39
42 | i=290
43 |
44 |
45 | InstanceHierarchies
46 |
47 | i=61
48 | ns=1;i=1005
49 | i=78
50 |
51 |
52 |
53 | InterfaceClassLibs
54 |
55 | i=61
56 | ns=1;i=1005
57 | i=78
58 |
59 |
60 |
61 | RoleClassLibs
62 |
63 | i=61
64 | i=78
65 | ns=1;i=1005
66 |
67 |
68 |
69 | SystemUnitClassLibs
70 |
71 | i=61
72 | i=78
73 | ns=1;i=1005
74 |
75 |
76 |
77 | AutomationMLFiles
78 |
79 | i=61
80 | i=85
81 |
82 |
83 |
84 | AutomationMLInstanceHierarchies
85 |
86 | i=61
87 | i=85
88 |
89 |
90 |
91 | AutomationMLLibraries
92 | The browse entry point when looking for AutomationML libraries in the server address space.
93 |
94 | i=88
95 | i=61
96 | i=85
97 | ns=1;i=5008
98 | ns=1;i=5009
99 | ns=1;i=5010
100 |
101 |
102 |
103 | InterfaceClassLibs
104 |
105 | i=61
106 | ns=1;i=5007
107 |
108 |
109 |
110 | RoleClassLibs
111 |
112 | i=61
113 | ns=1;i=5007
114 |
115 |
116 |
117 | SystemUnitClassLibs
118 |
119 | i=61
120 | ns=1;i=5007
121 |
122 |
123 |
124 | Version
125 |
126 | i=78
127 | i=68
128 | ns=1;i=1006
129 | i=80
130 |
131 |
132 |
133 | ID
134 |
135 | ns=1;i=1001
136 | i=78
137 | i=68
138 | i=80
139 |
140 |
141 |
142 | ID
143 |
144 | i=68
145 | i=80
146 |
147 |
148 |
149 | Version
150 |
151 | i=68
152 | i=80
153 |
154 |
155 |
156 | VariableNodeId
157 |
158 |
159 | i=63
160 | ns=1;i=3002
161 | i=78
162 |
163 |
164 |
165 | VariableName
166 |
167 |
168 | i=63
169 | ns=1;i=3002
170 | i=80
171 |
172 |
173 |
174 | ServerAddress
175 |
176 |
177 | i=63
178 | ns=1;i=3002
179 | i=78
180 |
181 |
182 |
183 | ServerAlias
184 |
185 |
186 | i=63
187 | ns=1;i=3002
188 | i=80
189 |
190 |
191 |
192 | CAEXBasicObjectType
193 |
194 | i=58
195 | ns=1;i=6001
196 |
197 |
198 |
199 | CAEXFileType
200 |
201 | ns=1;i=5001
202 | ns=1;i=5002
203 | ns=1;i=5003
204 | ns=1;i=5004
205 | ns=1;i=1006
206 |
207 |
208 |
209 | CAEXObjectType
210 |
211 | ns=1;i=6002
212 | ns=1;i=1006
213 |
214 |
215 |
216 | AutomationMLBaseInterface
217 |
218 | ns=1;i=1001
219 |
220 |
221 |
222 | AutomationMLBaseRole
223 |
224 | ns=1;i=1001
225 |
226 |
227 |
228 | AutomationMLBaseSystemUnit
229 |
230 | ns=1;i=1001
231 |
232 |
233 |
234 | AMLBaseVariableType
235 |
236 | i=62
237 | ns=1;i=1010
238 | ns=1;i=1011
239 |
240 |
241 |
242 | AMLOpcUaConnectionType
243 |
244 | ns=1;i=3001
245 | ns=1;i=1012
246 | ns=1;i=1013
247 | ns=1;i=1014
248 | ns=1;i=1015
249 |
250 |
251 |
252 | HasAMLRoleReference
253 |
254 | i=32
255 |
256 | IsSupportedRole
257 |
258 |
259 | HasAMLInternalLink
260 |
261 | i=32
262 |
263 | HasAMLInternalLink
264 |
265 |
--------------------------------------------------------------------------------
/src/test/resources/plc/Opc.Ua.Plc.NodeSet2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | http://PLCopen.org/OpcUa/IEC61131-3/
5 | http://opcfoundation.org/UA/DI/
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | i=1
15 | i=2
16 | i=3
17 | i=4
18 | i=5
19 | i=6
20 | i=7
21 | i=8
22 | i=9
23 | i=10
24 | i=11
25 | i=13
26 | i=12
27 | i=15
28 | i=14
29 | i=16
30 | i=17
31 | i=18
32 | i=20
33 | i=21
34 | i=19
35 | i=22
36 | i=26
37 | i=27
38 | i=28
39 | i=47
40 | i=46
41 | i=35
42 | i=36
43 | i=48
44 | i=45
45 | i=40
46 | i=37
47 | i=38
48 | i=39
49 |
50 |
51 | HasInputVars
52 |
53 | i=47
54 |
55 | InputVarsOf
56 |
57 |
58 | HasOutputVars
59 |
60 | i=47
61 |
62 | OutputVarsOf
63 |
64 |
65 | HasInOutVars
66 |
67 | i=47
68 |
69 | InOutVarsOf
70 |
71 |
72 | HasLocalVars
73 |
74 | i=47
75 |
76 | LocalVarsOf
77 |
78 |
79 | HasExternalVars
80 |
81 | i=35
82 |
83 | ExternalVarsOf
84 |
85 |
86 | With
87 |
88 | i=32
89 |
90 | Executes
91 |
92 |
93 | CtrlConfigurationType
94 |
95 | ns=1;i=5002
96 | ns=1;i=5004
97 | ns=1;i=5006
98 | ns=1;i=5007
99 | ns=1;i=5008
100 | ns=1;i=5009
101 | ns=1;i=5010
102 | ns=2;i=1002
103 |
104 |
105 |
106 | MethodSet
107 | Flat list of Methods
108 |
109 | ns=1;i=7001
110 | ns=1;i=7002
111 | i=58
112 | i=80
113 | ns=1;i=1001
114 |
115 |
116 |
117 | Start
118 |
119 | i=80
120 | ns=1;i=5002
121 |
122 |
123 |
124 | Stop
125 |
126 | i=80
127 | ns=1;i=5002
128 |
129 |
130 |
131 | Resources
132 |
133 | ns=1;i=5005
134 | ns=2;i=1004
135 | i=78
136 | ns=1;i=1001
137 |
138 |
139 |
140 | SupportedTypes
141 | Folder maintaining the set of (sub-types of) BaseObjectTypes that can be instantiated in the ConfigurableComponent
142 |
143 | i=61
144 | i=78
145 | ns=1;i=5004
146 |
147 |
148 |
149 | GlobalVars
150 |
151 | ns=2;i=1005
152 | i=78
153 | ns=1;i=1001
154 |
155 |
156 |
157 | AccessVars
158 |
159 | ns=2;i=1005
160 | i=78
161 | ns=1;i=1001
162 |
163 |
164 |
165 | ConfigVars
166 |
167 | ns=2;i=1005
168 | i=78
169 | ns=1;i=1001
170 |
171 |
172 |
173 | Configuration
174 |
175 | ns=2;i=1005
176 | i=78
177 | ns=1;i=1001
178 |
179 |
180 |
181 | Diagnostic
182 |
183 | ns=2;i=1005
184 | i=78
185 | ns=1;i=1001
186 |
187 |
188 |
189 | CtrlResourceType
190 |
191 | ns=1;i=5012
192 | ns=1;i=5014
193 | ns=1;i=5016
194 | ns=1;i=5018
195 | ns=1;i=5019
196 | ns=1;i=5020
197 | ns=2;i=1002
198 |
199 |
200 |
201 | MethodSet
202 | Flat list of Methods
203 |
204 | ns=1;i=7003
205 | ns=1;i=7004
206 | i=58
207 | i=80
208 | ns=1;i=1002
209 |
210 |
211 |
212 | Start
213 |
214 | i=80
215 | ns=1;i=5012
216 |
217 |
218 |
219 | Stop
220 |
221 | i=80
222 | ns=1;i=5012
223 |
224 |
225 |
226 | Tasks
227 |
228 | ns=1;i=5015
229 | ns=2;i=1004
230 | i=78
231 | ns=1;i=1002
232 |
233 |
234 |
235 | SupportedTypes
236 | Folder maintaining the set of (sub-types of) BaseObjectTypes that can be instantiated in the ConfigurableComponent
237 |
238 | i=61
239 | i=78
240 | ns=1;i=5014
241 |
242 |
243 |
244 | Programs
245 |
246 | ns=1;i=5017
247 | ns=2;i=1004
248 | i=78
249 | ns=1;i=1002
250 |
251 |
252 |
253 | SupportedTypes
254 | Folder maintaining the set of (sub-types of) BaseObjectTypes that can be instantiated in the ConfigurableComponent
255 |
256 | i=61
257 | i=78
258 | ns=1;i=5016
259 |
260 |
261 |
262 | GlobalVars
263 |
264 | ns=2;i=1005
265 | i=80
266 | ns=1;i=1002
267 |
268 |
269 |
270 | Configuration
271 |
272 | ns=2;i=1005
273 | i=80
274 | ns=1;i=1002
275 |
276 |
277 |
278 | Diagnostic
279 |
280 | ns=2;i=1005
281 | i=80
282 | ns=1;i=1002
283 |
284 |
285 |
286 | CtrlProgramOrganizationUnitType
287 |
288 | ns=1;i=6001
289 | ns=2;i=1003
290 |
291 |
292 |
293 | Body
294 |
295 | i=63
296 | i=80
297 | ns=1;i=1003
298 |
299 |
300 |
301 | CtrlProgramType
302 |
303 | ns=1;i=6002
304 | ns=1;i=1003
305 |
306 |
307 |
308 | Program
309 |
310 | i=63
311 | i=80
312 | ns=1;i=1004
313 |
314 |
315 |
316 | CtrlFunctionBlockType
317 |
318 | ns=1;i=6003
319 | ns=1;i=1003
320 |
321 |
322 |
323 | FunctionBlock
324 |
325 | i=63
326 | i=80
327 | ns=1;i=1005
328 |
329 |
330 |
331 | CtrlTaskType
332 |
333 | ns=1;i=6004
334 | ns=1;i=6005
335 | ns=1;i=6006
336 | i=58
337 |
338 |
339 |
340 | Priority
341 |
342 | i=68
343 | i=78
344 | ns=1;i=1006
345 |
346 |
347 |
348 | Interval
349 |
350 | i=68
351 | i=80
352 | ns=1;i=1006
353 |
354 |
355 |
356 | Single
357 |
358 | i=68
359 | i=80
360 | ns=1;i=1006
361 |
362 |
363 |
364 | SFCType
365 |
366 | i=58
367 |
368 |
369 |
--------------------------------------------------------------------------------
/src/test/resources/schema/Opc.Ua.NodeSet.Schema.Check.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 | i=1
6 | i=2
7 | i=3
8 | i=4
9 | i=5
10 | i=6
11 | i=7
12 | i=8
13 | i=9
14 | i=10
15 | i=11
16 | i=13
17 | i=12
18 | i=15
19 | i=14
20 | i=16
21 | i=17
22 | i=18
23 | i=20
24 | i=21
25 | i=19
26 | i=22
27 | i=26
28 | i=27
29 | i=28
30 | i=47
31 | i=46
32 | i=35
33 | i=36
34 | i=48
35 | i=45
36 | i=40
37 | i=37
38 | i=38
39 | i=39
40 |
41 |
42 |
43 |
44 |
45 |
46 | 0
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------