use of io.adminshell.aas.v3.model.AdministrativeInformation in project FAAAST-Service by FraunhoferIOSB.
the class AasServiceNodeManager method addAdminInformationProperties.
/**
* Adds the AdminInformation Properties to the given node (if they don't
* exist).
*
* @param adminInfNode The desired AdminInformation node
* @param info The corresponding AAS AdministrativeInformation object
*/
private void addAdminInformationProperties(AASAdministrativeInformationType adminInfNode, AdministrativeInformation info) {
try {
if ((adminInfNode != null) && (info != null)) {
if (info.getVersion() != null) {
if (adminInfNode.getVersionNode() == null) {
NodeId myPropertyId = new NodeId(getNamespaceIndex(), adminInfNode.getNodeId().getValue().toString() + "." + AASAdministrativeInformationType.VERSION);
PlainProperty<String> myProperty = new PlainProperty<>(this, myPropertyId, UaQualifiedName.from(opc.i4aas.ObjectTypeIds.AASAssetAdministrationShellType.getNamespaceUri(), AASAdministrativeInformationType.VERSION).toQualifiedName(getNamespaceTable()), LocalizedText.english(AASAdministrativeInformationType.VERSION));
myProperty.setDataTypeId(Identifiers.String);
if (VALUES_READ_ONLY) {
myProperty.setAccessLevel(AccessLevelType.CurrentRead);
}
myProperty.setDescription(new LocalizedText("", ""));
adminInfNode.addProperty(myProperty);
}
adminInfNode.setVersion(info.getVersion());
}
if (info.getRevision() != null) {
if (adminInfNode.getRevisionNode() == null) {
NodeId myPropertyId = new NodeId(getNamespaceIndex(), adminInfNode.getNodeId().getValue().toString() + "." + AASAdministrativeInformationType.REVISION);
PlainProperty<String> myProperty = new PlainProperty<>(this, myPropertyId, UaQualifiedName.from(opc.i4aas.ObjectTypeIds.AASAssetAdministrationShellType.getNamespaceUri(), AASAdministrativeInformationType.REVISION).toQualifiedName(getNamespaceTable()), LocalizedText.english(AASAdministrativeInformationType.REVISION));
myProperty.setDataTypeId(Identifiers.String);
if (VALUES_READ_ONLY) {
myProperty.setAccessLevel(AccessLevelType.CurrentRead);
}
myProperty.setDescription(new LocalizedText("", ""));
adminInfNode.addProperty(myProperty);
}
adminInfNode.setRevision(info.getRevision());
}
}
} catch (Exception ex) {
LOG.error("addAdminInfProperties Exception", ex);
}
}
Aggregations