mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 09:39:39 +02:00
Merge branch '4.1'
Conflicts: smack-core/src/main/java/org/jivesoftware/smack/StanzaListener.java smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java version.gradle
This commit is contained in:
commit
83b84c5bd3
168 changed files with 780 additions and 687 deletions
|
@ -72,11 +72,11 @@ public class MultipleRecipientInfo {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns true if the received packet should not be replied. Use
|
||||
* Returns true if the received stanza(/packet) should not be replied. Use
|
||||
* {@link MultipleRecipientManager#reply(org.jivesoftware.smack.XMPPConnection, org.jivesoftware.smack.packet.Message, org.jivesoftware.smack.packet.Message)}
|
||||
* to send replies.
|
||||
*
|
||||
* @return true if the received packet should not be replied.
|
||||
* @return true if the received stanza(/packet) should not be replied.
|
||||
*/
|
||||
public boolean shouldNotReply() {
|
||||
return !extension.getAddressesOfType(MultipleAddresses.Type.noreply).isEmpty();
|
||||
|
|
|
@ -47,14 +47,14 @@ import java.util.List;
|
|||
public class MultipleRecipientManager {
|
||||
|
||||
/**
|
||||
* Sends the specified packet to the collection of specified recipients using the
|
||||
* Sends the specified stanza(/packet) to the collection of specified recipients using the
|
||||
* specified connection. If the server has support for XEP-33 then only one
|
||||
* packet is going to be sent to the server with the multiple recipient instructions.
|
||||
* stanza(/packet) is going to be sent to the server with the multiple recipient instructions.
|
||||
* However, if XEP-33 is not supported by the server then the client is going to send
|
||||
* the packet to each recipient.
|
||||
* the stanza(/packet) to each recipient.
|
||||
*
|
||||
* @param connection the connection to use to send the packet.
|
||||
* @param packet the packet to send to the list of recipients.
|
||||
* @param packet the stanza(/packet) to send to the list of recipients.
|
||||
* @param to the collection of JIDs to include in the TO list or <tt>null</tt> if no TO
|
||||
* list exists.
|
||||
* @param cc the collection of JIDs to include in the CC list or <tt>null</tt> if no CC
|
||||
|
@ -75,13 +75,13 @@ public class MultipleRecipientManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sends the specified packet to the collection of specified recipients using the specified
|
||||
* connection. If the server has support for XEP-33 then only one packet is going to be sent to
|
||||
* Sends the specified stanza(/packet) to the collection of specified recipients using the specified
|
||||
* connection. If the server has support for XEP-33 then only one stanza(/packet) is going to be sent to
|
||||
* the server with the multiple recipient instructions. However, if XEP-33 is not supported by
|
||||
* the server then the client is going to send the packet to each recipient.
|
||||
* the server then the client is going to send the stanza(/packet) to each recipient.
|
||||
*
|
||||
* @param connection the connection to use to send the packet.
|
||||
* @param packet the packet to send to the list of recipients.
|
||||
* @param packet the stanza(/packet) to send to the list of recipients.
|
||||
* @param to the collection of JIDs to include in the TO list or <tt>null</tt> if no TO list exists.
|
||||
* @param cc the collection of JIDs to include in the CC list or <tt>null</tt> if no CC list exists.
|
||||
* @param bcc the collection of JIDs to include in the BCC list or <tt>null</tt> if no BCC list
|
||||
|
@ -130,12 +130,12 @@ public class MultipleRecipientManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sends a reply to a previously received packet that was sent to multiple recipients. Before
|
||||
* Sends a reply to a previously received stanza(/packet) that was sent to multiple recipients. Before
|
||||
* attempting to send the reply message some checkings are performed. If any of those checkings
|
||||
* fail then an XMPPException is going to be thrown with the specific error detail.
|
||||
*
|
||||
* @param connection the connection to use to send the reply.
|
||||
* @param original the previously received packet that was sent to multiple recipients.
|
||||
* @param original the previously received stanza(/packet) that was sent to multiple recipients.
|
||||
* @param reply the new message to send as a reply.
|
||||
* @throws SmackException
|
||||
* @throws XMPPErrorException
|
||||
|
@ -190,12 +190,12 @@ public class MultipleRecipientManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the {@link MultipleRecipientInfo} contained in the specified packet or
|
||||
* Returns the {@link MultipleRecipientInfo} contained in the specified stanza(/packet) or
|
||||
* <tt>null</tt> if none was found. Only packets sent to multiple recipients will
|
||||
* contain such information.
|
||||
*
|
||||
* @param packet the packet to check.
|
||||
* @return the MultipleRecipientInfo contained in the specified packet or <tt>null</tt>
|
||||
* @param packet the stanza(/packet) to check.
|
||||
* @return the MultipleRecipientInfo contained in the specified stanza(/packet) or <tt>null</tt>
|
||||
* if none was found.
|
||||
*/
|
||||
public static MultipleRecipientInfo getMultipleRecipientInfo(Stanza packet) {
|
||||
|
@ -291,9 +291,9 @@ public class MultipleRecipientManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Packet that holds the XML stanza to send. This class is useful when the same packet
|
||||
* is needed to be sent to different recipients. Since using the same packet is not possible
|
||||
* (i.e. cannot change the TO address of a queues packet to be sent) then this class was
|
||||
* Stanza(/Packet) that holds the XML stanza to send. This class is useful when the same packet
|
||||
* is needed to be sent to different recipients. Since using the same stanza(/packet) is not possible
|
||||
* (i.e. cannot change the TO address of a queues stanza(/packet) to be sent) then this class was
|
||||
* created to keep the XML stanza to send.
|
||||
*/
|
||||
private static class PacketCopy extends Stanza {
|
||||
|
@ -301,10 +301,10 @@ public class MultipleRecipientManager {
|
|||
private CharSequence text;
|
||||
|
||||
/**
|
||||
* Create a copy of a packet with the text to send. The passed text must be a valid text to
|
||||
* Create a copy of a stanza(/packet) with the text to send. The passed text must be a valid text to
|
||||
* send to the server, no validation will be done on the passed text.
|
||||
*
|
||||
* @param text the whole text of the packet to send
|
||||
* @param text the whole text of the stanza(/packet) to send
|
||||
*/
|
||||
public PacketCopy(CharSequence text) {
|
||||
this.text = text;
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Packet extension that contains the list of addresses that a packet should be sent or was sent.
|
||||
* Stanza(/Packet) extension that contains the list of addresses that a stanza(/packet) should be sent or was sent.
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
|
@ -55,14 +55,14 @@ public class MultipleAddresses implements ExtensionElement {
|
|||
private List<Address> addresses = new ArrayList<Address>();
|
||||
|
||||
/**
|
||||
* Adds a new address to which the packet is going to be sent or was sent.
|
||||
* Adds a new address to which the stanza(/packet) is going to be sent or was sent.
|
||||
*
|
||||
* @param type on of the static type (BCC, CC, NO_REPLY, REPLY_ROOM, etc.)
|
||||
* @param jid the JID address of the recipient.
|
||||
* @param node used to specify a sub-addressable unit at a particular JID, corresponding to
|
||||
* a Service Discovery node.
|
||||
* @param desc used to specify human-readable information for this address.
|
||||
* @param delivered true when the packet was already delivered to this address.
|
||||
* @param delivered true when the stanza(/packet) was already delivered to this address.
|
||||
* @param uri used to specify an external system address, such as a sip:, sips:, or im: URI.
|
||||
*/
|
||||
public void addAddress(Type type, Jid jid, String node, String desc, boolean delivered,
|
||||
|
@ -79,7 +79,7 @@ public class MultipleAddresses implements ExtensionElement {
|
|||
}
|
||||
|
||||
/**
|
||||
* Indicate that the packet being sent should not be replied.
|
||||
* Indicate that the stanza(/packet) being sent should not be replied.
|
||||
*/
|
||||
public void setNoReply() {
|
||||
// Create a new address with the specificed configuration
|
||||
|
|
|
@ -129,7 +129,7 @@ public class AMPExtension implements ExtensionElement {
|
|||
* Returns the XML element name of the extension sub-packet root element.
|
||||
* Always returns "amp"
|
||||
*
|
||||
* @return the XML element name of the packet extension.
|
||||
* @return the XML element name of the stanza(/packet) extension.
|
||||
*/
|
||||
@Override
|
||||
public String getElementName() {
|
||||
|
@ -140,7 +140,7 @@ public class AMPExtension implements ExtensionElement {
|
|||
* Returns the XML namespace of the extension sub-packet root element.
|
||||
* According the specification the namespace is always "http://jabber.org/protocol/xhtml-im"
|
||||
*
|
||||
* @return the XML namespace of the packet extension.
|
||||
* @return the XML namespace of the stanza(/packet) extension.
|
||||
*/
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
|
|
|
@ -32,7 +32,7 @@ public class AMPExtensionProvider extends ExtensionElementProvider<AMPExtension>
|
|||
private static final Logger LOGGER = Logger.getLogger(AMPExtensionProvider.class.getName());
|
||||
|
||||
/**
|
||||
* Parses a AMPExtension packet (extension sub-packet).
|
||||
* Parses a AMPExtension stanza(/packet) (extension sub-packet).
|
||||
*
|
||||
* @param parser the XML parser, positioned at the starting element of the extension.
|
||||
* @return a PacketExtension.
|
||||
|
|
|
@ -24,9 +24,9 @@ import org.jivesoftware.smackx.bytestreams.ibb.packet.DataPacketExtension;
|
|||
|
||||
/**
|
||||
* DataListener handles all In-Band Bytestream IQ stanzas containing a data
|
||||
* packet extension that don't belong to an existing session.
|
||||
* stanza(/packet) extension that don't belong to an existing session.
|
||||
* <p>
|
||||
* If a data packet is received it looks if a stored In-Band Bytestream session
|
||||
* If a data stanza(/packet) is received it looks if a stored In-Band Bytestream session
|
||||
* exists. If no session with the given session ID exists an
|
||||
* <item-not-found/> error is returned to the sender.
|
||||
* <p>
|
||||
|
|
|
@ -50,7 +50,7 @@ import org.jxmpp.jid.Jid;
|
|||
* in case the Socks5 bytestream method of transferring data is not available.
|
||||
* <p>
|
||||
* There are two ways to send data over an In-Band Bytestream. It could either use IQ stanzas to
|
||||
* send data packets or message stanzas. If IQ stanzas are used every data packet is acknowledged by
|
||||
* send data packets or message stanzas. If IQ stanzas are used every data stanza(/packet) is acknowledged by
|
||||
* the receiver. This is the recommended way to avoid possible rate-limiting penalties. Message
|
||||
* stanzas are not acknowledged because most XMPP server implementation don't support stanza
|
||||
* flow-control method like <a href="http://xmpp.org/extensions/xep-0079.html">Advanced Message
|
||||
|
@ -287,7 +287,7 @@ public class InBandBytestreamManager implements BytestreamManager {
|
|||
* to the initiator.
|
||||
* <p>
|
||||
* This method should be used if you are awaiting an In-Band Bytestream request as a reply to
|
||||
* another packet (e.g. file transfer).
|
||||
* another stanza(/packet) (e.g. file transfer).
|
||||
*
|
||||
* @param sessionID to be ignored
|
||||
*/
|
||||
|
@ -439,7 +439,7 @@ public class InBandBytestreamManager implements BytestreamManager {
|
|||
* Responses to the given IQ packet's sender with an XMPP error that an In-Band Bytestream is
|
||||
* not accepted.
|
||||
*
|
||||
* @param request IQ packet that should be answered with a not-acceptable error
|
||||
* @param request IQ stanza(/packet) that should be answered with a not-acceptable error
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
|
@ -453,7 +453,7 @@ public class InBandBytestreamManager implements BytestreamManager {
|
|||
* Responses to the given IQ packet's sender with an XMPP error that an In-Band Bytestream open
|
||||
* request is rejected because its block size is greater than the maximum allowed block size.
|
||||
*
|
||||
* @param request IQ packet that should be answered with a resource-constraint error
|
||||
* @param request IQ stanza(/packet) that should be answered with a resource-constraint error
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
|
@ -467,7 +467,7 @@ public class InBandBytestreamManager implements BytestreamManager {
|
|||
* Responses to the given IQ packet's sender with an XMPP error that an In-Band Bytestream
|
||||
* session could not be found.
|
||||
*
|
||||
* @param request IQ packet that should be answered with a item-not-found error
|
||||
* @param request IQ stanza(/packet) that should be answered with a item-not-found error
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
|
@ -538,7 +538,7 @@ public class InBandBytestreamManager implements BytestreamManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Disables the InBandBytestreamManager by removing its packet listeners and resetting its
|
||||
* Disables the InBandBytestreamManager by removing its stanza(/packet) listeners and resetting its
|
||||
* internal status, which includes removing this instance from the managers map.
|
||||
*/
|
||||
private void disableService() {
|
||||
|
|
|
@ -231,7 +231,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
|
||||
/**
|
||||
* IBBInputStream class is the base implementation of an In-Band Bytestream input stream.
|
||||
* Subclasses of this input stream must provide a packet listener along with a packet filter to
|
||||
* Subclasses of this input stream must provide a stanza(/packet) listener along with a stanza(/packet) filter to
|
||||
* collect the In-Band Bytestream data packets.
|
||||
*/
|
||||
private abstract class IBBInputStream extends InputStream {
|
||||
|
@ -270,16 +270,16 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the packet listener that processes In-Band Bytestream data packets.
|
||||
* Returns the stanza(/packet) listener that processes In-Band Bytestream data packets.
|
||||
*
|
||||
* @return the data packet listener
|
||||
* @return the data stanza(/packet) listener
|
||||
*/
|
||||
protected abstract StanzaListener getDataPacketListener();
|
||||
|
||||
/**
|
||||
* Returns the packet filter that accepts In-Band Bytestream data packets.
|
||||
* Returns the stanza(/packet) filter that accepts In-Band Bytestream data packets.
|
||||
*
|
||||
* @return the data packet filter
|
||||
* @return the data stanza(/packet) filter
|
||||
*/
|
||||
protected abstract StanzaFilter getDataPacketFilter();
|
||||
|
||||
|
@ -336,7 +336,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
}
|
||||
|
||||
/**
|
||||
* This method blocks until a data packet is received, the stream is closed or the current
|
||||
* This method blocks until a data stanza(/packet) is received, the stream is closed or the current
|
||||
* thread is interrupted.
|
||||
*
|
||||
* @return <code>true</code> if data was received, otherwise <code>false</code>
|
||||
|
@ -420,7 +420,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
}
|
||||
|
||||
/**
|
||||
* This method sets the close flag and removes the data packet listener.
|
||||
* This method sets the close flag and removes the data stanza(/packet) listener.
|
||||
*/
|
||||
private void closeInternal() {
|
||||
if (isClosed) {
|
||||
|
@ -494,7 +494,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
protected StanzaFilter getDataPacketFilter() {
|
||||
/*
|
||||
* filter all IQ stanzas having type 'SET' (represented by Data class), containing a
|
||||
* data packet extension, matching session ID and recipient
|
||||
* data stanza(/packet) extension, matching session ID and recipient
|
||||
*/
|
||||
return new AndFilter(new StanzaTypeFilter(Data.class), new IBBDataPacketFilter());
|
||||
}
|
||||
|
@ -540,7 +540,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
@Override
|
||||
protected StanzaFilter getDataPacketFilter() {
|
||||
/*
|
||||
* filter all message stanzas containing a data packet extension, matching session ID
|
||||
* filter all message stanzas containing a data stanza(/packet) extension, matching session ID
|
||||
* and recipient
|
||||
*/
|
||||
return new AndFilter(new StanzaTypeFilter(Message.class), new IBBDataPacketFilter());
|
||||
|
@ -550,7 +550,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
|
||||
/**
|
||||
* IBBDataPacketFilter class filters all packets from the remote peer of this session,
|
||||
* containing an In-Band Bytestream data packet extension whose session ID matches this sessions
|
||||
* containing an In-Band Bytestream data stanza(/packet) extension whose session ID matches this sessions
|
||||
* ID.
|
||||
*/
|
||||
private class IBBDataPacketFilter implements StanzaFilter {
|
||||
|
@ -610,7 +610,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
}
|
||||
|
||||
/**
|
||||
* Writes the given data packet to the XMPP stream.
|
||||
* Writes the given data stanza(/packet) to the XMPP stream.
|
||||
*
|
||||
* @param data the data packet
|
||||
* @throws IOException if an I/O error occurred while sending or if the stream is closed
|
||||
|
|
|
@ -32,7 +32,7 @@ public class Data extends IQ {
|
|||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param data data packet extension containing the encoded data
|
||||
* @param data data stanza(/packet) extension containing the encoded data
|
||||
*/
|
||||
public Data(DataPacketExtension data) {
|
||||
super(DataPacketExtension.ELEMENT, DataPacketExtension.NAMESPACE);
|
||||
|
@ -45,9 +45,9 @@ public class Data extends IQ {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the data packet extension.
|
||||
* Returns the data stanza(/packet) extension.
|
||||
*
|
||||
* @return the data packet extension
|
||||
* @return the data stanza(/packet) extension
|
||||
*/
|
||||
public DataPacketExtension getDataPacketExtension() {
|
||||
return this.dataPacketExtension;
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.jivesoftware.smack.util.stringencoder.Base64;
|
|||
public class DataPacketExtension implements ExtensionElement {
|
||||
|
||||
/**
|
||||
* The element name of the data packet extension.
|
||||
* The element name of the data stanza(/packet) extension.
|
||||
*/
|
||||
public final static String ELEMENT = "data";
|
||||
|
||||
|
@ -54,7 +54,7 @@ public class DataPacketExtension implements ExtensionElement {
|
|||
* Creates a new In-Band Bytestream data packet.
|
||||
*
|
||||
* @param sessionID unique session ID identifying this In-Band Bytestream
|
||||
* @param seq sequence of this packet in regard to the other data packets
|
||||
* @param seq sequence of this stanza(/packet) in regard to the other data packets
|
||||
* @param data the base64 encoded data contained in this packet
|
||||
*/
|
||||
public DataPacketExtension(String sessionID, long seq, String data) {
|
||||
|
@ -82,9 +82,9 @@ public class DataPacketExtension implements ExtensionElement {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the sequence of this packet in regard to the other data packets.
|
||||
* Returns the sequence of this stanza(/packet) in regard to the other data packets.
|
||||
*
|
||||
* @return the sequence of this packet in regard to the other data packets.
|
||||
* @return the sequence of this stanza(/packet) in regard to the other data packets.
|
||||
*/
|
||||
public long getSeq() {
|
||||
return seq;
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/**
|
||||
* Parses an In-Band Bytestream data packet which can be a packet extension of
|
||||
* Parses an In-Band Bytestream data stanza(/packet) which can be a stanza(/packet) extension of
|
||||
* either an IQ stanza or a message stanza.
|
||||
*
|
||||
* @author Henning Staib
|
||||
|
|
|
@ -268,7 +268,7 @@ public final class Socks5BytestreamManager implements BytestreamManager {
|
|||
* to the initiator.
|
||||
* <p>
|
||||
* This method should be used if you are awaiting a SOCKS5 Bytestream request as a reply to
|
||||
* another packet (e.g. file transfer).
|
||||
* another stanza(/packet) (e.g. file transfer).
|
||||
*
|
||||
* @param sessionID to be ignored
|
||||
*/
|
||||
|
@ -621,10 +621,10 @@ public final class Socks5BytestreamManager implements BytestreamManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a IQ packet to query a SOCKS5 proxy its network settings.
|
||||
* Returns a IQ stanza(/packet) to query a SOCKS5 proxy its network settings.
|
||||
*
|
||||
* @param proxy the proxy to query
|
||||
* @return IQ packet to query a SOCKS5 proxy its network settings
|
||||
* @return IQ stanza(/packet) to query a SOCKS5 proxy its network settings
|
||||
*/
|
||||
private static Bytestream createStreamHostRequest(Jid proxy) {
|
||||
Bytestream request = new Bytestream();
|
||||
|
@ -673,7 +673,7 @@ public final class Socks5BytestreamManager implements BytestreamManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a SOCKS5 Bytestream initialization request packet with the given session ID
|
||||
* Returns a SOCKS5 Bytestream initialization request stanza(/packet) with the given session ID
|
||||
* containing the given stream hosts for the given target JID.
|
||||
*
|
||||
* @param sessionID the session ID for the SOCKS5 Bytestream
|
||||
|
@ -703,7 +703,7 @@ public final class Socks5BytestreamManager implements BytestreamManager {
|
|||
* Specified in XEP-65 5.3.1 (Example 13)
|
||||
* </p>
|
||||
*
|
||||
* @param packet Packet that should be answered with a not-acceptable error
|
||||
* @param packet Stanza(/Packet) that should be answered with a not-acceptable error
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
|
|
|
@ -101,7 +101,7 @@ class Socks5ClientForInitiator extends Socks5Client {
|
|||
}
|
||||
|
||||
/**
|
||||
* Activates the SOCKS5 Bytestream by sending an XMPP SOCKS5 Bytestream activation packet to the
|
||||
* Activates the SOCKS5 Bytestream by sending an XMPP SOCKS5 Bytestream activation stanza(/packet) to the
|
||||
* SOCKS5 proxy.
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
|
|||
import org.jxmpp.jid.Jid;
|
||||
|
||||
/**
|
||||
* A packet representing part of a SOCKS5 Bytestream negotiation.
|
||||
* A stanza(/packet) representing part of a SOCKS5 Bytestream negotiation.
|
||||
*
|
||||
* @author Alexander Wenckus
|
||||
*/
|
||||
|
@ -199,10 +199,10 @@ public class Bytestream extends IQ {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the activate element of the packet sent to the proxy host to verify the identity of
|
||||
* Returns the activate element of the stanza(/packet) sent to the proxy host to verify the identity of
|
||||
* the initiator and match them to the appropriate stream.
|
||||
*
|
||||
* @return Returns the activate element of the packet sent to the proxy host to verify the
|
||||
* @return Returns the activate element of the stanza(/packet) sent to the proxy host to verify the
|
||||
* identity of the initiator and match them to the appropriate stream.
|
||||
*/
|
||||
public Activate getToActivate() {
|
||||
|
@ -210,7 +210,7 @@ public class Bytestream extends IQ {
|
|||
}
|
||||
|
||||
/**
|
||||
* Upon the response from the target of the used host the activate packet is sent to the SOCKS5
|
||||
* Upon the response from the target of the used host the activate stanza(/packet) is sent to the SOCKS5
|
||||
* proxy. The proxy will activate the stream or return an error after verifying the identity of
|
||||
* the initiator, using the activate packet.
|
||||
*
|
||||
|
@ -257,7 +257,7 @@ public class Bytestream extends IQ {
|
|||
}
|
||||
|
||||
/**
|
||||
* Packet extension that represents a potential SOCKS5 proxy for the file transfer. Stream hosts
|
||||
* Stanza(/Packet) extension that represents a potential SOCKS5 proxy for the file transfer. Stream hosts
|
||||
* are forwarded to the target of the file transfer who then chooses and connects to one.
|
||||
*
|
||||
* @author Alexander Wenckus
|
||||
|
@ -336,7 +336,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* After selected a SOCKS5 stream host and successfully connecting, the target of the file
|
||||
* transfer returns a byte stream packet with the stream host used extension.
|
||||
* transfer returns a byte stream stanza(/packet) with the stream host used extension.
|
||||
*
|
||||
* @author Alexander Wenckus
|
||||
*/
|
||||
|
@ -378,7 +378,7 @@ public class Bytestream extends IQ {
|
|||
}
|
||||
|
||||
/**
|
||||
* The packet sent by the stream initiator to the stream proxy to activate the connection.
|
||||
* The stanza(/packet) sent by the stream initiator to the stream proxy to activate the connection.
|
||||
*
|
||||
* @author Alexander Wenckus
|
||||
*/
|
||||
|
|
|
@ -352,7 +352,7 @@ public class EntityCapsManager extends Manager {
|
|||
public void processPacket(Stanza packet) {
|
||||
if (!entityCapsEnabled)
|
||||
return;
|
||||
CapsVersionAndHash capsVersionAndHash = getCapsVersion();
|
||||
CapsVersionAndHash capsVersionAndHash = getCapsVersionAndHash();
|
||||
CapsExtension caps = new CapsExtension(entityNode, capsVersionAndHash.version, capsVersionAndHash.hash);
|
||||
packet.addExtension(caps);
|
||||
}
|
||||
|
@ -413,7 +413,7 @@ public class EntityCapsManager extends Manager {
|
|||
*
|
||||
* @return our own caps version
|
||||
*/
|
||||
public CapsVersionAndHash getCapsVersion() {
|
||||
public CapsVersionAndHash getCapsVersionAndHash() {
|
||||
return currentCapsVersion;
|
||||
}
|
||||
|
||||
|
@ -425,7 +425,11 @@ public class EntityCapsManager extends Manager {
|
|||
* @return the local NodeVer
|
||||
*/
|
||||
public String getLocalNodeVer() {
|
||||
return entityNode + '#' + getCapsVersion();
|
||||
CapsVersionAndHash capsVersionAndHash = getCapsVersionAndHash();
|
||||
if (capsVersionAndHash == null) {
|
||||
return null;
|
||||
}
|
||||
return entityNode + '#' + capsVersionAndHash.version;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -467,13 +471,14 @@ public class EntityCapsManager extends Manager {
|
|||
|
||||
DiscoverInfo discoverInfo = new DiscoverInfo();
|
||||
discoverInfo.setType(IQ.Type.result);
|
||||
discoverInfo.setNode(getLocalNodeVer());
|
||||
if (connection != null)
|
||||
discoverInfo.setFrom(connection.getUser());
|
||||
sdm.addDiscoverInfoTo(discoverInfo);
|
||||
|
||||
// getLocalNodeVer() will return a result only after currentCapsVersion is set. Therefore
|
||||
// set it first and then call getLocalNodeVer()
|
||||
currentCapsVersion = generateVerificationString(discoverInfo);
|
||||
addDiscoverInfoByNode(entityNode + '#' + currentCapsVersion.version, discoverInfo);
|
||||
final String localNodeVer = getLocalNodeVer();
|
||||
discoverInfo.setNode(localNodeVer);
|
||||
addDiscoverInfoByNode(localNodeVer, discoverInfo);
|
||||
if (lastLocalCapsVersions.size() > 10) {
|
||||
CapsVersionAndHash oldCapsVersion = lastLocalCapsVersions.poll();
|
||||
sdm.removeNodeInformationProvider(entityNode + '#' + oldCapsVersion.version);
|
||||
|
@ -484,7 +489,7 @@ public class EntityCapsManager extends Manager {
|
|||
JID_TO_NODEVER_CACHE.put(connection.getUser(), new NodeVerHash(entityNode, currentCapsVersion));
|
||||
|
||||
final List<Identity> identities = new LinkedList<Identity>(ServiceDiscoveryManager.getInstanceFor(connection).getIdentities());
|
||||
sdm.setNodeInformationProvider(entityNode + '#' + currentCapsVersion, new AbstractNodeInformationProvider() {
|
||||
sdm.setNodeInformationProvider(localNodeVer, new AbstractNodeInformationProvider() {
|
||||
List<String> features = sdm.getFeatures();
|
||||
List<ExtensionElement> packetExtensions = sdm.getExtendedInfoAsList();
|
||||
@Override
|
||||
|
@ -553,7 +558,7 @@ public class EntityCapsManager extends Manager {
|
|||
/**
|
||||
*
|
||||
* @param info
|
||||
* @return true if the packet extensions is ill-formed
|
||||
* @return true if the stanza(/packet) extensions is ill-formed
|
||||
*/
|
||||
protected static boolean verifyPacketExtensions(DiscoverInfo info) {
|
||||
List<FormField> foundFormTypes = new LinkedList<FormField>();
|
||||
|
|
|
@ -120,7 +120,7 @@ public class SimpleDirectoryPersistentCache implements EntityCapsPersistentCache
|
|||
}
|
||||
|
||||
/**
|
||||
* Writes the DiscoverInfo packet to an file
|
||||
* Writes the DiscoverInfo stanza(/packet) to an file
|
||||
*
|
||||
* @param file
|
||||
* @param info
|
||||
|
@ -136,7 +136,7 @@ public class SimpleDirectoryPersistentCache implements EntityCapsPersistentCache
|
|||
}
|
||||
|
||||
/**
|
||||
* Tries to restore an DiscoverInfo packet from a file.
|
||||
* Tries to restore an DiscoverInfo stanza(/packet) from a file.
|
||||
*
|
||||
* @param file
|
||||
* @return the restored DiscoverInfo
|
||||
|
|
|
@ -38,7 +38,7 @@ import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
|||
|
||||
/**
|
||||
* Handles chat state for all chats on a particular XMPPConnection. This class manages both the
|
||||
* packet extensions and the disco response necessary for compliance with
|
||||
* stanza(/packet) extensions and the disco response necessary for compliance with
|
||||
* <a href="http://www.xmpp.org/extensions/xep-0085.html">XEP-0085</a>.
|
||||
*
|
||||
* NOTE: {@link org.jivesoftware.smackx.chatstates.ChatStateManager#getInstance(org.jivesoftware.smack.XMPPConnection)}
|
||||
|
@ -96,7 +96,7 @@ public class ChatStateManager extends Manager {
|
|||
|
||||
/**
|
||||
* Sets the current state of the provided chat. This method will send an empty bodied Message
|
||||
* packet with the state attached as a {@link org.jivesoftware.smack.packet.ExtensionElement}, if
|
||||
* stanza(/packet) with the state attached as a {@link org.jivesoftware.smack.packet.ExtensionElement}, if
|
||||
* and only if the new chat state is different than the last state.
|
||||
*
|
||||
* @param newState the new state of the chat
|
||||
|
|
|
@ -297,7 +297,7 @@ public class AdHocCommandManager extends Manager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Process the AdHoc-Command packet that request the execution of some
|
||||
* Process the AdHoc-Command stanza(/packet) that request the execution of some
|
||||
* action of a command. If this is the first request, this method checks,
|
||||
* before executing the command, if:
|
||||
* <ul>
|
||||
|
@ -318,7 +318,7 @@ public class AdHocCommandManager extends Manager {
|
|||
* </ul>
|
||||
*
|
||||
* @param requestData
|
||||
* the packet to process.
|
||||
* the stanza(/packet) to process.
|
||||
* @throws NotConnectedException
|
||||
* @throws NoResponseException
|
||||
* @throws InterruptedException
|
||||
|
|
|
@ -25,8 +25,8 @@ import org.jxmpp.util.XmppDateTime;
|
|||
|
||||
/**
|
||||
* Represents timestamp information about data stored for later delivery. A DelayInformation will
|
||||
* always includes the timestamp when the packet was originally sent and may include more
|
||||
* information such as the JID of the entity that originally sent the packet as well as the reason
|
||||
* always includes the timestamp when the stanza(/packet) was originally sent and may include more
|
||||
* information such as the JID of the entity that originally sent the stanza(/packet) as well as the reason
|
||||
* for the delay.<p>
|
||||
*
|
||||
* For more information see <a href="http://xmpp.org/extensions/xep-0091.html">XEP-0091</a>
|
||||
|
@ -58,10 +58,10 @@ public class DelayInformation implements ExtensionElement {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the JID of the entity that originally sent the packet or that delayed the
|
||||
* delivery of the packet or <tt>null</tt> if this information is not available.
|
||||
* Returns the JID of the entity that originally sent the stanza(/packet) or that delayed the
|
||||
* delivery of the stanza(/packet) or <tt>null</tt> if this information is not available.
|
||||
*
|
||||
* @return the JID of the entity that originally sent the packet or that delayed the
|
||||
* @return the JID of the entity that originally sent the stanza(/packet) or that delayed the
|
||||
* delivery of the packet.
|
||||
*/
|
||||
public String getFrom() {
|
||||
|
@ -69,10 +69,10 @@ public class DelayInformation implements ExtensionElement {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the timestamp when the packet was originally sent. The returned Date is
|
||||
* Returns the timestamp when the stanza(/packet) was originally sent. The returned Date is
|
||||
* be understood as UTC.
|
||||
*
|
||||
* @return the timestamp when the packet was originally sent.
|
||||
* @return the timestamp when the stanza(/packet) was originally sent.
|
||||
*/
|
||||
public Date getStamp() {
|
||||
return stamp;
|
||||
|
|
|
@ -64,9 +64,9 @@ public interface NodeInformationProvider {
|
|||
List<DiscoverInfo.Identity> getNodeIdentities();
|
||||
|
||||
/**
|
||||
* Returns a list of the packet extensions defined in the node.
|
||||
* Returns a list of the stanza(/packet) extensions defined in the node.
|
||||
*
|
||||
* @return a list of the packet extensions defined in the node.
|
||||
* @return a list of the stanza(/packet) extensions defined in the node.
|
||||
*/
|
||||
List<ExtensionElement> getNodePacketExtensions();
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.jivesoftware.smack.packet.IQ;
|
|||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XMPPError;
|
||||
import org.jivesoftware.smack.util.Objects;
|
||||
import org.jivesoftware.smackx.caps.EntityCapsManager;
|
||||
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
|
||||
import org.jivesoftware.smackx.disco.packet.DiscoverItems;
|
||||
|
@ -202,9 +203,10 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
*
|
||||
* @param identity
|
||||
*/
|
||||
public void setIdentity(Identity identity) {
|
||||
if (identity == null) throw new IllegalArgumentException("Identity can not be null");
|
||||
this.identity = identity;
|
||||
public synchronized void setIdentity(Identity identity) {
|
||||
this.identity = Objects.requireNonNull(identity, "Identity can not be null");
|
||||
// Notify others of a state change of SDM. In order to keep the state consistent, this
|
||||
// method is synchronized
|
||||
renewEntityCapsVersion();
|
||||
}
|
||||
|
||||
|
@ -234,8 +236,10 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
*
|
||||
* @param identity
|
||||
*/
|
||||
public void addIdentity(DiscoverInfo.Identity identity) {
|
||||
public synchronized void addIdentity(DiscoverInfo.Identity identity) {
|
||||
identities.add(identity);
|
||||
// Notify others of a state change of SDM. In order to keep the state consistent, this
|
||||
// method is synchronized
|
||||
renewEntityCapsVersion();
|
||||
}
|
||||
|
||||
|
@ -246,9 +250,11 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
* @param identity
|
||||
* @return true, if successful. Otherwise the default identity was given.
|
||||
*/
|
||||
public boolean removeIdentity(DiscoverInfo.Identity identity) {
|
||||
public synchronized boolean removeIdentity(DiscoverInfo.Identity identity) {
|
||||
if (identity.equals(this.identity)) return false;
|
||||
identities.remove(identity);
|
||||
// Notify others of a state change of SDM. In order to keep the state consistent, this
|
||||
// method is synchronized
|
||||
renewEntityCapsVersion();
|
||||
return true;
|
||||
}
|
||||
|
@ -288,17 +294,15 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
*
|
||||
* @param response the discover info response packet
|
||||
*/
|
||||
public void addDiscoverInfoTo(DiscoverInfo response) {
|
||||
public synchronized void addDiscoverInfoTo(DiscoverInfo response) {
|
||||
// First add the identities of the connection
|
||||
response.addIdentities(getIdentities());
|
||||
|
||||
// Add the registered features to the response
|
||||
synchronized (features) {
|
||||
for (String feature : getFeatures()) {
|
||||
response.addFeature(feature);
|
||||
}
|
||||
response.addExtension(extendedInfo);
|
||||
for (String feature : getFeatures()) {
|
||||
response.addFeature(feature);
|
||||
}
|
||||
response.addExtension(extendedInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -358,45 +362,41 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
*
|
||||
* @return a List of the supported features by this XMPP entity.
|
||||
*/
|
||||
public List<String> getFeatures() {
|
||||
synchronized (features) {
|
||||
return new ArrayList<String>(features);
|
||||
}
|
||||
public synchronized List<String> getFeatures() {
|
||||
return new ArrayList<String>(features);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers that a new feature is supported by this XMPP entity. When this client is
|
||||
* queried for its information the registered features will be answered.<p>
|
||||
*
|
||||
* Since no packet is actually sent to the server it is safe to perform this operation
|
||||
* Since no stanza(/packet) is actually sent to the server it is safe to perform this operation
|
||||
* before logging to the server. In fact, you may want to configure the supported features
|
||||
* before logging to the server so that the information is already available if it is required
|
||||
* upon login.
|
||||
*
|
||||
* @param feature the feature to register as supported.
|
||||
*/
|
||||
public void addFeature(String feature) {
|
||||
synchronized (features) {
|
||||
if (!features.contains(feature)) {
|
||||
features.add(feature);
|
||||
renewEntityCapsVersion();
|
||||
}
|
||||
}
|
||||
public synchronized void addFeature(String feature) {
|
||||
features.add(feature);
|
||||
// Notify others of a state change of SDM. In order to keep the state consistent, this
|
||||
// method is synchronized
|
||||
renewEntityCapsVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the specified feature from the supported features by this XMPP entity.<p>
|
||||
*
|
||||
* Since no packet is actually sent to the server it is safe to perform this operation
|
||||
* Since no stanza(/packet) is actually sent to the server it is safe to perform this operation
|
||||
* before logging to the server.
|
||||
*
|
||||
* @param feature the feature to remove from the supported features.
|
||||
*/
|
||||
public void removeFeature(String feature) {
|
||||
synchronized (features) {
|
||||
features.remove(feature);
|
||||
renewEntityCapsVersion();
|
||||
}
|
||||
public synchronized void removeFeature(String feature) {
|
||||
features.remove(feature);
|
||||
// Notify others of a state change of SDM. In order to keep the state consistent, this
|
||||
// method is synchronized
|
||||
renewEntityCapsVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -405,10 +405,8 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
* @param feature the feature to look for.
|
||||
* @return a boolean indicating if the specified featured is registered or not.
|
||||
*/
|
||||
public boolean includesFeature(String feature) {
|
||||
synchronized (features) {
|
||||
return features.contains(feature);
|
||||
}
|
||||
public synchronized boolean includesFeature(String feature) {
|
||||
return features.contains(feature);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -417,7 +415,7 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
* specified by XEP-0128.
|
||||
* <p>
|
||||
*
|
||||
* Since no packet is actually sent to the server it is safe to perform this
|
||||
* Since no stanza(/packet) is actually sent to the server it is safe to perform this
|
||||
* operation before logging to the server. In fact, you may want to
|
||||
* configure the extended info before logging to the server so that the
|
||||
* information is already available if it is required upon login.
|
||||
|
@ -426,8 +424,10 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
* the data form that contains the extend service discovery
|
||||
* information.
|
||||
*/
|
||||
public void setExtendedInfo(DataForm info) {
|
||||
public synchronized void setExtendedInfo(DataForm info) {
|
||||
extendedInfo = info;
|
||||
// Notify others of a state change of SDM. In order to keep the state consistent, this
|
||||
// method is synchronized
|
||||
renewEntityCapsVersion();
|
||||
}
|
||||
|
||||
|
@ -460,11 +460,13 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
* Removes the data form containing extended service discovery information
|
||||
* from the information returned by this XMPP entity.<p>
|
||||
*
|
||||
* Since no packet is actually sent to the server it is safe to perform this
|
||||
* Since no stanza(/packet) is actually sent to the server it is safe to perform this
|
||||
* operation before logging to the server.
|
||||
*/
|
||||
public void removeExtendedInfo() {
|
||||
public synchronized void removeExtendedInfo() {
|
||||
extendedInfo = null;
|
||||
// Notify others of a state change of SDM. In order to keep the state consistent, this
|
||||
// method is synchronized
|
||||
renewEntityCapsVersion();
|
||||
}
|
||||
|
||||
|
@ -599,7 +601,7 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
* be returned by the server whenever the server receives a disco request targeted to the bare
|
||||
* address of the client (i.e. user@host.com).
|
||||
*
|
||||
* @param info the discover info packet to check.
|
||||
* @param info the discover info stanza(/packet) to check.
|
||||
* @return true if the server supports publishing of items.
|
||||
*/
|
||||
public static boolean canPublishItems(DiscoverInfo info) {
|
||||
|
|
|
@ -273,7 +273,7 @@ public class FileTransferNegotiator extends Manager {
|
|||
* the option of, accepting, rejecting, or not responding to a received file
|
||||
* transfer request.
|
||||
* <p/>
|
||||
* If they accept, the packet will contain the other user's chosen stream
|
||||
* If they accept, the stanza(/packet) will contain the other user's chosen stream
|
||||
* type to send the file across. The two choices this implementation
|
||||
* provides to the other user for file transfer are <a
|
||||
* href="http://www.xmpp.org/extensions/jep-0065.html">SOCKS5 Bytestreams</a>,
|
||||
|
|
|
@ -104,11 +104,11 @@ public class FileTransferRequest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the stream initiation packet that was sent by the requestor which
|
||||
* Returns the stream initiation stanza(/packet) that was sent by the requestor which
|
||||
* contains the parameters of the file transfer being transfer and also the
|
||||
* methods available to transfer the file.
|
||||
*
|
||||
* @return Returns the stream initiation packet that was sent by the
|
||||
* @return Returns the stream initiation stanza(/packet) that was sent by the
|
||||
* requestor which contains the parameters of the file transfer
|
||||
* being transfer and also the methods available to transfer the
|
||||
* file.
|
||||
|
|
|
@ -58,7 +58,7 @@ public abstract class StreamNegotiator {
|
|||
protected static final EventManger<String, IQ, SmackException.NotConnectedException> initationSetEvents = new EventManger<>();
|
||||
|
||||
/**
|
||||
* Creates the initiation acceptance packet to forward to the stream
|
||||
* Creates the initiation acceptance stanza(/packet) to forward to the stream
|
||||
* initiator.
|
||||
*
|
||||
* @param streamInitiationOffer The offer from the stream initiator to connect for a stream.
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
|
|||
import org.jivesoftware.smackx.delay.packet.DelayInformation;
|
||||
|
||||
/**
|
||||
* Packet extension for >XEP-0297: Stanza Forwarding.
|
||||
* Stanza(/Packet) extension for >XEP-0297: Stanza Forwarding.
|
||||
*
|
||||
* @author Georg Lukas
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0297.html">XEP-0297: Stanza Forwarding</a>
|
||||
|
@ -35,10 +35,10 @@ public class Forwarded implements ExtensionElement {
|
|||
private final Stanza forwardedPacket;
|
||||
|
||||
/**
|
||||
* Creates a new Forwarded packet extension.
|
||||
* Creates a new Forwarded stanza(/packet) extension.
|
||||
*
|
||||
* @param delay an optional {@link DelayInformation} timestamp of the packet.
|
||||
* @param fwdPacket the packet that is forwarded (required).
|
||||
* @param fwdPacket the stanza(/packet) that is forwarded (required).
|
||||
*/
|
||||
public Forwarded(DelayInformation delay, Stanza fwdPacket) {
|
||||
this.delay = delay;
|
||||
|
@ -46,9 +46,9 @@ public class Forwarded implements ExtensionElement {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a new Forwarded packet extension.
|
||||
* Creates a new Forwarded stanza(/packet) extension.
|
||||
*
|
||||
* @param fwdPacket the packet that is forwarded (required).
|
||||
* @param fwdPacket the stanza(/packet) that is forwarded (required).
|
||||
*/
|
||||
public Forwarded(Stanza fwdPacket) {
|
||||
this(null, fwdPacket);
|
||||
|
@ -75,7 +75,7 @@ public class Forwarded implements ExtensionElement {
|
|||
}
|
||||
|
||||
/**
|
||||
* get the packet forwarded by this stanza.
|
||||
* get the stanza(/packet) forwarded by this stanza.
|
||||
*
|
||||
* @return the {@link Stanza} instance (typically a message) that was forwarded.
|
||||
*/
|
||||
|
@ -86,7 +86,7 @@ public class Forwarded implements ExtensionElement {
|
|||
/**
|
||||
* get the timestamp of the forwarded packet.
|
||||
*
|
||||
* @return the {@link DelayInformation} representing the time when the original packet was sent. May be null.
|
||||
* @return the {@link DelayInformation} representing the time when the original stanza(/packet) was sent. May be null.
|
||||
*/
|
||||
public DelayInformation getDelayInformation() {
|
||||
return delay;
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
|
||||
/**
|
||||
* This class implements the {@link ExtensionElementProvider} to parse
|
||||
* forwarded messages from a packet. It will return a {@link Forwarded} packet extension.
|
||||
* forwarded messages from a packet. It will return a {@link Forwarded} stanza(/packet) extension.
|
||||
*
|
||||
* @author Georg Lukas
|
||||
*/
|
||||
|
|
|
@ -60,7 +60,7 @@ import org.jxmpp.jid.Jid;
|
|||
* <p/>
|
||||
*
|
||||
* For example to get the idle time of a user logged in a resource, simple send
|
||||
* the LastActivity packet to them, as in the following code:
|
||||
* the LastActivity stanza(/packet) to them, as in the following code:
|
||||
* <p>
|
||||
*
|
||||
* <pre>
|
||||
|
@ -76,7 +76,7 @@ import org.jxmpp.jid.Jid;
|
|||
* LastActivity activity = LastActivity.getLastActivity(con, "xray@jabber.org");
|
||||
* </pre>
|
||||
*
|
||||
* To get the uptime of a host, you simple send the LastActivity packet to it,
|
||||
* To get the uptime of a host, you simple send the LastActivity stanza(/packet) to it,
|
||||
* as in the following code example:
|
||||
* <p>
|
||||
*
|
||||
|
@ -228,7 +228,7 @@ public class LastActivityManager extends Manager {
|
|||
*
|
||||
* @param jid
|
||||
* the JID of the user.
|
||||
* @return the LastActivity packet of the jid.
|
||||
* @return the LastActivity stanza(/packet) of the jid.
|
||||
* @throws XMPPErrorException
|
||||
* thrown if a server error has occured.
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
|
|
|
@ -78,7 +78,7 @@ public class PrivateDataManager extends Manager {
|
|||
/**
|
||||
* Returns the private data provider registered to the specified XML element name and namespace.
|
||||
* For example, if a provider was registered to the element name "prefs" and the
|
||||
* namespace "http://www.xmppclient.com/prefs", then the following packet would trigger
|
||||
* namespace "http://www.xmppclient.com/prefs", then the following stanza(/packet) would trigger
|
||||
* the provider:
|
||||
*
|
||||
* <pre>
|
||||
|
|
|
@ -64,7 +64,7 @@ public class DefaultPrivateData implements PrivateData {
|
|||
/**
|
||||
* Returns the XML element name of the private data sub-packet root element.
|
||||
*
|
||||
* @return the XML element name of the packet extension.
|
||||
* @return the XML element name of the stanza(/packet) extension.
|
||||
*/
|
||||
public String getElementName() {
|
||||
return elementName;
|
||||
|
@ -73,7 +73,7 @@ public class DefaultPrivateData implements PrivateData {
|
|||
/**
|
||||
* Returns the XML namespace of the private data sub-packet root element.
|
||||
*
|
||||
* @return the XML namespace of the packet extension.
|
||||
* @return the XML namespace of the stanza(/packet) extension.
|
||||
*/
|
||||
public String getNamespace() {
|
||||
return namespace;
|
||||
|
|
|
@ -96,7 +96,7 @@ public class AccountManager extends Manager {
|
|||
/**
|
||||
* Flag that indicates whether the server supports In-Band Registration.
|
||||
* In-Band Registration may be advertised as a stream feature. If no stream feature
|
||||
* was advertised from the server then try sending an IQ packet to discover if In-Band
|
||||
* was advertised from the server then try sending an IQ stanza(/packet) to discover if In-Band
|
||||
* Registration is available.
|
||||
*/
|
||||
private boolean accountCreationSupported = false;
|
||||
|
@ -113,7 +113,7 @@ public class AccountManager extends Manager {
|
|||
/**
|
||||
* Sets whether the server supports In-Band Registration. In-Band Registration may be
|
||||
* advertised as a stream feature. If no stream feature was advertised from the server
|
||||
* then try sending an IQ packet to discover if In-Band Registration is available.
|
||||
* then try sending an IQ stanza(/packet) to discover if In-Band Registration is available.
|
||||
*
|
||||
* @param accountCreationSupported true if the server supports In-Band Registration.
|
||||
*/
|
||||
|
|
|
@ -28,7 +28,7 @@ public class JivePropertiesManager {
|
|||
private static boolean javaObjectEnabled = false;
|
||||
|
||||
/**
|
||||
* Enables deserialization of Java objects embedded in the 'properties' packet extension. Since
|
||||
* Enables deserialization of Java objects embedded in the 'properties' stanza(/packet) extension. Since
|
||||
* this is a security sensitive feature, it is disabled per default in Smack. Only enable it if
|
||||
* you are sure that you understand the potential security implications it can cause.
|
||||
* <p>
|
||||
|
@ -49,7 +49,7 @@ public class JivePropertiesManager {
|
|||
/**
|
||||
* Convenience method to add a property to a packet.
|
||||
*
|
||||
* @param packet the packet to add the property to.
|
||||
* @param packet the stanza(/packet) to add the property to.
|
||||
* @param name the name of the property to add.
|
||||
* @param value the value of the property to add.
|
||||
*/
|
||||
|
@ -63,7 +63,7 @@ public class JivePropertiesManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Convenience method to get a property from a packet. Will return null if the packet contains
|
||||
* Convenience method to get a property from a packet. Will return null if the stanza(/packet) contains
|
||||
* not property with the given name.
|
||||
*
|
||||
* @param packet
|
||||
|
@ -95,7 +95,7 @@ public class JivePropertiesManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return a map of all properties of the given packet. If the packet contains no properties
|
||||
* Return a map of all properties of the given packet. If the stanza(/packet) contains no properties
|
||||
* extension, an empty map will be returned.
|
||||
*
|
||||
* @param packet
|
||||
|
|
|
@ -40,7 +40,7 @@ import org.jivesoftware.smack.util.stringencoder.Base64;
|
|||
*/
|
||||
public class JivePropertiesExtension implements ExtensionElement {
|
||||
/**
|
||||
* Namespace used to store packet properties.
|
||||
* Namespace used to store stanza(/packet) properties.
|
||||
*/
|
||||
public static final String NAMESPACE = "http://www.jivesoftware.com/xmlns/xmpp/properties";
|
||||
|
||||
|
@ -59,7 +59,7 @@ public class JivePropertiesExtension implements ExtensionElement {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the packet property with the specified name or <tt>null</tt> if the
|
||||
* Returns the stanza(/packet) property with the specified name or <tt>null</tt> if the
|
||||
* property doesn't exist. Property values that were originally primitives will
|
||||
* be returned as their object equivalent. For example, an int property will be
|
||||
* returned as an Integer, a double as a Double, etc.
|
||||
|
|
|
@ -39,7 +39,7 @@ public class JivePropertiesExtensionProvider extends ExtensionElementProvider<Ji
|
|||
* Parse a properties sub-packet. If any errors occur while de-serializing Java object
|
||||
* properties, an exception will be printed and not thrown since a thrown exception will shut
|
||||
* down the entire connection. ClassCastExceptions will occur when both the sender and receiver
|
||||
* of the packet don't have identical versions of the same class.
|
||||
* of the stanza(/packet) don't have identical versions of the same class.
|
||||
* <p>
|
||||
* Note that you have to explicitly enabled Java object deserialization with @{link
|
||||
* {@link JivePropertiesManager#setJavaObjectEnabled(boolean)}
|
||||
|
|
|
@ -781,10 +781,10 @@ public class MultiUserChat {
|
|||
|
||||
/**
|
||||
* Adds a new {@link StanzaListener} that will be invoked every time a new presence
|
||||
* is going to be sent by this MultiUserChat to the server. Packet interceptors may
|
||||
* is going to be sent by this MultiUserChat to the server. Stanza(/Packet) interceptors may
|
||||
* add new extensions to the presence that is going to be sent to the MUC service.
|
||||
*
|
||||
* @param presenceInterceptor the new packet interceptor that will intercept presence packets.
|
||||
* @param presenceInterceptor the new stanza(/packet) interceptor that will intercept presence packets.
|
||||
*/
|
||||
public void addPresenceInterceptor(PresenceListener presenceInterceptor) {
|
||||
presenceInterceptors.add(presenceInterceptor);
|
||||
|
@ -792,10 +792,10 @@ public class MultiUserChat {
|
|||
|
||||
/**
|
||||
* Removes a {@link StanzaListener} that was being invoked every time a new presence
|
||||
* was being sent by this MultiUserChat to the server. Packet interceptors may
|
||||
* was being sent by this MultiUserChat to the server. Stanza(/Packet) interceptors may
|
||||
* add new extensions to the presence that is going to be sent to the MUC service.
|
||||
*
|
||||
* @param presenceInterceptor the packet interceptor to remove.
|
||||
* @param presenceInterceptor the stanza(/packet) interceptor to remove.
|
||||
*/
|
||||
public void removePresenceInterceptor(StanzaListener presenceInterceptor) {
|
||||
presenceInterceptors.remove(presenceInterceptor);
|
||||
|
@ -1470,11 +1470,11 @@ public class MultiUserChat {
|
|||
}
|
||||
|
||||
/**
|
||||
* Adds a packet listener that will be notified of any new Presence packets
|
||||
* Adds a stanza(/packet) listener that will be notified of any new Presence packets
|
||||
* sent to the group chat. Using a listener is a suitable way to know when the list
|
||||
* of occupants should be re-loaded due to any changes.
|
||||
*
|
||||
* @param listener a packet listener that will be notified of any presence packets
|
||||
* @param listener a stanza(/packet) listener that will be notified of any presence packets
|
||||
* sent to the group chat.
|
||||
* @return true if the listener was not already added.
|
||||
*/
|
||||
|
@ -1483,10 +1483,10 @@ public class MultiUserChat {
|
|||
}
|
||||
|
||||
/**
|
||||
* Removes a packet listener that was being notified of any new Presence packets
|
||||
* Removes a stanza(/packet) listener that was being notified of any new Presence packets
|
||||
* sent to the group chat.
|
||||
*
|
||||
* @param listener a packet listener that was being notified of any presence packets
|
||||
* @param listener a stanza(/packet) listener that was being notified of any presence packets
|
||||
* sent to the group chat.
|
||||
* @return true if the listener was removed, otherwise the listener was not added previously.
|
||||
*/
|
||||
|
@ -1715,7 +1715,7 @@ public class MultiUserChat {
|
|||
|
||||
/**
|
||||
* Returns the next available message in the chat. The method call will block
|
||||
* (not return) until a packet is available or the <tt>timeout</tt> has elapased.
|
||||
* (not return) until a stanza(/packet) is available or the <tt>timeout</tt> has elapased.
|
||||
* If the timeout elapses without a result, <tt>null</tt> will be returned.
|
||||
*
|
||||
* @param timeout the maximum amount of time to wait for the next message.
|
||||
|
@ -1732,14 +1732,14 @@ public class MultiUserChat {
|
|||
}
|
||||
|
||||
/**
|
||||
* Adds a packet listener that will be notified of any new messages in the
|
||||
* Adds a stanza(/packet) listener that will be notified of any new messages in the
|
||||
* group chat. Only "group chat" messages addressed to this group chat will
|
||||
* be delivered to the listener. If you wish to listen for other packets
|
||||
* that may be associated with this group chat, you should register a
|
||||
* PacketListener directly with the XMPPConnection with the appropriate
|
||||
* PacketListener.
|
||||
*
|
||||
* @param listener a packet listener.
|
||||
* @param listener a stanza(/packet) listener.
|
||||
* @return true if the listener was not already added.
|
||||
*/
|
||||
public boolean addMessageListener(MessageListener listener) {
|
||||
|
@ -1747,11 +1747,11 @@ public class MultiUserChat {
|
|||
}
|
||||
|
||||
/**
|
||||
* Removes a packet listener that was being notified of any new messages in the
|
||||
* Removes a stanza(/packet) listener that was being notified of any new messages in the
|
||||
* multi user chat. Only "group chat" messages addressed to this multi user chat were
|
||||
* being delivered to the listener.
|
||||
*
|
||||
* @param listener a packet listener.
|
||||
* @param listener a stanza(/packet) listener.
|
||||
* @return true if the listener was removed, otherwise the listener was not added previously.
|
||||
*/
|
||||
public boolean removeMessageListener(MessageListener listener) {
|
||||
|
|
|
@ -74,7 +74,7 @@ public class RoomInfo {
|
|||
*/
|
||||
private final boolean moderated;
|
||||
/**
|
||||
* Every presence packet can include the JID of every occupant unless the owner deactives this
|
||||
* Every presence stanza(/packet) can include the JID of every occupant unless the owner deactives this
|
||||
* configuration.
|
||||
*/
|
||||
private final boolean nonanonymous;
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/**
|
||||
* A group chat invitation packet extension, which is used to invite other
|
||||
* A group chat invitation stanza(/packet) extension, which is used to invite other
|
||||
* users to a group chat room. To invite a user to a group chat room, address
|
||||
* a new message to the user and set the room name appropriately, as in the
|
||||
* following code example:
|
||||
|
@ -45,7 +45,7 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||
*
|
||||
* <pre>
|
||||
* PacketFilter filter = new StanzaExtensionFilter("x", "jabber:x:conference");
|
||||
* // Create a packet collector or packet listeners using the filter...
|
||||
* // Create a stanza(/packet) collector or stanza(/packet) listeners using the filter...
|
||||
* </pre>
|
||||
*
|
||||
* <b>Note</b>: this protocol is outdated now that the Multi-User Chat (MUC) XEP is available
|
||||
|
@ -58,12 +58,12 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||
public class GroupChatInvitation implements ExtensionElement {
|
||||
|
||||
/**
|
||||
* Element name of the packet extension.
|
||||
* Element name of the stanza(/packet) extension.
|
||||
*/
|
||||
public static final String ELEMENT = "x";
|
||||
|
||||
/**
|
||||
* Namespace of the packet extension.
|
||||
* Namespace of the stanza(/packet) extension.
|
||||
*/
|
||||
public static final String NAMESPACE = "jabber:x:conference";
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.List;
|
|||
import org.jivesoftware.smack.packet.IQ;
|
||||
|
||||
/**
|
||||
* IQ packet that serves for kicking users, granting and revoking voice, banning users,
|
||||
* IQ stanza(/packet) that serves for kicking users, granting and revoking voice, banning users,
|
||||
* modifying the ban list, granting and revoking membership and granting and revoking
|
||||
* moderator privileges. All these operations are scoped by the
|
||||
* 'http://jabber.org/protocol/muc#admin' namespace.
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* IQ packet that serves for granting and revoking ownership privileges, granting
|
||||
* IQ stanza(/packet) that serves for granting and revoking ownership privileges, granting
|
||||
* and revoking administrative privileges and destroying a room. All these operations
|
||||
* are scoped by the 'http://jabber.org/protocol/muc#owner' namespace.
|
||||
*
|
||||
|
|
|
@ -133,7 +133,7 @@ public class MUCUser implements ExtensionElement {
|
|||
|
||||
/**
|
||||
* Returns the notification that the room has been destroyed. After a room has been destroyed,
|
||||
* the room occupants will receive a Presence packet of type 'unavailable' with the reason for
|
||||
* the room occupants will receive a Presence stanza(/packet) of type 'unavailable' with the reason for
|
||||
* the room destruction if provided by the room owner.
|
||||
*
|
||||
* @return a notification that the room has been destroyed.
|
||||
|
@ -203,7 +203,7 @@ public class MUCUser implements ExtensionElement {
|
|||
|
||||
/**
|
||||
* Sets the notification that the room has been destroyed. After a room has been destroyed,
|
||||
* the room occupants will receive a Presence packet of type 'unavailable' with the reason for
|
||||
* the room occupants will receive a Presence stanza(/packet) of type 'unavailable' with the reason for
|
||||
* the room destruction if provided by the room owner.
|
||||
*
|
||||
* @param destroy the notification that the room has been destroyed.
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||
public class MUCUserProvider extends ExtensionElementProvider<MUCUser> {
|
||||
|
||||
/**
|
||||
* Parses a MUCUser packet (extension sub-packet).
|
||||
* Parses a MUCUser stanza(/packet) (extension sub-packet).
|
||||
*
|
||||
* @param parser the XML parser, positioned at the starting element of the extension.
|
||||
* @return a PacketExtension.
|
||||
|
|
|
@ -40,7 +40,7 @@ public class OfflineMessageInfo implements ExtensionElement {
|
|||
* Returns the XML element name of the extension sub-packet root element.
|
||||
* Always returns "offline"
|
||||
*
|
||||
* @return the XML element name of the packet extension.
|
||||
* @return the XML element name of the stanza(/packet) extension.
|
||||
*/
|
||||
public String getElementName() {
|
||||
return "offline";
|
||||
|
@ -50,7 +50,7 @@ public class OfflineMessageInfo implements ExtensionElement {
|
|||
* Returns the XML namespace of the extension sub-packet root element.
|
||||
* According the specification the namespace is always "http://jabber.org/protocol/offline"
|
||||
*
|
||||
* @return the XML namespace of the packet extension.
|
||||
* @return the XML namespace of the stanza(/packet) extension.
|
||||
*/
|
||||
public String getNamespace() {
|
||||
return "http://jabber.org/protocol/offline";
|
||||
|
@ -91,7 +91,7 @@ public class OfflineMessageInfo implements ExtensionElement {
|
|||
public static class Provider extends ExtensionElementProvider<OfflineMessageInfo> {
|
||||
|
||||
/**
|
||||
* Parses a OfflineMessageInfo packet (extension sub-packet).
|
||||
* Parses a OfflineMessageInfo stanza(/packet) (extension sub-packet).
|
||||
*
|
||||
* @param parser the XML parser, positioned at the starting element of the extension.
|
||||
* @return a PacketExtension.
|
||||
|
|
|
@ -57,7 +57,7 @@ public class PEPEvent implements ExtensionElement {
|
|||
* Returns the XML element name of the extension sub-packet root element.
|
||||
* Always returns "x"
|
||||
*
|
||||
* @return the XML element name of the packet extension.
|
||||
* @return the XML element name of the stanza(/packet) extension.
|
||||
*/
|
||||
public String getElementName() {
|
||||
return "event";
|
||||
|
@ -68,7 +68,7 @@ public class PEPEvent implements ExtensionElement {
|
|||
* According the specification the namespace is always "jabber:x:roster"
|
||||
* (which is not to be confused with the 'jabber:iq:roster' namespace
|
||||
*
|
||||
* @return the XML namespace of the packet extension.
|
||||
* @return the XML namespace of the stanza(/packet) extension.
|
||||
*/
|
||||
public String getNamespace() {
|
||||
return "http://jabber.org/protocol/pubsub";
|
||||
|
|
|
@ -46,7 +46,7 @@ public abstract class PEPItem implements ExtensionElement {
|
|||
* Returns the XML element name of the extension sub-packet root element.
|
||||
* Always returns "x"
|
||||
*
|
||||
* @return the XML element name of the packet extension.
|
||||
* @return the XML element name of the stanza(/packet) extension.
|
||||
*/
|
||||
public String getElementName() {
|
||||
return "item";
|
||||
|
@ -55,7 +55,7 @@ public abstract class PEPItem implements ExtensionElement {
|
|||
/**
|
||||
* Returns the XML namespace of the extension sub-packet root element.
|
||||
*
|
||||
* @return the XML namespace of the packet extension.
|
||||
* @return the XML namespace of the stanza(/packet) extension.
|
||||
*/
|
||||
public String getNamespace() {
|
||||
return "http://jabber.org/protocol/pubsub";
|
||||
|
|
|
@ -50,7 +50,7 @@ public class PEPProvider extends ExtensionElementProvider<ExtensionElement> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Parses a PEPEvent packet and extracts a PEPItem from it.
|
||||
* Parses a PEPEvent stanza(/packet) and extracts a PEPItem from it.
|
||||
* (There is only one per <event>.)
|
||||
*
|
||||
* @param parser the XML parser, positioned at the starting element of the extension.
|
||||
|
|
|
@ -215,10 +215,10 @@ public class PrivacyListManager extends Manager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Send the {@link Privacy} packet to the server in order to know some privacy content and then
|
||||
* Send the {@link Privacy} stanza(/packet) to the server in order to know some privacy content and then
|
||||
* waits for the answer.
|
||||
*
|
||||
* @param requestPrivacy is the {@link Privacy} packet configured properly whose XML
|
||||
* @param requestPrivacy is the {@link Privacy} stanza(/packet) configured properly whose XML
|
||||
* will be sent to the server.
|
||||
* @return a new {@link Privacy} with the data received from the server.
|
||||
* @throws XMPPErrorException
|
||||
|
@ -234,10 +234,10 @@ public class PrivacyListManager extends Manager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Send the {@link Privacy} packet to the server in order to modify the server privacy and waits
|
||||
* Send the {@link Privacy} stanza(/packet) to the server in order to modify the server privacy and waits
|
||||
* for the answer.
|
||||
*
|
||||
* @param requestPrivacy is the {@link Privacy} packet configured properly whose xml will be
|
||||
* @param requestPrivacy is the {@link Privacy} stanza(/packet) configured properly whose xml will be
|
||||
* sent to the server.
|
||||
* @return a new {@link Privacy} with the data received from the server.
|
||||
* @throws XMPPErrorException
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.privacy.packet;
|
|||
import org.jivesoftware.smack.util.NumberUtil;
|
||||
|
||||
/**
|
||||
* A privacy item acts a rule that when matched defines if a packet should be blocked or not.
|
||||
* A privacy item acts a rule that when matched defines if a stanza(/packet) should be blocked or not.
|
||||
*
|
||||
* Privacy Items can handle different kind of blocking communications based on JID, group,
|
||||
* subscription type or globally by:<ul>
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub;
|
|||
import org.jivesoftware.smackx.xdata.Form;
|
||||
|
||||
/**
|
||||
* Generic packet extension which represents any pubsub form that is
|
||||
* Generic stanza(/packet) extension which represents any pubsub form that is
|
||||
* parsed from the incoming stream or being sent out to the server.
|
||||
*
|
||||
* Form types are defined in {@link FormNodeType}.
|
||||
|
|
|
@ -163,7 +163,7 @@ public class LeafNode extends Node
|
|||
* Get items persisted on the node.
|
||||
* <p>
|
||||
* {@code additionalExtensions} can be used e.g. to add a "Result Set Management" extension.
|
||||
* {@code returnedExtensions} will be filled with the packet extensions found in the answer.
|
||||
* {@code returnedExtensions} will be filled with the stanza(/packet) extensions found in the answer.
|
||||
* </p>
|
||||
*
|
||||
* @param additionalExtensions additional {@code PacketExtensions} to be added to the request.
|
||||
|
@ -209,7 +209,7 @@ public class LeafNode extends Node
|
|||
* and {@link ConfigureForm#isDeliverPayloads()}=false.
|
||||
*
|
||||
* This is an asynchronous call which returns as soon as the
|
||||
* packet has been sent.
|
||||
* stanza(/packet) has been sent.
|
||||
*
|
||||
* For synchronous calls use {@link #send() send()}.
|
||||
* @throws NotConnectedException
|
||||
|
@ -231,7 +231,7 @@ public class LeafNode extends Node
|
|||
* publishes an event with NO item.
|
||||
*
|
||||
* This is an asynchronous call which returns as soon as the
|
||||
* packet has been sent.
|
||||
* stanza(/packet) has been sent.
|
||||
*
|
||||
* For synchronous calls use {@link #send(Item) send(Item))}.
|
||||
*
|
||||
|
@ -254,7 +254,7 @@ public class LeafNode extends Node
|
|||
* list will get stored on the node, assuming it stores the last sent item.
|
||||
*
|
||||
* This is an asynchronous call which returns as soon as the
|
||||
* packet has been sent.
|
||||
* stanza(/packet) has been sent.
|
||||
*
|
||||
* For synchronous calls use {@link #send(Collection) send(Collection))}.
|
||||
*
|
||||
|
|
|
@ -158,7 +158,7 @@ abstract public class Node
|
|||
* Get the subscriptions currently associated with this node.
|
||||
* <p>
|
||||
* {@code additionalExtensions} can be used e.g. to add a "Result Set Management" extension.
|
||||
* {@code returnedExtensions} will be filled with the packet extensions found in the answer.
|
||||
* {@code returnedExtensions} will be filled with the stanza(/packet) extensions found in the answer.
|
||||
* </p>
|
||||
*
|
||||
* @param additionalExtensions
|
||||
|
@ -200,11 +200,11 @@ abstract public class Node
|
|||
* </p>
|
||||
* <p>
|
||||
* {@code additionalExtensions} can be used e.g. to add a "Result Set Management" extension.
|
||||
* {@code returnedExtensions} will be filled with the packet extensions found in the answer.
|
||||
* {@code returnedExtensions} will be filled with the stanza(/packet) extensions found in the answer.
|
||||
* </p>
|
||||
*
|
||||
* @param additionalExtensions
|
||||
* @param returnedExtensions a collection that will be filled with the returned packet extensions
|
||||
* @param returnedExtensions a collection that will be filled with the returned stanza(/packet) extensions
|
||||
* @return List of {@link Subscription}
|
||||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException
|
||||
|
@ -255,7 +255,7 @@ abstract public class Node
|
|||
* Get the affiliations of this node.
|
||||
* <p>
|
||||
* {@code additionalExtensions} can be used e.g. to add a "Result Set Management" extension.
|
||||
* {@code returnedExtensions} will be filled with the packet extensions found in the answer.
|
||||
* {@code returnedExtensions} will be filled with the stanza(/packet) extensions found in the answer.
|
||||
* </p>
|
||||
*
|
||||
* @param additionalExtensions additional {@code PacketExtensions} add to the request
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub;
|
|||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
/**
|
||||
* A packet extension representing the <b>options</b> element.
|
||||
* A stanza(/packet) extension representing the <b>options</b> element.
|
||||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
|
|
|
@ -50,7 +50,7 @@ public class PubSub extends IQ
|
|||
/**
|
||||
* Returns the XML element name of the extension sub-packet root element.
|
||||
*
|
||||
* @return the XML element name of the packet extension.
|
||||
* @return the XML element name of the stanza(/packet) extension.
|
||||
*/
|
||||
@SuppressWarnings("static-method")
|
||||
public String getElementName() {
|
||||
|
@ -66,7 +66,7 @@ public class PubSub extends IQ
|
|||
/**
|
||||
* Returns the XML representation of a pubsub element according the specification.
|
||||
*
|
||||
* The XML representation will be inside of an iq packet like
|
||||
* The XML representation will be inside of an iq stanza(/packet) like
|
||||
* in the following example:
|
||||
* <pre>
|
||||
* <iq type='set' id="MlIpV-4" to="pubsub.gato.home" from="gato3@gato.home/Smack">
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
|
|||
import org.xmlpull.v1.XmlPullParser;
|
||||
|
||||
/**
|
||||
* Parses the root pubsub packet extensions of the {@link IQ} packet and returns
|
||||
* Parses the root pubsub stanza(/packet) extensions of the {@link IQ} stanza(/packet) and returns
|
||||
* a {@link PubSub} instance.
|
||||
*
|
||||
* @author Robin Collier
|
||||
|
|
|
@ -50,7 +50,7 @@ import org.jxmpp.jid.Jid;
|
|||
* </p>
|
||||
* <pre>
|
||||
* deliveryReceiptManager.addReceiptReceivedListener(new ReceiptReceivedListener() {
|
||||
* void onReceiptReceived(String fromJid, String toJid, String receiptId, Packet receipt) {
|
||||
* void onReceiptReceived(String fromJid, String toJid, String receiptId, Stanza(/Packet) receipt) {
|
||||
* // If the receiving entity does not support delivery receipts,
|
||||
* // then the receipt received listener may not get invoked.
|
||||
* }
|
||||
|
@ -266,7 +266,7 @@ public class DeliveryReceiptManager extends Manager {
|
|||
/**
|
||||
* Test if a message requires a delivery receipt.
|
||||
*
|
||||
* @param message Packet object to check for a DeliveryReceiptRequest
|
||||
* @param message Stanza(/Packet) object to check for a DeliveryReceiptRequest
|
||||
*
|
||||
* @return true if a delivery receipt was requested
|
||||
*/
|
||||
|
|
|
@ -34,7 +34,7 @@ public interface ReceiptReceivedListener {
|
|||
*
|
||||
* @param fromJid the jid that send this receipt
|
||||
* @param toJid the jid which received this receipt
|
||||
* @param receiptId the message ID of the packet which has been received and this receipt is for
|
||||
* @param receiptId the message ID of the stanza(/packet) which has been received and this receipt is for
|
||||
* @param receipt the receipt
|
||||
*/
|
||||
void onReceiptReceived(Jid fromJid, Jid toJid, String receiptId, Stanza receipt);
|
||||
|
|
|
@ -38,10 +38,10 @@ public class ReportedData {
|
|||
private String title = "";
|
||||
|
||||
/**
|
||||
* Returns a new ReportedData if the packet is used for reporting data and includes an
|
||||
* Returns a new ReportedData if the stanza(/packet) is used for reporting data and includes an
|
||||
* extension that matches the elementName and namespace "x","jabber:x:data".
|
||||
*
|
||||
* @param packet the packet used for reporting data.
|
||||
* @param packet the stanza(/packet) used for reporting data.
|
||||
*/
|
||||
public static ReportedData getReportedDataFrom(Stanza packet) {
|
||||
// Check if the packet includes the DataForm extension
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* IQ packet used for discovering the user's shared groups and for getting the answer back
|
||||
* IQ stanza(/packet) used for discovering the user's shared groups and for getting the answer back
|
||||
* from the server.<p>
|
||||
*
|
||||
* Important note: This functionality is not part of the XMPP spec and it will only work
|
||||
|
|
|
@ -46,11 +46,11 @@ public class Form {
|
|||
private DataForm dataForm;
|
||||
|
||||
/**
|
||||
* Returns a new ReportedData if the packet is used for gathering data and includes an
|
||||
* Returns a new ReportedData if the stanza(/packet) is used for gathering data and includes an
|
||||
* extension that matches the elementName and namespace "x","jabber:x:data".
|
||||
*
|
||||
* @param packet the packet used for gathering data.
|
||||
* @return the data form parsed from the packet or <tt>null</tt> if there was not
|
||||
* @param packet the stanza(/packet) used for gathering data.
|
||||
* @return the data form parsed from the stanza(/packet) or <tt>null</tt> if there was not
|
||||
* a form in the packet.
|
||||
*/
|
||||
public static Form getFormFrom(Stanza packet) {
|
||||
|
|
|
@ -41,7 +41,7 @@ public class DataForm implements ExtensionElement {
|
|||
|
||||
public enum Type {
|
||||
/**
|
||||
* This packet contains a form to fill out. Display it to the user (if your program can).
|
||||
* This stanza(/packet) contains a form to fill out. Display it to the user (if your program can).
|
||||
*/
|
||||
form,
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ public class XHTMLExtension implements ExtensionElement {
|
|||
* Returns the XML element name of the extension sub-packet root element.
|
||||
* Always returns "html"
|
||||
*
|
||||
* @return the XML element name of the packet extension.
|
||||
* @return the XML element name of the stanza(/packet) extension.
|
||||
*/
|
||||
public String getElementName() {
|
||||
return ELEMENT;
|
||||
|
@ -56,7 +56,7 @@ public class XHTMLExtension implements ExtensionElement {
|
|||
* Returns the XML namespace of the extension sub-packet root element.
|
||||
* According the specification the namespace is always "http://jabber.org/protocol/xhtml-im"
|
||||
*
|
||||
* @return the XML namespace of the packet extension.
|
||||
* @return the XML namespace of the stanza(/packet) extension.
|
||||
*/
|
||||
public String getNamespace() {
|
||||
return NAMESPACE;
|
||||
|
|
|
@ -17,5 +17,6 @@
|
|||
<className>org.jivesoftware.smackx.xdatavalidation.XDataValidationManager</className>
|
||||
<className>org.jivesoftware.smackx.receipts.DeliveryReceiptManager</className>
|
||||
<className>org.jivesoftware.smackx.iqversion.VersionManager</className>
|
||||
<className>org.jivesoftware.smackx.caps.EntityCapsManager</className>
|
||||
</startupClasses>
|
||||
</smack>
|
||||
|
|
|
@ -42,7 +42,7 @@ public class DataListenerTest {
|
|||
static final Jid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1;
|
||||
|
||||
/**
|
||||
* If a data packet of an unknown session is received it should be replied
|
||||
* If a data stanza(/packet) of an unknown session is received it should be replied
|
||||
* with an <item-not-found/> error.
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
|
|
|
@ -248,7 +248,7 @@ public class InBandBytestreamSessionMessageTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* If a data packet is received out of order the session should be closed. See XEP-0047 Section
|
||||
* If a data stanza(/packet) is received out of order the session should be closed. See XEP-0047 Section
|
||||
* 2.2.
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
|
|
|
@ -358,7 +358,7 @@ public class InBandBytestreamSessionTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* If the data packet has a sequence that is already used an 'unexpected-request' error should
|
||||
* If the data stanza(/packet) has a sequence that is already used an 'unexpected-request' error should
|
||||
* be returned. See XEP-0047 Section 2.2.
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
|
@ -399,7 +399,7 @@ public class InBandBytestreamSessionTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* If the data packet contains invalid Base64 encoding an 'bad-request' error should be
|
||||
* If the data stanza(/packet) contains invalid Base64 encoding an 'bad-request' error should be
|
||||
* returned. See XEP-0047 Section 2.2.
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
|
@ -434,7 +434,7 @@ public class InBandBytestreamSessionTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* If a data packet is received out of order the session should be closed. See XEP-0047 Section
|
||||
* If a data stanza(/packet) is received out of order the session should be closed. See XEP-0047 Section
|
||||
* 2.2.
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
|
|
|
@ -49,7 +49,7 @@ public class Socks5PacketUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a response to a SOCKS5 Bytestream initialization request. The packet doesn't contain
|
||||
* Returns a response to a SOCKS5 Bytestream initialization request. The stanza(/packet) doesn't contain
|
||||
* the uses-host information.
|
||||
*
|
||||
* @param from the target
|
||||
|
@ -65,7 +65,7 @@ public class Socks5PacketUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a response to an item discovery request. The packet doesn't contain any items.
|
||||
* Returns a response to an item discovery request. The stanza(/packet) doesn't contain any items.
|
||||
*
|
||||
* @param from the XMPP server
|
||||
* @param to the XMPP client
|
||||
|
@ -80,7 +80,7 @@ public class Socks5PacketUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a response to an info discovery request. The packet doesn't contain any infos.
|
||||
* Returns a response to an info discovery request. The stanza(/packet) doesn't contain any infos.
|
||||
*
|
||||
* @param from the target
|
||||
* @param to the initiator
|
||||
|
|
|
@ -45,7 +45,7 @@ import org.mockito.stubbing.Answer;
|
|||
public class ConnectionUtils {
|
||||
|
||||
/**
|
||||
* Creates a mocked XMPP connection that stores every packet that is send over this
|
||||
* Creates a mocked XMPP connection that stores every stanza(/packet) that is send over this
|
||||
* connection in the given protocol instance and returns the predefined answer packets
|
||||
* form the protocol instance.
|
||||
* <p>
|
||||
|
@ -56,7 +56,7 @@ public class ConnectionUtils {
|
|||
* <code>
|
||||
* PacketCollector collector = connection.createPacketCollector(new PacketFilter());
|
||||
* connection.sendStanza(packet);
|
||||
* Packet reply = collector.nextResult();
|
||||
* Stanza(/Packet) reply = collector.nextResult();
|
||||
* </code>
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -50,10 +50,10 @@ import org.jivesoftware.smack.packet.Stanza;
|
|||
* <pre>
|
||||
* <code>
|
||||
* public void methodToTest() {
|
||||
* Packet packet = new Packet(); // create an XMPP packet
|
||||
* Stanza(/Packet) stanza(/packet) = new Packet(); // create an XMPP packet
|
||||
* PacketCollector collector = connection.createPacketCollector(new StanzaIdFilter());
|
||||
* connection.sendStanza(packet);
|
||||
* Packet reply = collector.nextResult();
|
||||
* Stanza(/Packet) reply = collector.nextResult();
|
||||
* }
|
||||
*
|
||||
* public void testMethod() {
|
||||
|
@ -62,8 +62,8 @@ import org.jivesoftware.smack.packet.Stanza;
|
|||
* // create mocked connection
|
||||
* XMPPConnection connection = ConnectionUtils.createMockedConnection(protocol, "user@xmpp-server", "xmpp-server");
|
||||
*
|
||||
* // add reply packet to protocol
|
||||
* Packet reply = new Packet();
|
||||
* // add reply stanza(/packet) to protocol
|
||||
* Stanza(/Packet) reply = new Packet();
|
||||
* protocol.add(reply);
|
||||
*
|
||||
* // call method to test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue