public interface ConnectionListener
Modifier and Type | Method and Description |
---|---|
void |
authenticated(XMPPConnection connection,
boolean resumed)
Notification that the connection has been authenticated.
|
void |
connected(XMPPConnection connection)
Notification that the connection has been successfully connected to the remote endpoint (e.g.
|
void |
connectionClosed()
Notification that the connection was closed normally.
|
void |
connectionClosedOnError(Exception e)
Notification that the connection was closed due to an exception.
|
void |
reconnectingIn(int seconds)
The connection will retry to reconnect in the specified number of seconds.
|
void |
reconnectionFailed(Exception e)
An attempt to connect to the server has failed.
|
void |
reconnectionSuccessful()
The connection has reconnected successfully to the server.
|
void connected(XMPPConnection connection)
Note that the connection is likely not yet authenticated and therefore only limited operations like registering an account may be possible.
connection
- the XMPPConnection which successfully connected to its endpoint.void authenticated(XMPPConnection connection, boolean resumed)
connection
- the XMPPConnection which successfully authenticated.resumed
- true if a previous XMPP session's stream was resumed.void connectionClosed()
void connectionClosedOnError(Exception e)
e
- the exception.void reconnectionSuccessful()
void reconnectingIn(int seconds)
Note: This method is only called if ReconnectionManager.isAutomaticReconnectEnabled()
returns true, i.e.
only when the reconnection manager is enabled for the connection.
seconds
- remaining seconds before attempting a reconnection.void reconnectionFailed(Exception e)
Note: This method is only called if ReconnectionManager.isAutomaticReconnectEnabled()
returns true, i.e.
only when the reconnection manager is enabled for the connection.
e
- the exception that caused the reconnection to fail.