use of opc.i4aas.AASIdentifierKeyValuePairType in project FAAAST-Service by FraunhoferIOSB.
the class AasServiceNodeManager method addIdentifierKeyValuePair.
/**
* Adds an IdentifierKeyValuePair to the given Node.
*
* @param node The UA node in which the IdentifierKeyValuePair should be created
* @param identifierPair The desired IdentifierKeyValuePair
* @param name The desired name of the IdentifierKeyValuePair node
* @param readOnly True if the value should be read-only
* @throws StatusException If the operation fails
*/
private void addIdentifierKeyValuePair(UaNode node, IdentifierKeyValuePair identifierPair, String name, boolean readOnly) throws StatusException {
if (node == null) {
throw new IllegalArgumentException("node = null");
} else if (identifierPair == null) {
throw new IllegalArgumentException("identifierPair = null");
}
try {
logger.info("addIdentifierKeyValuePair " + name + "; to Node: " + node.toString());
QualifiedName browseName = UaQualifiedName.from(opc.i4aas.ObjectTypeIds.AASIdentifierKeyValuePairType.getNamespaceUri(), name).toQualifiedName(getNamespaceTable());
NodeId nid = createNodeId(node, browseName);
AASIdentifierKeyValuePairType identifierPairNode = createInstance(AASIdentifierKeyValuePairType.class, nid, browseName, LocalizedText.english(name));
setIdentifierKeyValuePairData(identifierPairNode, identifierPair, readOnly);
node.addComponent(identifierPairNode);
} catch (Throwable ex) {
logger.error("addIdentifierKeyValuePair Exception", ex);
throw ex;
}
}
Aggregations