mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 17:19:39 +02:00
[core] Deprecate AbstractConnectionListener
This commit is contained in:
parent
13abeb9626
commit
ab2d3a2b79
18 changed files with 44 additions and 39 deletions
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2015 Florian Schmaus
|
||||
* Copyright 2015-2020 Florian Schmaus
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smack;
|
||||
|
||||
public abstract class AbstractConnectionClosedListener extends AbstractConnectionListener {
|
||||
public abstract class AbstractConnectionClosedListener implements ConnectionListener {
|
||||
|
||||
@Override
|
||||
public final void connectionClosed() {
|
||||
|
|
|
@ -23,7 +23,10 @@ package org.jivesoftware.smack;
|
|||
* all methods.
|
||||
*
|
||||
* @author Henning Staib
|
||||
* @deprecated use {@link ConnectionListener} instead.
|
||||
*/
|
||||
// TODO: Remove in Smack 4.5.
|
||||
@Deprecated
|
||||
public class AbstractConnectionListener implements ConnectionListener {
|
||||
@Override
|
||||
public void connected(XMPPConnection connection) {
|
||||
|
|
|
@ -37,7 +37,8 @@ public interface ConnectionListener {
|
|||
*
|
||||
* @param connection the XMPPConnection which successfully connected to its endpoint.
|
||||
*/
|
||||
void connected(XMPPConnection connection);
|
||||
default void connected(XMPPConnection connection) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Notification that the connection has been authenticated.
|
||||
|
@ -45,12 +46,14 @@ public interface ConnectionListener {
|
|||
* @param connection the XMPPConnection which successfully authenticated.
|
||||
* @param resumed true if a previous XMPP session's stream was resumed.
|
||||
*/
|
||||
void authenticated(XMPPConnection connection, boolean resumed);
|
||||
default void authenticated(XMPPConnection connection, boolean resumed) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Notification that the connection was closed normally.
|
||||
*/
|
||||
void connectionClosed();
|
||||
default void connectionClosed() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Notification that the connection was closed due to an exception. When
|
||||
|
@ -59,6 +62,7 @@ public interface ConnectionListener {
|
|||
*
|
||||
* @param e the exception.
|
||||
*/
|
||||
void connectionClosedOnError(Exception e);
|
||||
default void connectionClosedOnError(Exception e) {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -401,7 +401,7 @@ public final class ReconnectionManager {
|
|||
reconnectionThread = null;
|
||||
}
|
||||
|
||||
private final ConnectionListener connectionListener = new AbstractConnectionListener() {
|
||||
private final ConnectionListener connectionListener = new ConnectionListener() {
|
||||
|
||||
@Override
|
||||
public void connectionClosed() {
|
||||
|
|
|
@ -18,7 +18,6 @@ package org.jivesoftware.smack.debugger;
|
|||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.AbstractConnectionListener;
|
||||
import org.jivesoftware.smack.AbstractXMPPConnection;
|
||||
import org.jivesoftware.smack.ConnectionListener;
|
||||
import org.jivesoftware.smack.ReconnectionListener;
|
||||
|
@ -69,7 +68,7 @@ public abstract class AbstractDebugger extends SmackDebugger {
|
|||
};
|
||||
this.writer.addWriterListener(writerListener);
|
||||
|
||||
connListener = new AbstractConnectionListener() {
|
||||
connListener = new ConnectionListener() {
|
||||
@Override
|
||||
public void connected(XMPPConnection connection) {
|
||||
log("XMPPConnection connected ("
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue