當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。