Class PeriodicReconnectStrategy

java.lang.Object
org.openhab.core.io.transport.mqtt.reconnect.AbstractReconnectStrategy
org.openhab.core.io.transport.mqtt.reconnect.PeriodicReconnectStrategy

@NonNullByDefault public class PeriodicReconnectStrategy extends AbstractReconnectStrategy
This is an implementation of the AbstractReconnectStrategy. This strategy tries to reconnect after 10 seconds and then every 60 seconds after a broker connection has been lost.
Author:
David Graeff - Initial contribution
  • Constructor Details

    • PeriodicReconnectStrategy

      public PeriodicReconnectStrategy()
      Use a default 60s reconnect frequency and try the first reconnect after 10s.
    • PeriodicReconnectStrategy

      public PeriodicReconnectStrategy(int reconnectFrequency, int firstReconnectAfter)
      Create a PeriodicReconnectStrategy with the given reconnect frequency and first reconnect time parameters.
      Parameters:
      reconnectFrequency - This strategy tries to reconnect in this frequency in ms.
      firstReconnectAfter - After a connection is lost, the very first reconnect attempt will be performed after this time in ms.
  • Method Details