Search in sources :

Example 1 with GenerateEventMethod

use of org.eclipse.milo.examples.server.methods.GenerateEventMethod 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)

Aggregations

GenerateEventMethod (org.eclipse.milo.examples.server.methods.GenerateEventMethod)1 Reference (org.eclipse.milo.opcua.sdk.core.Reference)1 UaMethodNode (org.eclipse.milo.opcua.sdk.server.nodes.UaMethodNode)1 LocalizedText (org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText)1