当前位置: 首页>>代码示例>>Java>>正文


Java Identifiers类代码示例

本文整理汇总了Java中com.digitalpetri.opcua.stack.core.Identifiers的典型用法代码示例。如果您正苦于以下问题:Java Identifiers类的具体用法?Java Identifiers怎么用?Java Identifiers使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Identifiers类属于com.digitalpetri.opcua.stack.core包,在下文中一共展示了Identifiers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addProperty

import com.digitalpetri.opcua.stack.core.Identifiers; //导入依赖的package包/类
public void addProperty(UaVariableNode node) {
    addReference(new Reference(
            getNodeId(),
            Identifiers.HasProperty,
            node.getNodeId().expanded(),
            NodeClass.Variable,
            true
    ));

    node.addReference(new Reference(
            node.getNodeId(),
            Identifiers.HasProperty,
            getNodeId().expanded(),
            getNodeClass(),
            false
    ));
}
 
开发者ID:digitalpetri,项目名称:ua-server-sdk,代码行数:18,代码来源:UaNode.java

示例2: removeProperty

import com.digitalpetri.opcua.stack.core.Identifiers; //导入依赖的package包/类
public void removeProperty(UaVariableNode node) {
    removeReference(new Reference(
            getNodeId(),
            Identifiers.HasProperty,
            node.getNodeId().expanded(),
            NodeClass.Variable,
            true
    ));

    node.removeReference(new Reference(
            node.getNodeId(),
            Identifiers.HasProperty,
            getNodeId().expanded(),
            getNodeClass(),
            false
    ));
}
 
开发者ID:digitalpetri,项目名称:ua-server-sdk,代码行数:18,代码来源:UaNode.java

示例3: addComponent

import com.digitalpetri.opcua.stack.core.Identifiers; //导入依赖的package包/类
/**
 * Add a 'HasComponent' reference from this Object to {@code node} and an inverse 'ComponentOf' reference from
 * {@code node} back to this Object.
 *
 * @param node the node to add as a component of this Object.
 */
public void addComponent(UaNode node) {
    addReference(new Reference(
            getNodeId(),
            Identifiers.HasComponent,
            node.getNodeId().expanded(),
            node.getNodeClass(),
            true
    ));

    node.addReference(new Reference(
            node.getNodeId(),
            Identifiers.HasComponent,
            getNodeId().expanded(),
            getNodeClass(),
            false
    ));
}
 
开发者ID:digitalpetri,项目名称:ua-server-sdk,代码行数:24,代码来源:UaObjectNode.java

示例4: removeComponent

import com.digitalpetri.opcua.stack.core.Identifiers; //导入依赖的package包/类
/**
 * Remove the 'HasComponent' reference from this Object to {@code node} and the inverse 'ComponentOf' reference
 * from {@code node} back to this Object.
 *
 * @param node the node to remove as a component of this Object.
 */
public void removeComponent(UaNode node) {
    removeReference(new Reference(
            getNodeId(),
            Identifiers.HasComponent,
            node.getNodeId().expanded(),
            node.getNodeClass(),
            true
    ));

    node.removeReference(new Reference(
            node.getNodeId(),
            Identifiers.HasComponent,
            getNodeId().expanded(),
            getNodeClass(),
            false
    ));
}
 
开发者ID:digitalpetri,项目名称:ua-server-sdk,代码行数:24,代码来源:UaObjectNode.java

示例5: addOrganizes

import com.digitalpetri.opcua.stack.core.Identifiers; //导入依赖的package包/类
/**
 * Add an 'Organizes' reference from this folder to {@code node} and an inverse 'Organized By' reference from
 * {@code node} back to this folder.
 *
 * @param node the node to be organized by this folder.
 */
public void addOrganizes(UaNode node) {
    addReference(new Reference(
            getNodeId(),
            Identifiers.Organizes,
            node.getNodeId().expanded(),
            node.getNodeClass(),
            true
    ));

    node.addReference(new Reference(
            node.getNodeId(),
            Identifiers.Organizes,
            getNodeId().expanded(),
            getNodeClass(),
            false
    ));
}
 
开发者ID:digitalpetri,项目名称:ua-server-sdk,代码行数:24,代码来源:UaFolderNode.java

示例6: removeOrganizes

import com.digitalpetri.opcua.stack.core.Identifiers; //导入依赖的package包/类
/**
 * Remove the 'Organizes' reference from this folder to {@code node} and the inverse 'Organized By' reference from
 * {@code node} back to this folder.
 *
 * @param node the node to be organized by this folder.
 */
public void removeOrganizes(UaNode node) {
    removeReference(new Reference(
            getNodeId(),
            Identifiers.Organizes,
            node.getNodeId().expanded(),
            node.getNodeClass(),
            true
    ));

    node.removeReference(new Reference(
            node.getNodeId(),
            Identifiers.Organizes,
            getNodeId().expanded(),
            getNodeClass(),
            false
    ));
}
 
开发者ID:digitalpetri,项目名称:ua-server-sdk,代码行数:24,代码来源:UaFolderNode.java

示例7: getDataType

import com.digitalpetri.opcua.stack.core.Identifiers; //导入依赖的package包/类
public Optional<NodeId> getDataType() {
    if (value == null) return Optional.empty();

    if (value instanceof UaStructure) {
        return Optional.of(((UaStructure) value).getTypeId());
    } else if (value instanceof UaEnumeration) {
        return Optional.of(Identifiers.Int32);
    } else {
        Class<?> clazz = value.getClass().isArray() ?
                ArrayUtil.getType(value) : value.getClass();

        int typeId = TypeUtil.getBuiltinTypeId(clazz);

        return typeId == -1 ?
                Optional.empty() : Optional.of(new NodeId(0, typeId));
    }
}
 
开发者ID:digitalpetri,项目名称:opc-ua-stack,代码行数:18,代码来源:Variant.java

示例8: UaPropertyNode

import com.digitalpetri.opcua.stack.core.Identifiers; //导入依赖的package包/类
public UaPropertyNode(UaNodeManager nodeManager,
                      NodeId nodeId,
                      QualifiedName browseName,
                      LocalizedText displayName) {

    super(nodeManager, nodeId, browseName, displayName);

    addReference(new Reference(
            nodeId,
            Identifiers.HasTypeDefinition,
            Identifiers.PropertyType.expanded(),
            NodeClass.VariableType,
            true
    ));
}
 
开发者ID:digitalpetri,项目名称:ua-server-sdk,代码行数:16,代码来源:UaPropertyNode.java

示例9: build

import com.digitalpetri.opcua.stack.core.Identifiers; //导入依赖的package包/类
/**
 * Builds the configured {@link UaObjectNode}.
 * <p>
 * The following fields are required: NodeId, NodeClass, BrowseName, DisplayName.
 * <p>
 * Exactly one HasTypeDefinition reference must be present.
 *
 * @return a {@link UaObjectNode}.
 * @throws NullPointerException  if any of the required fields are null.
 * @throws IllegalStateException if exactly one HasTypeDefinition reference is not present.
 */
public UaObjectNode build() {
    Preconditions.checkNotNull(nodeId, "NodeId cannot be null");
    Preconditions.checkNotNull(browseName, "BrowseName cannot be null");
    Preconditions.checkNotNull(displayName, "DisplayName cannot be null");

    long hasTypeDefinitionCount = references.stream()
            .filter(r -> Identifiers.HasTypeDefinition.equals(r.getReferenceTypeId())).count();

    Preconditions.checkState(
            hasTypeDefinitionCount == 1,
            "Object Node must have exactly one HasTypeDefinition reference.");

    // TODO More validation on references.

    UaObjectNode node = new UaObjectNode(
            nodeManager,
            nodeId,
            browseName,
            displayName,
            description,
            writeMask,
            userWriteMask,
            eventNotifier
    );

    node.addReferences(references);

    return node;
}
 
开发者ID:digitalpetri,项目名称:ua-server-sdk,代码行数:41,代码来源:UaObjectNode.java

示例10: setTypeDefinition

import com.digitalpetri.opcua.stack.core.Identifiers; //导入依赖的package包/类
/**
 * Convenience method for adding the required HasTypeDefinition reference.
 * <p>
 * {@link #setNodeId(NodeId)} must have already been called before invoking this method.
 *
 * @param typeDefinition The {@link NodeId} of the TypeDefinition.
 * @return this {@link UaObjectNodeBuilder}.
 */
public UaObjectNodeBuilder setTypeDefinition(NodeId typeDefinition) {
    Objects.requireNonNull(nodeId, "NodeId cannot be null");

    references.add(new Reference(
            nodeId,
            Identifiers.HasTypeDefinition,
            new ExpandedNodeId(typeDefinition),
            NodeClass.ObjectType,
            true
    ));

    return this;
}
 
开发者ID:digitalpetri,项目名称:ua-server-sdk,代码行数:22,代码来源:UaObjectNode.java

示例11: build

