Class TestServer
java.lang.Object
test.de.iip_ecosphere.platform.connectors.opcuav1.TestServer
Implements an OPC UA embedded test server.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.eclipse.milo.opcua.sdk.server.api.ManagedNamespaceWithLifecycleprivate final de.iip_ecosphere.platform.support.logging.Loggerprotected static final booleanprivate final org.eclipse.milo.opcua.sdk.server.OpcUaServerprivate final ServerSetup -
Constructor Summary
ConstructorsConstructorDescriptionTestServer(NamespaceCreator namespaceCreator, ServerSetup setup) Creates a test server. -
Method Summary
Modifier and TypeMethodDescriptionprivate 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> 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:
-
logger
private final de.iip_ecosphere.platform.support.logging.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()
-