Class TestServer
- java.lang.Object
-
- test.de.iip_ecosphere.platform.connectors.opcuav1.TestServer
-
public class TestServer extends java.lang.ObjectImplements an OPC UA embedded test server.- Author:
- Holger Eichelberger, SSE
-
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.milo.opcua.sdk.server.api.ManagedNamespaceWithLifecycleexampleNamespaceprivate org.slf4j.Loggerloggerprotected static booleanSECUREprivate org.eclipse.milo.opcua.sdk.server.OpcUaServerserverprivate ServerSetupsetup
-
Constructor Summary
Constructors Constructor Description TestServer(NamespaceCreator namespaceCreator, ServerSetup setup)Creates a test server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private org.eclipse.milo.opcua.stack.server.EndpointConfigurationbuildHttpsEndpoint(org.eclipse.milo.opcua.stack.server.EndpointConfiguration.Builder base)Builds an HTTPS endpoint forServerSetup.getHttpsPort().private org.eclipse.milo.opcua.stack.server.EndpointConfigurationbuildTcpEndpoint(org.eclipse.milo.opcua.stack.server.EndpointConfiguration.Builder base)Builds a TCP endpoint forServerSetup.getTcpPort().private java.util.Set<org.eclipse.milo.opcua.stack.server.EndpointConfiguration>createEndpointConfigurations()Creates the endpoint configurations.java.util.concurrent.CompletableFuture<org.eclipse.milo.opcua.sdk.server.OpcUaServer>shutdown()Shuts down the server.java.util.concurrent.CompletableFuture<org.eclipse.milo.opcua.sdk.server.OpcUaServer>startup()Starts the server.
-
-
-
Field Detail
-
SECURE
protected static final boolean SECURE
- See Also:
- Constant Field Values
-
logger
private final org.slf4j.Logger logger
-
server
private final org.eclipse.milo.opcua.sdk.server.OpcUaServer server
-
exampleNamespace
private final org.eclipse.milo.opcua.sdk.server.api.ManagedNamespaceWithLifecycle exampleNamespace
-
setup
private final ServerSetup setup
-
-
Constructor Detail
-
TestServer
public TestServer(NamespaceCreator namespaceCreator, ServerSetup setup) throws java.util.concurrent.ExecutionException
Creates a test server.- Parameters:
namespaceCreator- the namespace creatorsetup- the setup for the server- Throws:
java.util.concurrent.ExecutionException- if creating the server fails for some reason
-
-
Method Detail
-
createEndpointConfigurations
private java.util.Set<org.eclipse.milo.opcua.stack.server.EndpointConfiguration> createEndpointConfigurations()
Creates the endpoint configurations.setupimplicitly defines the endpoints to be created and how to secure the endpoints.- Returns:
- the endpoint configurations
-
buildTcpEndpoint
private org.eclipse.milo.opcua.stack.server.EndpointConfiguration buildTcpEndpoint(org.eclipse.milo.opcua.stack.server.EndpointConfiguration.Builder base)
Builds a TCP endpoint forServerSetup.getTcpPort().- Parameters:
base- the base configuration to be extended for HTTPS- Returns:
- the endpoint configuration
-
buildHttpsEndpoint
private org.eclipse.milo.opcua.stack.server.EndpointConfiguration buildHttpsEndpoint(org.eclipse.milo.opcua.stack.server.EndpointConfiguration.Builder base)
Builds an HTTPS endpoint forServerSetup.getHttpsPort().- Parameters:
base- the base configuration to be extended for HTTPS- Returns:
- the endpoint configuration
-
startup
public java.util.concurrent.CompletableFuture<org.eclipse.milo.opcua.sdk.server.OpcUaServer> startup()
Starts the server.- Returns:
- the future on the start operation, just call
CompletableFuture.get()
-
shutdown
public java.util.concurrent.CompletableFuture<org.eclipse.milo.opcua.sdk.server.OpcUaServer> shutdown()
Shuts down the server.- Returns:
- the future on the start operation, just call
CompletableFuture.get()
-
-