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
    Modifier and Type
    Field
    Description
    private de.iip_ecosphere.platform.support.ServerAddress
     
    private com.hivemq.embedded.EmbeddedHiveMQ
     
    private File
     
    static final String
     
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    TestHiveMqServer(de.iip_ecosphere.platform.support.ServerAddress addr)
    Creates the server instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static de.iip_ecosphere.platform.support.ServerAddress
    Determins the server address from the command line.
    static void
    main(String[] args)
    Starts the server from the command line.
    de.iip_ecosphere.platform.support.Server
     
    void
    stop(boolean dispose)
     

    Methods inherited from class test.de.iip_ecosphere.platform.transport.AbstractTestServer

    applyBaseDir, extractConfiguration, extractConfiguration, getConfigDir, getConfigDir, getInteger, getInteger, getString, runsFromJar, scheduleShutdownHook, setConfigDir

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • KEYSTORE_PASSWORD

      public static final String KEYSTORE_PASSWORD
      See Also:
    • TRUSTSTORE_PASSWORD

      public static final String TRUSTSTORE_PASSWORD
      See Also:
    • KEY_ALIAS

      public static final String KEY_ALIAS
      See Also:
    • hiveMQ

      private com.hivemq.embedded.EmbeddedHiveMQ hiveMQ
    • addr

      private de.iip_ecosphere.platform.support.ServerAddress addr
    • hiveTmp

      private File 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

      protected static de.iip_ecosphere.platform.support.ServerAddress getServerAddress(String[] args)
      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

      public static void main(String[] args)
      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