Search in sources :

Example 1 with SubscriptionDiagnosticsTypeNode

use of org.eclipse.milo.opcua.sdk.server.model.nodes.variables.SubscriptionDiagnosticsTypeNode in project milo by eclipse.

the class VariableNodeLoader method loadNode121.

private void loadNode121() {
    SubscriptionDiagnosticsTypeNode node = new SubscriptionDiagnosticsTypeNode(this.context, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, new QualifiedName(0, "SubscriptionDiagnostics"), new LocalizedText("en", "SubscriptionDiagnostics"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.SubscriptionDiagnosticsDataType, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_SessionId.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_SubscriptionId.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_Priority.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_PublishingInterval.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_MaxKeepAliveCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_MaxLifetimeCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_MaxNotificationsPerPublish.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_PublishingEnabled.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_ModifyCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_EnableCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_DisableCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_RepublishRequestCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_RepublishMessageRequestCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_RepublishMessageCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_TransferRequestCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_TransferredToAltClientCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_TransferredToSameClientCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_PublishRequestCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_DataChangeNotificationsCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_EventNotificationsCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_NotificationsCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_LatePublishRequestCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_CurrentKeepAliveCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_CurrentLifetimeCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_UnacknowledgedMessageCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_DiscardedMessageCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_MonitoredItemCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_DisabledMonitoredItemCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_MonitoringQueueOverflowCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_NextSequenceNumber.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_EventQueueOverflowCount.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasTypeDefinition, Identifiers.SubscriptionDiagnosticsType.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasModellingRule, Identifiers.ModellingRule_ExposesItsArray.expanded(), true));
    node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType.expanded(), false));
    this.nodeManager.addNode(node);
}
Also used : SubscriptionDiagnosticsTypeNode(org.eclipse.milo.opcua.sdk.server.model.nodes.variables.SubscriptionDiagnosticsTypeNode) DataValue(org.eclipse.milo.opcua.stack.core.types.builtin.DataValue) Reference(org.eclipse.milo.opcua.sdk.core.Reference) QualifiedName(org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName) LocalizedText(org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText)

Example 2 with SubscriptionDiagnosticsTypeNode

use of org.eclipse.milo.opcua.sdk.server.model.nodes.variables.SubscriptionDiagnosticsTypeNode in project milo by eclipse.

the class SubscriptionDiagnosticsVariableArray method createSubscriptionDiagnosticsNode.

private void createSubscriptionDiagnosticsNode(Subscription subscription) {
    try {
        int index = subscriptionDiagnosticsVariables.size();
        String id = Util.buildBrowseNamePath(node) + "[" + index + "]";
        NodeId elementNodeId = new NodeId(1, id);
        SubscriptionDiagnosticsTypeNode elementNode = (SubscriptionDiagnosticsTypeNode) nodeFactory.createNode(elementNodeId, Identifiers.SubscriptionDiagnosticsType);
        elementNode.setBrowseName(new QualifiedName(1, subscription.getId().toString()));
        elementNode.setDisplayName(new LocalizedText(node.getDisplayName().getLocale(), subscription.getId().toString()));
        elementNode.setArrayDimensions(null);
        elementNode.setValueRank(ValueRank.Scalar.getValue());
        elementNode.setDataType(Identifiers.SubscriptionDiagnosticsDataType);
        elementNode.setAccessLevel(AccessLevel.toValue(AccessLevel.READ_ONLY));
        elementNode.setUserAccessLevel(AccessLevel.toValue(AccessLevel.READ_ONLY));
        elementNode.addReference(new Reference(elementNode.getNodeId(), Identifiers.HasComponent, node.getNodeId().expanded(), Reference.Direction.INVERSE));
        diagnosticsNodeManager.addNode(elementNode);
        SubscriptionDiagnosticsVariable diagnosticsVariable = new SubscriptionDiagnosticsVariable(elementNode, subscription);
        diagnosticsVariable.startup();
        subscriptionDiagnosticsVariables.add(diagnosticsVariable);
    } catch (UaException e) {
        logger.error("Failed to create SubscriptionDiagnosticsTypeNode for subscription id={}", subscription.getId(), e);
    }
}
Also used : SubscriptionDiagnosticsTypeNode(org.eclipse.milo.opcua.sdk.server.model.nodes.variables.SubscriptionDiagnosticsTypeNode) Reference(org.eclipse.milo.opcua.sdk.core.Reference) UaException(org.eclipse.milo.opcua.stack.core.UaException) QualifiedName(org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName) NodeId(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId) LocalizedText(org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText)

Aggregations

Reference (org.eclipse.milo.opcua.sdk.core.Reference)2 SubscriptionDiagnosticsTypeNode (org.eclipse.milo.opcua.sdk.server.model.nodes.variables.SubscriptionDiagnosticsTypeNode)2 LocalizedText (org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText)2 QualifiedName (org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName)2 UaException (org.eclipse.milo.opcua.stack.core.UaException)1 DataValue (org.eclipse.milo.opcua.stack.core.types.builtin.DataValue)1 NodeId (org.eclipse.milo.opcua.stack.core.types.builtin.NodeId)1