Search in sources :

Example 1 with ObjectNode

use of org.eclipse.milo.opcua.sdk.core.nodes.ObjectNode in project milo by eclipse.

the class UaMethodNode method getModellingRuleNode.

public Optional<ObjectNode> getModellingRuleNode() {
    Node node = getReferences().stream().filter(HAS_MODELLING_RULE_PREDICATE).findFirst().flatMap(r -> getManagedNode(r.getTargetNodeId())).orElse(null);
    ObjectNode objectNode = (node instanceof ObjectNode) ? (ObjectNode) node : null;
    return Optional.ofNullable(objectNode);
}
Also used : ObjectNode(org.eclipse.milo.opcua.sdk.core.nodes.ObjectNode) NodeManager(org.eclipse.milo.opcua.sdk.server.api.NodeManager) AttributeFilterChain(org.eclipse.milo.opcua.sdk.server.nodes.filters.AttributeFilterChain) MethodNode(org.eclipse.milo.opcua.sdk.core.nodes.MethodNode) Function(java.util.function.Function) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) QualifiedName(org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName) Argument(org.eclipse.milo.opcua.stack.core.types.structured.Argument) AttributeFilter(org.eclipse.milo.opcua.sdk.server.nodes.filters.AttributeFilter) AttributeId(org.eclipse.milo.opcua.stack.core.AttributeId) Reference(org.eclipse.milo.opcua.sdk.core.Reference) NodeId(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId) UInteger(org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger) LocalizedText(org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText) ALWAYS_GENERATES_EVENT_PREDICATE(org.eclipse.milo.opcua.sdk.core.Reference.ALWAYS_GENERATES_EVENT_PREDICATE) Collectors(java.util.stream.Collectors) MethodInvocationHandler(org.eclipse.milo.opcua.sdk.server.api.methods.MethodInvocationHandler) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) NodeClass(org.eclipse.milo.opcua.stack.core.types.enumerated.NodeClass) HAS_PROPERTY_PREDICATE(org.eclipse.milo.opcua.sdk.core.Reference.HAS_PROPERTY_PREDICATE) Optional(java.util.Optional) Node(org.eclipse.milo.opcua.sdk.core.nodes.Node) StreamUtil.opt2stream(org.eclipse.milo.opcua.sdk.core.util.StreamUtil.opt2stream) Preconditions(com.google.common.base.Preconditions) MethodNodeProperties(org.eclipse.milo.opcua.sdk.core.nodes.MethodNodeProperties) HAS_MODELLING_RULE_PREDICATE(org.eclipse.milo.opcua.sdk.core.Reference.HAS_MODELLING_RULE_PREDICATE) ObjectNode(org.eclipse.milo.opcua.sdk.core.nodes.ObjectNode) ObjectNode(org.eclipse.milo.opcua.sdk.core.nodes.ObjectNode) MethodNode(org.eclipse.milo.opcua.sdk.core.nodes.MethodNode) Node(org.eclipse.milo.opcua.sdk.core.nodes.Node)

Example 2 with ObjectNode

use of org.eclipse.milo.opcua.sdk.core.nodes.ObjectNode in project milo by eclipse.

the class UaVariableNode method getModellingRuleNode.

