mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 09:39:39 +02:00
Add XMPPConnection.sendStanza(Stanza)
and deprecate sendPacket().
This commit is contained in:
parent
183af99ffb
commit
ed4fa3390f
58 changed files with 183 additions and 167 deletions
|
@ -33,7 +33,7 @@ import org.jivesoftware.smack.packet.TopLevelStreamElement;
|
|||
* unit tests.
|
||||
*
|
||||
* Instances store any packets that are delivered to be send using the
|
||||
* {@link #sendPacket(Stanza)} method in a blocking queue. The content of this queue
|
||||
* {@link #sendStanza(Stanza)} method in a blocking queue. The content of this queue
|
||||
* can be inspected using {@link #getSentPacket()}. Typically these queues are
|
||||
* used to retrieve a message that was generated by the client.
|
||||
*
|
||||
|
@ -132,7 +132,7 @@ public class DummyConnection extends AbstractXMPPConnection {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void sendPacketInternal(Stanza packet) {
|
||||
protected void sendStanzaInternal(Stanza packet) {
|
||||
if (SmackConfiguration.DEBUG) {
|
||||
System.out.println("[SEND]: " + packet.toXML());
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ public class DummyConnection extends AbstractXMPPConnection {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the number of packets that's sent through {@link #sendPacket(Stanza)} and
|
||||
* Returns the number of packets that's sent through {@link #sendStanza(Stanza)} and
|
||||
* that has not been returned by {@link #getSentPacket()}.
|
||||
*
|
||||
* @return the number of packets which are in the queue.
|
||||
|
@ -150,7 +150,7 @@ public class DummyConnection extends AbstractXMPPConnection {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the first packet that's sent through {@link #sendPacket(Stanza)}
|
||||
* Returns the first packet that's sent through {@link #sendStanza(Stanza)}
|
||||
* and that has not been returned by earlier calls to this method.
|
||||
*
|
||||
* @return a sent packet.
|
||||
|
@ -160,7 +160,7 @@ public class DummyConnection extends AbstractXMPPConnection {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the first packet that's sent through {@link #sendPacket(Stanza)}
|
||||
* Returns the first packet that's sent through {@link #sendStanza(Stanza)}
|
||||
* and that has not been returned by earlier calls to this method. This
|
||||
* method will block for up to the specified number of seconds if no packets
|
||||
* have been sent yet.
|
||||
|
|
|
@ -38,8 +38,8 @@ public class ThreadedDummyConnection extends DummyConnection {
|
|||
private volatile boolean timeout = false;
|
||||
|
||||
@Override
|
||||
public void sendPacket(Stanza packet) throws NotConnectedException {
|
||||
super.sendPacket(packet);
|
||||
public void sendStanza(Stanza packet) throws NotConnectedException {
|
||||
super.sendStanza(packet);
|
||||
|
||||
if (packet instanceof IQ && !timeout) {
|
||||
timeout = false;
|
||||
|
@ -62,7 +62,7 @@ public class ThreadedDummyConnection extends DummyConnection {
|
|||
}
|
||||
|
||||
/**
|
||||
* Calling this method will cause the next sendPacket call with an IQ packet to timeout.
|
||||
* Calling this method will cause the next sendStanza call with an IQ packet to timeout.
|
||||
* This is accomplished by simply stopping the auto creating of the reply packet
|
||||
* or processing one that was entered via {@link #processPacket(Stanza)}.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue