本文整理汇总了Java中org.eclipse.milo.opcua.sdk.server.OpcUaServer类的典型用法代码示例。如果您正苦于以下问题:Java OpcUaServer类的具体用法?Java OpcUaServer怎么用?Java OpcUaServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OpcUaServer类属于org.eclipse.milo.opcua.sdk.server包,在下文中一共展示了OpcUaServer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: 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
示例2: 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
示例3: 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
示例4: 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
示例5: 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
示例6: 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
示例7: 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
示例8: 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
示例9: 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
示例10: 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
示例11: 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
示例12: 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
示例13: 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
示例14: 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
示例15: 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
示例16: browseNext
import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
public void browseNext(ServiceRequest<BrowseNextRequest, BrowseNextResponse> service) {
OpcUaServer server = service.attr(ServiceAttributes.SERVER_KEY).get();
BrowseNextRequest request = service.getRequest();
List<ByteString> continuationPoints = l(request.getContinuationPoints());
if (continuationPoints.size() >
server.getConfig().getLimits().getMaxBrowseContinuationPoints().intValue()) {
service.setServiceFault(StatusCodes.Bad_TooManyOperations);
} else {
server.getExecutorService().execute(new BrowseNext(server, service));
}
}
开发者ID:eclipse,项目名称:milo,代码行数:16,代码来源:BrowseHelper.java
示例17: Browse
import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
private Browse(AccessContext context,
OpcUaServer server,
UInteger maxReferencesPerNode,
BrowseDescription browseDescription) {
this.context = context;
this.browseDescription = browseDescription;
this.maxReferencesPerNode = maxReferencesPerNode;
this.server = server;
}
开发者ID:eclipse,项目名称:milo,代码行数:11,代码来源:BrowseHelper.java
示例18: VendorNamespace
import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
public VendorNamespace(OpcUaServer server, String namespaceUri) {
this.server = server;
this.namespaceUri = namespaceUri;
nodeMap = server.getNodeMap();
subscriptionModel = new SubscriptionModel(server, this);
addVendorServerInfoNodes();
}
开发者ID:eclipse,项目名称:milo,代码行数:10,代码来源:VendorNamespace.java
示例19: OpcUaNamespace
import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
public OpcUaNamespace(OpcUaServer server) {
this.server = server;
nodeMap = server.getNodeMap();
subscriptionModel = new SubscriptionModel(server, this);
loadNodes();
configureServerObject();
}
开发者ID:eclipse,项目名称:milo,代码行数:10,代码来源:OpcUaNamespace.java
示例20: ExampleNamespace
import org.eclipse.milo.opcua.sdk.server.OpcUaServer; //导入依赖的package包/类
public ExampleNamespace(OpcUaServer server, UShort namespaceIndex) {
this.server = server;
this.namespaceIndex = namespaceIndex;
subscriptionModel = new SubscriptionModel(server, this);
try {
// Create a "HelloWorld" folder and add it to the node manager
NodeId folderNodeId = new NodeId(namespaceIndex, "HelloWorld");
UaFolderNode folderNode = new UaFolderNode(
server.getNodeMap(),
folderNodeId,
new QualifiedName(namespaceIndex, "HelloWorld"),
LocalizedText.english("HelloWorld")
);
server.getNodeMap().addNode(folderNode);
// Make sure our new folder shows up under the server's Objects folder
server.getUaNamespace().addReference(
Identifiers.ObjectsFolder,
Identifiers.Organizes,
true,
folderNodeId.expanded(),
NodeClass.Object
);
// Add the rest of the nodes
addVariableNodes(folderNode);
addMethodNode(folderNode);
} catch (UaException e) {
logger.error("Error adding nodes: {}", e.getMessage(), e);
}
}
开发者ID:streamsets,项目名称:datacollector,代码行数:37,代码来源:ExampleNamespace.java
注:本文中的org.eclipse.milo.opcua.sdk.server.OpcUaServer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论