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


Java OpcUaServer类代码示例

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


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

示例1: onUnregisterNodes

import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
@Override
public void onUnregisterNodes(
    ServiceRequest<UnregisterNodesRequest, UnregisterNodesResponse> service) throws UaException {

    OpcUaServer server = service.attr(ServiceAttributes.SERVER_KEY).get();

    UnregisterNodesRequest request = service.getRequest();

    List<NodeId> nodeIds = l(request.getNodesToUnregister());

    if (nodeIds.isEmpty()) {
        throw new UaException(StatusCodes.Bad_NothingToDo);
    }

    if (nodeIds.size() > server.getConfig().getLimits().getMaxNodesPerRegisterNodes().intValue()) {
        throw new UaException(StatusCodes.Bad_TooManyOperations);
    }

    service.setResponse(new UnregisterNodesResponse(service.createResponseHeader(StatusCode.GOOD)));
}
 
开发者ID:eclipse,项目名称:milo,代码行数:21,代码来源:ViewServices.java

示例2: onTranslateBrowsePaths

import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
@Override
public void onTranslateBrowsePaths(
    ServiceRequest<TranslateBrowsePathsToNodeIdsRequest, TranslateBrowsePathsToNodeIdsResponse> service) {

    translateBrowsePathsCounter.record(service);

    OpcUaServer server = service.attr(ServiceAttributes.SERVER_KEY).get();
    Session session = service.attr(ServiceAttributes.SESSION_KEY).get();
    NamespaceManager namespaceManager = server.getNamespaceManager();

    BrowsePathsHelper browsePathsHelper = new BrowsePathsHelper(
        () -> Optional.ofNullable(session),
        server,
        namespaceManager
    );

    browsePathsHelper.onTranslateBrowsePaths(service);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:19,代码来源:ViewServices.java

示例3: onRegisterNodes

import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
@Override
public void onRegisterNodes(
    ServiceRequest<RegisterNodesRequest, RegisterNodesResponse> service) throws UaException {

    OpcUaServer server = service.attr(ServiceAttributes.SERVER_KEY).get();

    RegisterNodesRequest request = service.getRequest();

    List<NodeId> nodeIds = l(request.getNodesToRegister());

    if (nodeIds.isEmpty()) {
        throw new UaException(StatusCodes.Bad_NothingToDo);
    }

    if (nodeIds.size() > server.getConfig().getLimits().getMaxNodesPerRegisterNodes().intValue()) {
        throw new UaException(StatusCodes.Bad_TooManyOperations);
    }

    service.setResponse(new RegisterNodesResponse(
        service.createResponseHeader(StatusCode.GOOD),
        a(nodeIds, NodeId.class)
    ));
}
 
开发者ID:eclipse,项目名称:milo,代码行数:24,代码来源:ViewServices.java

示例4: doStart

import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
@Override
protected void doStart() throws Exception {
	this.server = new OpcUaServer(buildServerConfig());

	this.namespace = this.server.getNamespaceManager().registerAndAdd(this.namespaceUri,
			index -> new CamelNamespace(index, this.namespaceUri, this.server));

	super.doStart();
	this.server.startup();
}
 
开发者ID:ctron,项目名称:de.dentrassi.camel.milo,代码行数:11,代码来源:MiloServerComponent.java

示例5: onTranslateBrowsePaths

import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
public void onTranslateBrowsePaths(
    ServiceRequest<TranslateBrowsePathsToNodeIdsRequest, TranslateBrowsePathsToNodeIdsResponse> service) {

    OpcUaServer server = service.attr(ServiceAttributes.SERVER_KEY).get();

    List<BrowsePath> browsePaths = l(service.getRequest().getBrowsePaths());

    if (browsePaths.size() >
        server.getConfig().getLimits().getMaxNodesPerTranslateBrowsePathsToNodeIds().intValue()) {

        service.setServiceFault(StatusCodes.Bad_TooManyOperations);
    } else {
        List<CompletableFuture<BrowsePathResult>> futures = newArrayListWithCapacity(browsePaths.size());

        for (BrowsePath browsePath : browsePaths) {
            futures.add(translate(browsePath));
        }

        sequence(futures).thenAcceptAsync(results -> {
            ResponseHeader header = service.createResponseHeader();
            TranslateBrowsePathsToNodeIdsResponse response = new TranslateBrowsePathsToNodeIdsResponse(
                header, a(results, BrowsePathResult.class), new DiagnosticInfo[0]);

            service.setResponse(response);
        }, server.getExecutorService());
    }
}
 
开发者ID:eclipse,项目名称:milo,代码行数:28,代码来源:BrowsePathsHelper.java

示例6: CustomNamespace

import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
public CustomNamespace(final UShort index, final OpcUaServer server) {
    this.index = index;
    this.nodeMap = server.getNodeMap();
    this.subscriptionModel = new SubscriptionModel(server, this);

    registerItems();
}
 
开发者ID:ctron,项目名称:milo-ece2017,代码行数:8,代码来源:CustomNamespace.java

示例7: TestNamespace

import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
public TestNamespace(OpcUaServer server, UShort namespaceIndex) {
    this.server = server;
    this.namespaceIndex = namespaceIndex;

    nodeManager = server.getNodeMap();

    NodeId testFolderNodeId = new NodeId(namespaceIndex, "Test");

    testFolder = new UaFolderNode(
        nodeManager,
        testFolderNodeId,
        new QualifiedName(namespaceIndex, "Test"),
        LocalizedText.english("Test")
    );

    nodeManager.put(testFolderNodeId, testFolder);

    try {
        server.getUaNamespace().addReference(
            Identifiers.ObjectsFolder,
            Identifiers.Organizes,
            true,
            testFolderNodeId.expanded(),
            NodeClass.Object
        );
    } catch (UaException e) {
        logger.error("Error adding reference to Connections folder.", e);
    }

    subscriptionModel = new SubscriptionModel(server, this);

    addStaticScalarNodes();
}
 
开发者ID:eclipse,项目名称:milo,代码行数:34,代码来源:TestNamespace.java

示例8: browse

import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
default void browse(BrowseContext context,
                    ViewDescription view,
                    UInteger maxReferencesPerNode,
                    List<BrowseDescription> nodesToBrowse) {

    OpcUaServer server = context.getServer();

    List<CompletableFuture<BrowseResult>> futures = nodesToBrowse.stream()
        .map(browseDescription ->
            BrowseHelper.browse(context, server, view, maxReferencesPerNode, browseDescription))
        .collect(toList());

    FutureUtils.sequence(futures).thenAccept(context::complete);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:15,代码来源:ViewManager.java

示例9: BrowseContext

import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
public BrowseContext(OpcUaServer server,
                     @Nullable Session session,
                     CompletableFuture<List<BrowseResult>> future,
                     DiagnosticsContext<BrowseDescription> diagnosticsContext) {

    super(server, session, future, diagnosticsContext);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:8,代码来源:ViewManager.java

示例10: OperationContext

import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
public OperationContext(OpcUaServer server,
                        @Nullable Session session,
                        CompletableFuture<List<U>> future,
                        DiagnosticsContext<T> diagnosticsContext) {

    this.server = server;
    this.session = session;
    this.future = future;
    this.diagnostics = diagnosticsContext;
}
 
开发者ID:eclipse,项目名称:milo,代码行数:11,代码来源:OperationContext.java

示例11: ReadContext

import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
public ReadContext(OpcUaServer server,
                   @Nullable Session session,
                   CompletableFuture<List<DataValue>> future,
                   DiagnosticsContext<ReadValueId> diagnosticsContext) {

    super(server, session, future, diagnosticsContext);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:8,代码来源:AttributeManager.java

示例12: WriteContext

import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
public WriteContext(OpcUaServer server,
                    @Nullable Session session,
                    CompletableFuture<List<StatusCode>> future,
                    DiagnosticsContext<WriteValue> diagnosticsContext) {

    super(server, session, future, diagnosticsContext);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:8,代码来源:AttributeManager.java

示例13: HistoryReadContext

import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
public HistoryReadContext(OpcUaServer server,
                          @Nullable Session session,
                          CompletableFuture<List<HistoryReadResult>> future,
                          DiagnosticsContext<HistoryReadValueId> diagnosticsContext) {

    super(server, session, future, diagnosticsContext);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:8,代码来源:AttributeHistoryManager.java

示例14: HistoryUpdateContext

import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
public HistoryUpdateContext(OpcUaServer server,
                            @Nullable Session session,
                            CompletableFuture<List<HistoryUpdateResult>> future,
                            DiagnosticsContext<HistoryUpdateDetails> diagnosticsContext) {

    super(server, session, future, diagnosticsContext);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:8,代码来源:AttributeHistoryManager.java

示例15: CallContext

import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
public CallContext(OpcUaServer server,
                   @Nullable Session session,
                   CompletableFuture<List<CallMethodResult>> future,
                   DiagnosticsContext<CallMethodRequest> diagnosticsContext) {

    super(server, session, future, diagnosticsContext);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:8,代码来源:MethodServices.java


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