Class TestServer
java.lang.Object
test.de.iip_ecosphere.platform.connectors.opcuav1.TestServer
public class TestServer extends Object
Implements 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
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 Set<org.eclipse.milo.opcua.stack.server.EndpointConfiguration>createEndpointConfigurations()Creates the endpoint configurations.CompletableFuture<org.eclipse.milo.opcua.sdk.server.OpcUaServer>shutdown()Shuts down the server.CompletableFuture<org.eclipse.milo.opcua.sdk.server.OpcUaServer>startup()Starts the server.
-
Field Details
-
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
-
-
Constructor Details
-
TestServer
Creates a test server.- Parameters:
namespaceCreator- the namespace creatorsetup- the setup for the server- Throws:
ExecutionException- if creating the server fails for some reason
-
-
Method Details
-
createEndpointConfigurations
private 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
Starts the server.- Returns:
- the future on the start operation, just call
CompletableFuture.get()
-
shutdown
Shuts down the server.- Returns:
- the future on the start operation, just call
CompletableFuture.get()
-