import com.digitalpetri.opcua.stack.core.Identifiers; //导入依赖的package包/类
public UaVariableNode build() {
    Preconditions.checkNotNull(nodeId, "NodeId cannot be null");
    Preconditions.checkNotNull(browseName, "BrowseName cannot be null");
    Preconditions.checkNotNull(displayName, "DisplayName cannot be null");
    Preconditions.checkNotNull(dataType, "DataType cannot be null");

    long hasTypeDefinitionCount = references.stream()
            .filter(r -> Identifiers.HasTypeDefinition.equals(r.getReferenceTypeId())).count();

    if (hasTypeDefinitionCount == 0) {
        setTypeDefinition(Identifiers.BaseDataVariableType);
    } else {
        Preconditions.checkState(
                hasTypeDefinitionCount == 1,
                "Variable Node must have exactly one HasTypeDefinition reference.");
    }

    // TODO More validation on references.

    UaVariableNode node = new UaVariableNode(
            nodeManager,
            nodeId, browseName, displayName,
            description, writeMask, userWriteMask,
            value, dataType, valueRank,
            arrayDimensions, accessLevel,
            userAccessLevel, minimumSamplingInterval,
            historizing
    );

    node.addReferences(references);

    return node;
}
 
开发者ID:digitalpetri,项目名称:ua-server-sdk,代码行数:34,代码来源:UaVariableNode.java

示例12: setTypeDefinition

import com.digitalpetri.opcua.stack.core.Identifiers; //导入依赖的package包/类
/**
 * Convenience method for adding the required HasTypeDefinition reference.
 * <p>
 * {@link #setNodeId(NodeId)} must have already been called before invoking this method.
 *
 * @param typeDefinition The {@link NodeId} of the TypeDefinition.
 * @return this {@link UaVariableNodeBuilder}.
 */
public UaVariableNodeBuilder setTypeDefinition(NodeId typeDefinition) {
    Objects.requireNonNull(nodeId, "NodeId cannot be null");

    references.add(new Reference(
            nodeId,
            Identifiers.HasTypeDefinition,
            new ExpandedNodeId(typeDefinition),
            NodeClass.VariableType,
            true
    ));

    return this;
}
 
开发者ID:digitalpetri,项目名称:ua-server-sdk,代码行数:22,代码来源:UaVariableNode.java

示例13: UaFolderNode

import com.digitalpetri.opcua.stack.core.Identifiers; //导入依赖的package包/类
public UaFolderNode(UaNodeManager nodeManager, NodeId nodeId, QualifiedName browseName, LocalizedText displayName) {
    super(nodeManager, nodeId, browseName, displayName);

    addReference(new Reference(
            getNodeId(),
            Identifiers.HasTypeDefinition,
            Identifiers.FolderType.expanded(),
            NodeClass.ObjectType,
            true
    ));
}
 
开发者ID:digitalpetri,项目名称:ua-server-sdk,代码行数:12,代码来源:UaFolderNode.java

示例14: getTypeDefinition

import com.digitalpetri.opcua.stack.core.Identifiers; //导入依赖的package包/类
private CompletableFuture<ExpandedNodeId> getTypeDefinition(NodeId nodeId) {
    Namespace namespace = server.getNamespaceManager().getNamespace(nodeId.getNamespaceIndex());

    return namespace.getReferences(nodeId).thenApply(references ->
            references.stream()
                    .filter(r -> Identifiers.HasTypeDefinition.equals(r.getReferenceTypeId()))
                    .findFirst()
                    .map(Reference::getTargetNodeId)
                    .orElse(ExpandedNodeId.NULL_VALUE));
}
 
开发者ID:digitalpetri,项目名称:ua-server-sdk,代码行数:11,代码来源:BrowseHelper.java

示例15: replaceServerArrayNode

import com.digitalpetri.opcua.stack.core.Identifiers; //导入依赖的package包/类
private void replaceServerArrayNode() {
    UaVariableNode originalNode = (UaVariableNode) nodeManager.get(Identifiers.Server_ServerArray);

    UaVariableNode derived = new DerivedVariableNode(nodeManager, originalNode) {
        @Override
        public DataValue getValue() {
            return new DataValue(new Variant(server.getServerTable().toArray()));
        }
    };

    nodeManager.put(derived.getNodeId(), derived);
}
 
开发者ID:digitalpetri,项目名称:ua-server-sdk,代码行数:13,代码来源:OpcUaNamespace.java


注:本文中的com.digitalpetri.opcua.stack.core.Identifiers类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。