public Optional<ObjectNode> getModellingRuleNode() {
    Node node = getReferences().stream().filter(HAS_MODELLING_RULE_PREDICATE).findFirst().flatMap(r -> getManagedNode(r.getTargetNodeId())).orElse(null);
    ObjectNode objectNode = (node instanceof ObjectNode) ? (ObjectNode) node : null;
    return Optional.ofNullable(objectNode);
}
Also used : ValueRanks(org.eclipse.milo.opcua.sdk.core.ValueRanks) ObjectNode(org.eclipse.milo.opcua.sdk.core.nodes.ObjectNode) NodeManager(org.eclipse.milo.opcua.sdk.server.api.NodeManager) VariableNode(org.eclipse.milo.opcua.sdk.core.nodes.VariableNode) DataValue(org.eclipse.milo.opcua.stack.core.types.builtin.DataValue) AttributeFilterChain(org.eclipse.milo.opcua.sdk.server.nodes.filters.AttributeFilterChain) ByteString(org.eclipse.milo.opcua.stack.core.types.builtin.ByteString) VariableTypeNode(org.eclipse.milo.opcua.sdk.core.nodes.VariableTypeNode) DateTime(org.eclipse.milo.opcua.stack.core.types.builtin.DateTime) Function(java.util.function.Function) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) AccessLevel(org.eclipse.milo.opcua.sdk.core.AccessLevel) QualifiedName(org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName) AttributeFilter(org.eclipse.milo.opcua.sdk.server.nodes.filters.AttributeFilter) HAS_TYPE_DEFINITION_PREDICATE(org.eclipse.milo.opcua.sdk.core.Reference.HAS_TYPE_DEFINITION_PREDICATE) VariableNodeProperties(org.eclipse.milo.opcua.sdk.core.nodes.VariableNodeProperties) AttributeId(org.eclipse.milo.opcua.stack.core.AttributeId) Reference(org.eclipse.milo.opcua.sdk.core.Reference) StatusCodes(org.eclipse.milo.opcua.stack.core.StatusCodes) NodeId(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId) UByte(org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UByte) HAS_COMPONENT_PREDICATE(org.eclipse.milo.opcua.sdk.core.Reference.HAS_COMPONENT_PREDICATE) UInteger(org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger) EUInformation(org.eclipse.milo.opcua.stack.core.types.structured.EUInformation) Set(java.util.Set) LocalizedText(org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) Variant(org.eclipse.milo.opcua.stack.core.types.builtin.Variant) NodeClass(org.eclipse.milo.opcua.stack.core.types.enumerated.NodeClass) HAS_PROPERTY_PREDICATE(org.eclipse.milo.opcua.sdk.core.Reference.HAS_PROPERTY_PREDICATE) StatusCode(org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode) TimeZoneDataType(org.eclipse.milo.opcua.stack.core.types.structured.TimeZoneDataType) Optional(java.util.Optional) Node(org.eclipse.milo.opcua.sdk.core.nodes.Node) StreamUtil.opt2stream(org.eclipse.milo.opcua.sdk.core.util.StreamUtil.opt2stream) Preconditions(com.google.common.base.Preconditions) HAS_MODELLING_RULE_PREDICATE(org.eclipse.milo.opcua.sdk.core.Reference.HAS_MODELLING_RULE_PREDICATE) Identifiers(org.eclipse.milo.opcua.stack.core.Identifiers) ObjectNode(org.eclipse.milo.opcua.sdk.core.nodes.ObjectNode) ObjectNode(org.eclipse.milo.opcua.sdk.core.nodes.ObjectNode) VariableNode(org.eclipse.milo.opcua.sdk.core.nodes.VariableNode) VariableTypeNode(org.eclipse.milo.opcua.sdk.core.nodes.VariableTypeNode) Node(org.eclipse.milo.opcua.sdk.core.nodes.Node)

Aggregations

Preconditions (com.google.common.base.Preconditions)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Optional (java.util.Optional)2 Function (java.util.function.Function)2 Supplier (java.util.function.Supplier)2 Collectors (java.util.stream.Collectors)2 Reference (org.eclipse.milo.opcua.sdk.core.Reference)2 HAS_MODELLING_RULE_PREDICATE (org.eclipse.milo.opcua.sdk.core.Reference.HAS_MODELLING_RULE_PREDICATE)2 HAS_PROPERTY_PREDICATE (org.eclipse.milo.opcua.sdk.core.Reference.HAS_PROPERTY_PREDICATE)2 Node (org.eclipse.milo.opcua.sdk.core.nodes.Node)2 ObjectNode (org.eclipse.milo.opcua.sdk.core.nodes.ObjectNode)2 StreamUtil.opt2stream (org.eclipse.milo.opcua.sdk.core.util.StreamUtil.opt2stream)2 NodeManager (org.eclipse.milo.opcua.sdk.server.api.NodeManager)2 AttributeFilter (org.eclipse.milo.opcua.sdk.server.nodes.filters.AttributeFilter)2 AttributeFilterChain (org.eclipse.milo.opcua.sdk.server.nodes.filters.AttributeFilterChain)2 AttributeId (org.eclipse.milo.opcua.stack.core.AttributeId)2 LocalizedText (org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText)2 NodeId (org.eclipse.milo.opcua.stack.core.types.builtin.NodeId)2 QualifiedName (org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName)2