Skip to content

Commit

Permalink
UaVariableTypeNode constructor with new attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinherron committed Mar 26, 2022
1 parent be89ded commit f01e430
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 3 deletions.
Expand Up @@ -1460,8 +1460,6 @@ private UaVariableTypeNode newVariableTypeNode(NodeId nodeId, List<DataValue> at
UInteger[] arrayDimensions = getAttributeOrNull(attributeValues.get(ai++), UInteger[].class);
Boolean isAbstract = (Boolean) attributeValues.get(ai).getValue().getValue();

// TODO call constructor that includes 1.04 attributes

return new UaVariableTypeNode(
client,
nodeId,
Expand All @@ -1471,6 +1469,9 @@ private UaVariableTypeNode newVariableTypeNode(NodeId nodeId, List<DataValue> at
description,
writeMask,
userWriteMask,
rolePermissions,
userRolePermissions,
accessRestrictions,
value,
dataType,
valueRank,
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 the Eclipse Milo Authors
* Copyright (c) 2022 the Eclipse Milo Authors
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -26,6 +26,8 @@
import org.eclipse.milo.opcua.stack.core.types.builtin.Variant;
import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
import org.eclipse.milo.opcua.stack.core.types.enumerated.NodeClass;
import org.eclipse.milo.opcua.stack.core.types.structured.AccessRestrictionType;
import org.eclipse.milo.opcua.stack.core.types.structured.RolePermissionType;
import org.jetbrains.annotations.Nullable;

public class UaVariableTypeNode extends UaNode implements VariableTypeNode {
Expand All @@ -36,6 +38,9 @@ public class UaVariableTypeNode extends UaNode implements VariableTypeNode {
private UInteger[] arrayDimensions;
private Boolean isAbstract;

/**
* Construct a {@link UaVariableTypeNode} using only attributes defined prior to OPC UA 1.04.
*/
public UaVariableTypeNode(
OpcUaClient client,
NodeId nodeId,
Expand All @@ -61,6 +66,49 @@ public UaVariableTypeNode(
this.isAbstract = isAbstract;
}

/**
* Construct a {@link UaVariableTypeNode} using all attributes, including those defined by OPC UA 1.04.
*/
public UaVariableTypeNode(
OpcUaClient client,
NodeId nodeId,
NodeClass nodeClass,
QualifiedName browseName,
LocalizedText displayName,
LocalizedText description,
UInteger writeMask,
UInteger userWriteMask,
RolePermissionType[] rolePermissions,
RolePermissionType[] userRolePermissions,
AccessRestrictionType accessRestrictions,
DataValue value,
NodeId dataType,
Integer valueRank,
UInteger[] arrayDimensions,
Boolean isAbstract
) {

super(
client,
nodeId,
nodeClass,
browseName,
displayName,
description,
writeMask,
userWriteMask,
rolePermissions,
userRolePermissions,
accessRestrictions
);

this.value = value;
this.dataType = dataType;
this.valueRank = valueRank;
this.arrayDimensions = arrayDimensions;
this.isAbstract = isAbstract;
}

/**
* {@inheritDoc}
* <p>
Expand Down

0 comments on commit f01e430

Please sign in to comment.