本文整理汇总了Java中org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo类的典型用法代码示例。如果您正苦于以下问题:Java BuildInfo类的具体用法?Java BuildInfo怎么用?Java BuildInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BuildInfo类属于org.eclipse.milo.opcua.stack.core.types.structured包,在下文中一共展示了BuildInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OpcUaServerConfigImpl
import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo; //导入依赖的package包/类
public OpcUaServerConfigImpl(UaTcpStackServerConfig stackServerConfig,
int bindPort,
List<String> bindAddresses,
List<String> endpointAddresses,
EnumSet<SecurityPolicy> securityPolicies,
IdentityValidator identityValidator,
BuildInfo buildInfo,
OpcUaServerConfigLimits limits) {
this.stackServerConfig = stackServerConfig;
this.bindPort = bindPort;
this.bindAddresses = bindAddresses;
this.endpointAddresses = endpointAddresses;
this.securityPolicies = securityPolicies;
this.identityValidator = identityValidator;
this.buildInfo = buildInfo;
this.limits = limits;
}
示例2: testCopy
import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo; //导入依赖的package包/类
@Test
public void testCopy() {
OpcUaServerConfig original = OpcUaServerConfig.builder()
.setCertificateManager(new DefaultCertificateManager())
.setCertificateValidator(new DefaultCertificateValidator(Files.createTempDir()))
.setSecurityPolicies(EnumSet.of(SecurityPolicy.None, SecurityPolicy.Basic128Rsa15))
.setBindPort(12345)
.setBindAddresses(newArrayList("127.0.0.1", "0.0.0.0"))
.setEndpointAddresses(newArrayList("testHostname"))
.setIdentityValidator(AnonymousIdentityValidator.INSTANCE)
.setBuildInfo(new BuildInfo("a", "b", "c", "d", "e", DateTime.MIN_VALUE))
.setLimits(new OpcUaServerConfigLimits() {})
.build();
OpcUaServerConfig copy = OpcUaServerConfig.copy(original).build();
assertEquals(copy.getSecurityPolicies(), original.getSecurityPolicies());
assertEquals(copy.getBindPort(), original.getBindPort());
assertEquals(copy.getBindAddresses(), original.getBindAddresses());
assertEquals(copy.getEndpointAddresses(), original.getEndpointAddresses());
assertEquals(copy.getIdentityValidator(), original.getIdentityValidator());
assertEquals(copy.getBuildInfo(), original.getBuildInfo());
assertEquals(copy.getLimits(), original.getLimits());
}
示例3: run
import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo; //导入依赖的package包/类
@Override
public void run(OpcUaClient client, CompletableFuture<OpcUaClient> future) throws Exception {
// synchronous connect
client.connect().get();
// Get a typed reference to the Server object: ServerNode
ServerNode serverNode = client.getAddressSpace().getObjectNode(
Identifiers.Server,
ServerNode.class
).get();
// Read properties of the Server object...
String[] serverArray = serverNode.getServerArray().get();
String[] namespaceArray = serverNode.getNamespaceArray().get();
logger.info("ServerArray={}", Arrays.toString(serverArray));
logger.info("NamespaceArray={}", Arrays.toString(namespaceArray));
// Read the value of attribute the ServerStatus variable component
ServerStatusDataType serverStatus = serverNode.getServerStatus().get();
logger.info("ServerStatus={}", serverStatus);
// Get a typed reference to the ServerStatus variable
// component and read value attributes individually
ServerStatusNode serverStatusNode = serverNode.getServerStatusNode().get();
BuildInfo buildInfo = serverStatusNode.getBuildInfo().get();
DateTime startTime = serverStatusNode.getStartTime().get();
DateTime currentTime = serverStatusNode.getCurrentTime().get();
ServerState state = serverStatusNode.getState().get();
logger.info("ServerStatus.BuildInfo={}", buildInfo);
logger.info("ServerStatus.StartTime={}", startTime);
logger.info("ServerStatus.CurrentTime={}", currentTime);
logger.info("ServerStatus.State={}", state);
future.complete(client);
}
示例4: setBuildInfo
import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo; //导入依赖的package包/类
/**
* Server build info
*/
public void setBuildInfo(final BuildInfo buildInfo) {
this.serverConfig.setBuildInfo(buildInfo);
}
示例5: getBuildInfo
import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo; //导入依赖的package包/类
public CompletableFuture<BuildInfo> getBuildInfo() {
return getBuildInfoNode().thenCompose(UaVariableNode::getValue).thenApply(o -> cast(o, BuildInfo.class));
}
示例6: setBuildInfo
import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo; //导入依赖的package包/类
public CompletableFuture<StatusCode> setBuildInfo(BuildInfo value) {
return getBuildInfoNode().thenCompose(node -> node.setValue(value));
}
示例7: setBuildInfo
import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo; //导入依赖的package包/类
public OpcUaServerConfigBuilder setBuildInfo(BuildInfo buildInfo) {
this.buildInfo = buildInfo;
return this;
}
示例8: getBuildInfo
import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo; //导入依赖的package包/类
@Override
public BuildInfo getBuildInfo() {
return buildInfo;
}
示例9: getBuildInfo
import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo; //导入依赖的package包/类
public BuildInfo getBuildInfo() {
Optional<VariableNode> component = getVariableComponent("BuildInfo");
return component.map(node -> (BuildInfo) node.getValue().getValue().getValue()).orElse(null);
}
示例10: setBuildInfo
import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo; //导入依赖的package包/类
public void setBuildInfo(BuildInfo value) {
getVariableComponent("BuildInfo").ifPresent(n -> n.setValue(new DataValue(new Variant(value))));
}
示例11: ExampleServer
import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo; //导入依赖的package包/类
public ExampleServer() throws Exception {
File securityTempDir = new File(System.getProperty("java.io.tmpdir"), "security");
if (!securityTempDir.exists() && !securityTempDir.mkdirs()) {
throw new Exception("unable to create security temp dir: " + securityTempDir);
}
LoggerFactory.getLogger(getClass()).info("security temp dir: {}", securityTempDir.getAbsolutePath());
KeyStoreLoader loader = new KeyStoreLoader().load(securityTempDir);
DefaultCertificateManager certificateManager = new DefaultCertificateManager(
loader.getServerKeyPair(),
loader.getServerCertificate()
);
File pkiDir = securityTempDir.toPath().resolve("pki").toFile();
DirectoryCertificateValidator certificateValidator = new DirectoryCertificateValidator(pkiDir);
LoggerFactory.getLogger(getClass()).info("pki dir: {}", pkiDir.getAbsolutePath());
UsernameIdentityValidator identityValidator = new UsernameIdentityValidator(
true,
authChallenge -> {
String username = authChallenge.getUsername();
String password = authChallenge.getPassword();
boolean userOk = "user".equals(username) && "password1".equals(password);
boolean adminOk = "admin".equals(username) && "password2".equals(password);
return userOk || adminOk;
}
);
X509IdentityValidator x509IdentityValidator = new X509IdentityValidator(c -> true);
List<String> bindAddresses = newArrayList();
bindAddresses.add("0.0.0.0");
List<String> endpointAddresses = newArrayList();
endpointAddresses.add(HostnameUtil.getHostname());
endpointAddresses.addAll(HostnameUtil.getHostnames("0.0.0.0"));
OpcUaServerConfig serverConfig = OpcUaServerConfig.builder()
.setApplicationUri("urn:eclipse:milo:examples:server")
.setApplicationName(LocalizedText.english("Eclipse Milo OPC-UA Example Server"))
.setBindPort(12686)
.setBindAddresses(bindAddresses)
.setEndpointAddresses(endpointAddresses)
.setBuildInfo(
new BuildInfo(
"urn:eclipse:milo:example-server",
"eclipse",
"eclipse milo example server",
OpcUaServer.SDK_VERSION,
"", DateTime.now()))
.setCertificateManager(certificateManager)
.setCertificateValidator(certificateValidator)
.setIdentityValidator(new CompositeValidator(identityValidator, x509IdentityValidator))
.setProductUri("urn:eclipse:milo:example-server")
.setServerName("example")
.setSecurityPolicies(
EnumSet.of(
SecurityPolicy.None,
SecurityPolicy.Basic128Rsa15,
SecurityPolicy.Basic256,
SecurityPolicy.Basic256Sha256,
SecurityPolicy.Aes128_Sha256_RsaOaep,
SecurityPolicy.Aes256_Sha256_RsaPss))
.setUserTokenPolicies(
ImmutableList.of(
USER_TOKEN_POLICY_ANONYMOUS,
USER_TOKEN_POLICY_USERNAME,
USER_TOKEN_POLICY_X509))
.build();
server = new OpcUaServer(serverConfig);
server.getNamespaceManager().registerAndAdd(
ExampleNamespace.NAMESPACE_URI,
idx -> new ExampleNamespace(server, idx));
}
示例12: getBuildInfo
import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo; //导入依赖的package包/类
/**
* @return the server {@link BuildInfo}.
*/
BuildInfo getBuildInfo();
示例13: getBuildInfo
import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo; //导入依赖的package包/类
CompletableFuture<BuildInfo> getBuildInfo();
示例14: setBuildInfo
import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo; //导入依赖的package包/类
CompletableFuture<StatusCode> setBuildInfo(BuildInfo value);
示例15: getBuildInfo
import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo; //导入依赖的package包/类
BuildInfo getBuildInfo();