public class AbstractConnectionListener extends Object implements ConnectionListener
ConnectionListener
interface. This is a
convenience class which should be used in case you do not need to implement
all methods.Constructor and Description |
---|
AbstractConnectionListener() |
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.
|
public AbstractConnectionListener()
public void connected(XMPPConnection connection)
ConnectionListener
Note that the connection is likely not yet authenticated and therefore only limited operations like registering an account may be possible.
connected
in interface ConnectionListener
connection
- the XMPPConnection which successfully connected to its endpoint.public void authenticated(XMPPConnection connection, boolean resumed)
ConnectionListener
authenticated
in interface ConnectionListener
connection
- the XMPPConnection which successfully authenticated.resumed
- true if a previous XMPP session's stream was resumed.public void connectionClosed()
ConnectionListener
connectionClosed
in interface ConnectionListener
public void connectionClosedOnError(Exception e)
ConnectionListener
connectionClosedOnError
in interface ConnectionListener
e
- the exception.public void reconnectingIn(int seconds)
ConnectionListener
Note: This method is only called if ReconnectionManager.isAutomaticReconnectEnabled()
returns true, i.e.
only when the reconnection manager is enabled for the connection.
reconnectingIn
in interface ConnectionListener
seconds
- remaining seconds before attempting a reconnection.public void reconnectionFailed(Exception e)
ConnectionListener
Note: This method is only called if ReconnectionManager.isAutomaticReconnectEnabled()
returns true, i.e.
only when the reconnection manager is enabled for the connection.
reconnectionFailed
in interface ConnectionListener
e
- the exception that caused the reconnection to fail.public void reconnectionSuccessful()
ConnectionListener
reconnectionSuccessful
in interface ConnectionListener