Search in sources :

Example 1 with UaMethodNode

use of org.eclipse.milo.opcua.sdk.server.nodes.UaMethodNode in project milo by eclipse.

the class ExampleNamespace method addGenerateEventMethod.

private void addGenerateEventMethod(UaFolderNode folderNode) {
    UaMethodNode methodNode = UaMethodNode.builder(getNodeContext()).setNodeId(newNodeId("HelloWorld/generateEvent(eventTypeId)")).setBrowseName(newQualifiedName("generateEvent(eventTypeId)")).setDisplayName(new LocalizedText(null, "generateEvent(eventTypeId)")).setDescription(LocalizedText.english("Generate an Event with the TypeDefinition indicated by eventTypeId.")).build();
    GenerateEventMethod generateEventMethod = new GenerateEventMethod(methodNode);
    methodNode.setInputArguments(generateEventMethod.getInputArguments());
    methodNode.setOutputArguments(generateEventMethod.getOutputArguments());
    methodNode.setInvocationHandler(generateEventMethod);
    getNodeManager().addNode(methodNode);
    methodNode.addReference(new Reference(methodNode.getNodeId(), Identifiers.HasComponent, folderNode.getNodeId().expanded(), false));
}
Also used : UaMethodNode(org.eclipse.milo.opcua.sdk.server.nodes.UaMethodNode) Reference(org.eclipse.milo.opcua.sdk.core.Reference) GenerateEventMethod(org.eclipse.milo.examples.server.methods.GenerateEventMethod) LocalizedText(org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText)

Example 2 with UaMethodNode

use of org.eclipse.milo.opcua.sdk.server.nodes.UaMethodNode in project milo by eclipse.

the class MethodNodeLoader method loadNode116.

private void loadNode116() {
    UaMethodNode node = new UaMethodNode(this.context, Identifiers.ProgramStateMachineType_Resume, new QualifiedName(0, "Resume"), new LocalizedText("en", "Resume"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), true, true);
    node.addReference(new Reference(Identifiers.ProgramStateMachineType_Resume, Identifiers.HasCause, Identifiers.ProgramStateMachineType_SuspendedToRunning.expanded(), false));
    node.addReference(new Reference(Identifiers.ProgramStateMachineType_Resume, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));
    node.addReference(new Reference(Identifiers.ProgramStateMachineType_Resume, Identifiers.HasComponent, Identifiers.ProgramStateMachineType.expanded(), false));
    this.nodeManager.addNode(node);
}
Also used : UaMethodNode(org.eclipse.milo.opcua.sdk.server.nodes.UaMethodNode) 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 3 with UaMethodNode

use of org.eclipse.milo.opcua.sdk.server.nodes.UaMethodNode in project milo by eclipse.

the class MethodNodeLoader method loadNode13.

private void loadNode13() {
    UaMethodNode node = new UaMethodNode(this.context, Identifiers.ServerConfiguration_CertificateGroups_DefaultApplicationGroup_TrustList_AddCertificate, new QualifiedName(0, "AddCertificate"), new LocalizedText("en", "AddCertificate"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), true, true);
    node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultApplicationGroup_TrustList_AddCertificate, Identifiers.HasProperty, Identifiers.ServerConfiguration_CertificateGroups_DefaultApplicationGroup_TrustList_AddCertificate_InputArguments.expanded(), true));
    node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultApplicationGroup_TrustList_AddCertificate, Identifiers.HasComponent, Identifiers.ServerConfiguration_CertificateGroups_DefaultApplicationGroup_TrustList.expanded(), false));
    this.nodeManager.addNode(node);
}
Also used : UaMethodNode(org.eclipse.milo.opcua.sdk.server.nodes.UaMethodNode) 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 4 with UaMethodNode

use of org.eclipse.milo.opcua.sdk.server.nodes.UaMethodNode in project milo by eclipse.

the class MethodNodeLoader method loadNode123.

private void loadNode123() {
    UaMethodNode node = new UaMethodNode(this.context, Identifiers.Server_GetMonitoredItems, new QualifiedName(0, "GetMonitoredItems"), new LocalizedText("en", "GetMonitoredItems"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), true, true);
    node.addReference(new Reference(Identifiers.Server_GetMonitoredItems, Identifiers.HasProperty, Identifiers.Server_GetMonitoredItems_InputArguments.expanded(), true));
    node.addReference(new Reference(Identifiers.Server_GetMonitoredItems, Identifiers.HasProperty, Identifiers.Server_GetMonitoredItems_OutputArguments.expanded(), true));
    node.addReference(new Reference(Identifiers.Server_GetMonitoredItems, Identifiers.HasComponent, Identifiers.Server.expanded(), false));
    this.nodeManager.addNode(node);
}
Also used : UaMethodNode(org.eclipse.milo.opcua.sdk.server.nodes.UaMethodNode) 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 5 with UaMethodNode

use of org.eclipse.milo.opcua.sdk.server.nodes.UaMethodNode in project milo by eclipse.

the class OpcUaNamespace method configureGetMonitoredItems.

private void configureGetMonitoredItems() {
    UaNode node = getNodeManager().get(Identifiers.Server_GetMonitoredItems);
    if (node instanceof UaMethodNode) {
        UaMethodNode methodNode = (UaMethodNode) node;
        configureMethodNode(methodNode, GetMonitoredItemsMethodImpl::new);
    } else {
        logger.warn("GetMonitoredItems UaMethodNode not found.");
    }
}
Also used : UaMethodNode(org.eclipse.milo.opcua.sdk.server.nodes.UaMethodNode) UaNode(org.eclipse.milo.opcua.sdk.server.nodes.UaNode)

Aggregations

UaMethodNode (org.eclipse.milo.opcua.sdk.server.nodes.UaMethodNode)158 Reference (org.eclipse.milo.opcua.sdk.core.Reference)151 LocalizedText (org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText)150 QualifiedName (org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName)145 UaNode (org.eclipse.milo.opcua.sdk.server.nodes.UaNode)5 UaObjectNode (org.eclipse.milo.opcua.sdk.server.nodes.UaObjectNode)4 UaObjectTypeNode (org.eclipse.milo.opcua.sdk.server.nodes.UaObjectTypeNode)3 UaVariableNode (org.eclipse.milo.opcua.sdk.server.nodes.UaVariableNode)3 NodeId (org.eclipse.milo.opcua.stack.core.types.builtin.NodeId)3 ObjectTypeNode (org.eclipse.milo.opcua.sdk.core.nodes.ObjectTypeNode)2 VariableTypeNode (org.eclipse.milo.opcua.sdk.core.nodes.VariableTypeNode)2 UaVariableTypeNode (org.eclipse.milo.opcua.sdk.server.nodes.UaVariableTypeNode)2 UaException (org.eclipse.milo.opcua.stack.core.UaException)2 ExpandedNodeId (org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId)2 Arrays (java.util.Arrays)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Optional (java.util.Optional)1 ExecutionException (java.util.concurrent.ExecutionException)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1