use of com.prosysopc.ua.client.AddressSpaceException in project FAAAST-Service by FraunhoferIOSB.
the class AasServiceNodeManager method addSubmodelElementBaseData.
/**
* Adds base data to the given submodel element.
*
* @param node The desired submodel element UA node
* @param element The corresponding AAS submodel element
* @throws StatusException If the operation fails
* @throws ServiceException If the operation fails
* @throws AddressSpaceException If the operation fails
* @throws ServiceResultException If the operation fails
*/
private void addSubmodelElementBaseData(AASSubmodelElementType node, SubmodelElement element) throws StatusException {
try {
if ((node != null) && (element != null)) {
// Category
String category = element.getCategory();
if (category == null) {
category = "";
}
node.setCategory(category);
node.setModelingKind(ValueConverter.convertModelingKind(element.getKind()));
// DataSpecifications
addEmbeddedDataSpecifications(node, element.getEmbeddedDataSpecifications());
// SemanticId
if (element.getSemanticId() != null) {
addSemanticId(node, element.getSemanticId());
}
// Qualifiers
List<Constraint> qualifiers = element.getQualifiers();
if ((qualifiers != null) && (!qualifiers.isEmpty())) {
if (node.getQualifierNode() == null) {
addQualifierNode(node);
}
addQualifiers(node.getQualifierNode(), qualifiers);
}
// Description
addDescriptions(node, element.getDescriptions());
if (VALUES_READ_ONLY) {
node.getCategoryNode().setAccessLevel(AccessLevelType.CurrentRead);
node.getModelingKindNode().setAccessLevel(AccessLevelType.CurrentRead);
}
}
} catch (Exception ex) {
LOG.error("addSubmodelElementBaseData Exception", ex);
throw ex;
}
}
use of com.prosysopc.ua.client.AddressSpaceException in project FAAAST-Service by FraunhoferIOSB.
the class AasServiceNodeManager method createAasNodes.
/**
* Creates the AAS nodes in the address space.
*
* @throws StatusException If the operation fails
* @throws ServiceException If the operation fails
* @throws AddressSpaceException If the operation fails
* @throws ServiceResultException If the operation fails
*/
private void createAasNodes() throws StatusException, ServiceResultException, ServiceException, AddressSpaceException {
try {
if (aasEnvironment != null) {
// add AASEnvironmentType
addAasEnvironmentNode();
// ConceptDescriptions.
addConceptDescriptions(aasEnvironment.getConceptDescriptions());
// Assets
List<Asset> assets = aasEnvironment.getAssets();
if ((assets != null) && (!assets.isEmpty())) {
for (Asset asset : assets) {
addAsset(aasEnvironmentNode, asset);
}
}
// Submodels
List<Submodel> submodels = aasEnvironment.getSubmodels();
if ((submodels != null) && (!submodels.isEmpty())) {
for (Submodel submodel : submodels) {
addSubmodel(aasEnvironmentNode, submodel);
}
}
addAssetAdministrationShells();
}
} catch (Exception ex) {
LOG.error("createAasNodes Exception", ex);
throw ex;
}
}
use of com.prosysopc.ua.client.AddressSpaceException in project FAAAST-Service by FraunhoferIOSB.
the class AasServiceNodeManager method init.
/**
* Initializes the Node Manager.
*
* @throws StatusException If the operation fails
* @throws UaNodeFactoryException Error creating nodes
*/
@Override
protected void init() throws StatusException, UaNodeFactoryException {
try {
super.init();
createAddressSpace();
} catch (ServiceResultException ex) {
throw new StatusException(ex);
} catch (ServiceException ex) {
throw new StatusException(ex.getServiceResult(), ex);
} catch (AddressSpaceException | MessageBusException ex) {
throw new StatusException(ex.getMessage(), ex);
}
}
Aggregations