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


Java QualifiedName.NULL_VALUE属性代码示例

本文整理汇总了Java中com.digitalpetri.opcua.stack.core.types.builtin.QualifiedName.NULL_VALUE属性的典型用法代码示例。如果您正苦于以下问题:Java QualifiedName.NULL_VALUE属性的具体用法?Java QualifiedName.NULL_VALUE怎么用?Java QualifiedName.NULL_VALUE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.digitalpetri.opcua.stack.core.types.builtin.QualifiedName的用法示例。


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

示例1: decodeQualifiedName

@Override
public QualifiedName decodeQualifiedName(String field) {
    if (nextStartElement(field)) {
        UShort namespaceIndex = Unsigned.ushort(0);
        String name = "";

        if (nextStartElement("NamespaceIndex")) {
            namespaceIndex = decodeUInt16(null);
            requireNextEndElement("NamespaceIndex");
        }

        if (nextStartElement("Name")) {
            name = decodeString(null);
            requireNextEndElement("Name");
        }

        requireNextEndElement(field);

        return new QualifiedName(namespaceIndex, name);
    } else {
        return QualifiedName.NULL_VALUE;
    }
}
 
开发者ID:digitalpetri,项目名称:opc-ua-stack,代码行数:23,代码来源:XmlDecoder.java

示例2: readEventAttributes

private CompletableFuture<EventAttributes> readEventAttributes(Namespace namespace, NodeId nodeId) {
    Function<AttributeId, ReadValueId> f = id ->
            new ReadValueId(nodeId, id.uid(), null, QualifiedName.NULL_VALUE);

    CompletableFuture<List<DataValue>> future = new CompletableFuture<>();

    ReadContext readContext = new ReadContext(
            server, null, future, new DiagnosticsContext<>());

    List<ReadValueId> readValueIds = newArrayList(
            f.apply(AttributeId.AccessLevel),
            f.apply(AttributeId.UserAccessLevel),
            f.apply(AttributeId.EventNotifier));

    namespace.read(readContext, 0.0, TimestampsToReturn.Neither, readValueIds);

    return future.thenApply(values -> {
        UByte accessLevel = Optional.ofNullable((UByte) values.get(0).getValue().getValue()).orElse(ubyte(1));
        UByte userAccessLevel = Optional.ofNullable((UByte) values.get(1).getValue().getValue()).orElse(ubyte(1));
        Optional<UByte> eventNotifier = Optional.ofNullable((UByte) values.get(2).getValue().getValue());

        return new EventAttributes(
                AccessLevel.fromMask(accessLevel),
                AccessLevel.fromMask(userAccessLevel),
                eventNotifier);
    });
}
 
开发者ID:digitalpetri,项目名称:ua-server-sdk,代码行数:27,代码来源:SubscriptionManager.java

示例3: encodeQualifiedName

@Override
public void encodeQualifiedName(String field, QualifiedName value) throws UaSerializationException {
    if (value == null) value = QualifiedName.NULL_VALUE;

    encodeUInt16(null, value.getNamespaceIndex());
    encodeString(null, value.getName());
}
 
开发者ID:digitalpetri,项目名称:opc-ua-stack,代码行数:7,代码来源:BinaryEncoder.java

示例4: readDataAttributes

private CompletableFuture<List<DataValue>> readDataAttributes(Namespace namespace, NodeId itemId) {

        Function<AttributeId, ReadValueId> f = id ->
                new ReadValueId(itemId, id.uid(), null, QualifiedName.NULL_VALUE);

        CompletableFuture<List<DataValue>> future = new CompletableFuture<>();

        ReadContext readContext = new ReadContext(
                server, null, future, new DiagnosticsContext<>());

        List<ReadValueId> attributes = newArrayList(
                f.apply(AttributeId.AccessLevel),
                f.apply(AttributeId.UserAccessLevel),
                f.apply(AttributeId.MinimumSamplingInterval));

        namespace.read(readContext, 0.0, TimestampsToReturn.Neither, attributes);

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


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