Class TestHiveMqServer
java.lang.Object
test.de.iip_ecosphere.platform.transport.AbstractTestServer
test.de.iip_ecosphere.platform.test.mqtt.hivemq.TestHiveMqServer
- All Implemented Interfaces:
de.iip_ecosphere.platform.support.Server
- Direct Known Subclasses:
TestHiveMqTlsServer
public class TestHiveMqServer
extends test.de.iip_ecosphere.platform.transport.AbstractTestServer
A simple embedded HiveMQ/MQTT test server for testing/experiments. This class requires Java 11.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTestHiveMqServer(de.iip_ecosphere.platform.support.ServerAddress addr) Creates the server instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected static de.iip_ecosphere.platform.support.ServerAddressgetServerAddress(String[] args) Determins the server address from the command line.static voidStarts the server from the command line.de.iip_ecosphere.platform.support.Serverstart()voidstop(boolean dispose) Methods inherited from class test.de.iip_ecosphere.platform.transport.AbstractTestServer
applyBaseDir, extractConfiguration, extractConfiguration, getConfigDir, getConfigDir, getInteger, getInteger, getString, runsFromJar, scheduleShutdownHook, setConfigDir
-
Field Details
-
KEYSTORE_PASSWORD
- See Also:
-
TRUSTSTORE_PASSWORD
- See Also:
-
KEY_ALIAS
- See Also:
-
hiveMQ
private com.hivemq.embedded.EmbeddedHiveMQ hiveMQ -
addr
private de.iip_ecosphere.platform.support.ServerAddress addr -
hiveTmp
-
-
Constructor Details
-
TestHiveMqServer
public TestHiveMqServer(de.iip_ecosphere.platform.support.ServerAddress addr) Creates the server instance.- Parameters:
addr- the server address (schema is ignored)
-
-
Method Details
-
start
public de.iip_ecosphere.platform.support.Server start() -
stop
public void stop(boolean dispose) -
getServerAddress
Determins the server address from the command line.- Parameters:
args- the first argument may be the port number, else 8883 is used; optionally --host=<name> may be given afterwards- Returns:
- the server address
-
main
Starts the server from the command line.- Parameters:
args- the first argument may be the port number, else 8883 is used; optionally --host=<name> may be given afterwards
-