Class TestServerBuilder
java.lang.Object
test.de.iip_ecosphere.platform.transport.TestServerBuilder
- All Implemented Interfaces:
de.iip_ecosphere.platform.support.Builder<AbstractTestServer>
public class TestServerBuilder
extends Object
implements de.iip_ecosphere.platform.support.Builder<AbstractTestServer>
A builder for delayed building of test server plugin server instances.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCreates test server instances. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTestServerBuilder(String id, TestServerBuilder.InstanceCreator instanceCreator, File installDir) Creates a builder instance. -
Method Summary
Modifier and TypeMethodDescriptionbuild()static TestServerBuilderfromPlugin(String pluginId) Creates a builder from the given plugin id via thePluginManager.static AbstractTestServerfromPlugin(String pluginId, de.iip_ecosphere.platform.support.ServerAddress address) Creates a test server instance from the given plugin id via thePluginManagervia theTestServerBuilder.setAddress(de.iip_ecosphere.platform.support.ServerAddress addr) Sets the server address.
-
Field Details
-
id
-
addr
private de.iip_ecosphere.platform.support.ServerAddress addr -
instanceCreator
-
installDir
-
-
Constructor Details
-
TestServerBuilder
public TestServerBuilder(String id, TestServerBuilder.InstanceCreator instanceCreator, File installDir) Creates a builder instance.- Parameters:
id- the plugin idinstanceCreator- the server instance creatorinstallDir- the plugin installation directory, may be null
-
-
Method Details
-
setAddress
Sets the server address.- Parameters:
addr- the server address (schema ignored)
-
build
- Specified by:
buildin interfacede.iip_ecosphere.platform.support.Builder<AbstractTestServer>
-
fromPlugin
Creates a builder from the given plugin id via thePluginManager.- Parameters:
pluginId- the plugin id- Returns:
- the test server builder
- Throws:
NullPointerException- if no such plugin exists
-
fromPlugin
public static AbstractTestServer fromPlugin(String pluginId, de.iip_ecosphere.platform.support.ServerAddress address) Creates a test server instance from the given plugin id via thePluginManagervia theTestServerBuilder.- Parameters:
pluginId- the plugin id- Returns:
- the test server builder
- Throws:
NullPointerException- if no such plugin exists
-