Interface Mqtt5ClientOptions.LifecycleEvents

  • Enclosing class:
    Mqtt5ClientOptions

    public static interface Mqtt5ClientOptions.LifecycleEvents
    An interface that defines all of the functions the Mqtt5Client will call when it receives a lifecycle event.
    • Method Detail

      • onAttemptingConnect

        void onAttemptingConnect​(Mqtt5Client client,
                                 OnAttemptingConnectReturn onAttemptingConnectReturn)
        Called when the client begins a connection attempt
        Parameters:
        client - The client associated with the event
        onAttemptingConnectReturn - The data associated with the onAttemptingConnect event.
      • onConnectionSuccess

        void onConnectionSuccess​(Mqtt5Client client,
                                 OnConnectionSuccessReturn onConnectionSuccessReturn)
        Called when the client successfully establishes an MQTT connection
        Parameters:
        client - The client associated with the event
        onConnectionSuccessReturn - The data associated with the onConnectionSuccess event.
      • onConnectionFailure

        void onConnectionFailure​(Mqtt5Client client,
                                 OnConnectionFailureReturn onConnectionFailureReturn)
        Called when the client fails to establish an MQTT connection
        Parameters:
        client - The client associated with the event
        onConnectionFailureReturn - The data associated with the onConnectionFailure event.
      • onDisconnection

        void onDisconnection​(Mqtt5Client client,
                             OnDisconnectionReturn onDisconnectionReturn)
        Called when the client's current MQTT connection is closed
        Parameters:
        client - The client associated with the event
        onDisconnectionReturn - The data associated with the onDisconnection event.
      • onStopped

        void onStopped​(Mqtt5Client client,
                       OnStoppedReturn onStoppedReturn)
        Called when the client reaches the 'Stopped' state as a result of the user invoking .stop()
        Parameters:
        client - The client associated with the event
        onStoppedReturn - The data associated with the onStopped event.