2003-07-09 18:05:43 +02:00
|
|
|
/**
|
|
|
|
*
|
2007-02-12 01:59:05 +01:00
|
|
|
* Copyright 2003-2007 Jive Software.
|
2003-07-09 18:05:43 +02:00
|
|
|
*
|
2014-02-17 18:57:38 +01:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
2004-11-03 00:53:30 +01:00
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2003-07-09 18:05:43 +02:00
|
|
|
*
|
2004-11-03 00:53:30 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2003-07-09 18:05:43 +02:00
|
|
|
*
|
2004-11-03 00:53:30 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
2003-07-09 18:05:43 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
package org.jivesoftware.smack;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface that allows for implementing classes to listen for connection closing
|
2014-03-10 09:45:50 +01:00
|
|
|
* and reconnection events. Listeners are registered with XMPPConnection objects.
|
2003-07-09 18:05:43 +02:00
|
|
|
*
|
2014-03-10 09:45:50 +01:00
|
|
|
* @see XMPPConnection#addConnectionListener
|
|
|
|
* @see XMPPConnection#removeConnectionListener
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2003-07-09 18:05:43 +02:00
|
|
|
* @author Matt Tucker
|
|
|
|
*/
|
|
|
|
public interface ConnectionListener {
|
|
|
|
|
2014-03-14 01:48:33 +01:00
|
|
|
/**
|
2015-01-10 01:23:20 +01:00
|
|
|
* Notification that the connection has been successfully connected to the remote endpoint (e.g. the XMPP server).
|
|
|
|
* <p>
|
|
|
|
* Note that the connection is likely not yet authenticated and therefore only limited operations like registering
|
|
|
|
* an account may be possible.
|
|
|
|
* </p>
|
|
|
|
*
|
|
|
|
* @param connection the XMPPConnection which successfully connected to its endpoint.
|
2014-03-14 01:48:33 +01:00
|
|
|
*/
|
2020-05-13 22:01:48 +02:00
|
|
|
default void connected(XMPPConnection connection) {
|
|
|
|
}
|
2014-03-14 01:48:33 +01:00
|
|
|
|
|
|
|
/**
|
2015-01-10 01:23:20 +01:00
|
|
|
* Notification that the connection has been authenticated.
|
|
|
|
*
|
|
|
|
* @param connection the XMPPConnection which successfully authenticated.
|
|
|
|
* @param resumed true if a previous XMPP session's stream was resumed.
|
2014-03-14 01:48:33 +01:00
|
|
|
*/
|
2020-05-13 22:01:48 +02:00
|
|
|
default void authenticated(XMPPConnection connection, boolean resumed) {
|
|
|
|
}
|
2014-03-14 01:48:33 +01:00
|
|
|
|
2003-07-09 18:05:43 +02:00
|
|
|
/**
|
2015-01-10 01:23:20 +01:00
|
|
|
* Notification that the connection was closed normally.
|
2003-07-09 18:05:43 +02:00
|
|
|
*/
|
2020-05-13 22:01:48 +02:00
|
|
|
default void connectionClosed() {
|
|
|
|
}
|
2003-07-09 18:05:43 +02:00
|
|
|
|
|
|
|
/**
|
2006-09-14 21:16:40 +02:00
|
|
|
* Notification that the connection was closed due to an exception. When
|
|
|
|
* abruptly disconnected it is possible for the connection to try reconnecting
|
|
|
|
* to the server.
|
2003-07-09 18:05:43 +02:00
|
|
|
*
|
|
|
|
* @param e the exception.
|
|
|
|
*/
|
2020-05-13 22:01:48 +02:00
|
|
|
default void connectionClosedOnError(Exception e) {
|
|
|
|
}
|
2015-01-10 01:23:20 +01:00
|
|
|
|
2014-02-17 23:58:40 +01:00
|
|
|
}
|