mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +02:00
SMACK-279: The XMPPConnection extends the new abstract Connection class
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@11613 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
11a41e79ca
commit
127319a821
102 changed files with 1420 additions and 1194 deletions
|
@ -22,7 +22,7 @@ package org.jivesoftware.smackx.packet;
|
|||
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.SmackConfiguration;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.filter.PacketIDFilter;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
|
@ -127,14 +127,14 @@ public class LastActivity extends IQ {
|
|||
|
||||
/**
|
||||
* Retrieve the last activity of a particular jid.
|
||||
* @param con the current XMPPConnection.
|
||||
* @param con the current Connection.
|
||||
* @param jid the JID of the user.
|
||||
* @return the LastActivity packet of the jid.
|
||||
* @throws XMPPException thrown if a server error has occured.
|
||||
* @deprecated This method only retreives the lapsed time since the last logout of a particular jid.
|
||||
* Replaced by {@link org.jivesoftware.smackx.LastActivityManager#getLastActivity(XMPPConnection, String) getLastActivity}
|
||||
* Replaced by {@link org.jivesoftware.smackx.LastActivityManager#getLastActivity(Connection, String) getLastActivity}
|
||||
*/
|
||||
public static LastActivity getLastActivity(XMPPConnection con, String jid) throws XMPPException {
|
||||
public static LastActivity getLastActivity(Connection con, String jid) throws XMPPException {
|
||||
LastActivity activity = new LastActivity();
|
||||
jid = StringUtils.parseBareAddress(jid);
|
||||
activity.setTo(jid);
|
||||
|
|
|
@ -64,7 +64,6 @@ public class Nick implements PacketExtension {
|
|||
*
|
||||
* @see org.jivesoftware.smack.packet.PacketExtension#getElementName()
|
||||
*/
|
||||
@Override
|
||||
public String getElementName() {
|
||||
return ELEMENT_NAME;
|
||||
}
|
||||
|
@ -74,7 +73,6 @@ public class Nick implements PacketExtension {
|
|||
*
|
||||
* @see org.jivesoftware.smack.packet.PacketExtension#getNamespace()
|
||||
*/
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return NAMESPACE;
|
||||
}
|
||||
|
@ -84,7 +82,6 @@ public class Nick implements PacketExtension {
|
|||
*
|
||||
* @see org.jivesoftware.smack.packet.PacketExtension#toXML()
|
||||
*/
|
||||
@Override
|
||||
public String toXML() {
|
||||
final StringBuilder buf = new StringBuilder();
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ package org.jivesoftware.smackx.packet;
|
|||
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.SmackConfiguration;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.filter.PacketFilter;
|
||||
import org.jivesoftware.smack.filter.PacketIDFilter;
|
||||
|
@ -32,7 +32,7 @@ final public class SyncPacketSend
|
|||
private SyncPacketSend()
|
||||
{ }
|
||||
|
||||
static public Packet getReply(XMPPConnection connection, Packet packet, long timeout)
|
||||
static public Packet getReply(Connection connection, Packet packet, long timeout)
|
||||
throws XMPPException
|
||||
{
|
||||
PacketFilter responseFilter = new PacketIDFilter(packet.getPacketID());
|
||||
|
@ -55,7 +55,7 @@ final public class SyncPacketSend
|
|||
return result;
|
||||
}
|
||||
|
||||
static public Packet getReply(XMPPConnection connection, Packet packet)
|
||||
static public Packet getReply(Connection connection, Packet packet)
|
||||
throws XMPPException
|
||||
{
|
||||
return getReply(connection, packet, SmackConfiguration.getPacketReplyTimeout());
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.jivesoftware.smackx.packet;
|
|||
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.SmackConfiguration;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.filter.PacketIDFilter;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
|
@ -493,10 +493,10 @@ public class VCard extends IQ {
|
|||
* <p/>
|
||||
* NOTE: the method is asynchronous and does not wait for the returned value.
|
||||
*
|
||||
* @param connection the XMPPConnection to use.
|
||||
* @param connection the Connection to use.
|
||||
* @throws XMPPException thrown if there was an issue setting the VCard in the server.
|
||||
*/
|
||||
public void save(XMPPConnection connection) throws XMPPException {
|
||||
public void save(Connection connection) throws XMPPException {
|
||||
checkAuthenticated(connection, true);
|
||||
|
||||
setType(IQ.Type.SET);
|
||||
|
@ -520,7 +520,7 @@ public class VCard extends IQ {
|
|||
* Load VCard information for a connected user. Connection should be authenticated
|
||||
* and not anonymous.
|
||||
*/
|
||||
public void load(XMPPConnection connection) throws XMPPException {
|
||||
public void load(Connection connection) throws XMPPException {
|
||||
checkAuthenticated(connection, true);
|
||||
|
||||
setFrom(connection.getUser());
|
||||
|
@ -530,14 +530,14 @@ public class VCard extends IQ {
|
|||
/**
|
||||
* Load VCard information for a given user. Connection should be authenticated and not anonymous.
|
||||
*/
|
||||
public void load(XMPPConnection connection, String user) throws XMPPException {
|
||||
public void load(Connection connection, String user) throws XMPPException {
|
||||
checkAuthenticated(connection, false);
|
||||
|
||||
setTo(user);
|
||||
doLoad(connection, user);
|
||||
}
|
||||
|
||||
private void doLoad(XMPPConnection connection, String user) throws XMPPException {
|
||||
private void doLoad(Connection connection, String user) throws XMPPException {
|
||||
setType(Type.GET);
|
||||
PacketCollector collector = connection.createPacketCollector(
|
||||
new PacketIDFilter(getPacketID()));
|
||||
|
@ -587,7 +587,7 @@ public class VCard extends IQ {
|
|||
}
|
||||
}
|
||||
|
||||
private void checkAuthenticated(XMPPConnection connection, boolean checkForAnonymous) {
|
||||
private void checkAuthenticated(Connection connection, boolean checkForAnonymous) {
|
||||
if (connection == null) {
|
||||
throw new IllegalArgumentException("No connection was provided");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue