1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-10 02:39:42 +02:00

Globally 's;stanza(/packet);stanza;'

This commit is contained in:
Florian Schmaus 2018-03-31 14:17:30 +02:00
parent 1d12be1644
commit ad87243060
171 changed files with 911 additions and 599 deletions

View file

@ -37,7 +37,7 @@ public class IQTest extends SmackTestCase {
}
/**
* Check that the server responds a 503 error code when the client sends an IQ stanza(/packet) with an
* Check that the server responds a 503 error code when the client sends an IQ stanza with an
* invalid namespace.
*/
public void testInvalidNamespace() {

View file

@ -49,7 +49,7 @@ public class PacketIDFilterTest extends TestCase {
}
/**
* Wraps the MockPacket class to always give an expected stanza(/packet) ID field.
* Wraps the MockPacket class to always give an expected stanza ID field.
*/
private class MockIDPacket extends MockPacket {
private String id;

View file

@ -132,24 +132,24 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
private final Collection<StanzaCollector> collectors = new ConcurrentLinkedQueue<>();
/**
* List of PacketListeners that will be notified synchronously when a new stanza(/packet) was received.
* List of PacketListeners that will be notified synchronously when a new stanza was received.
*/
private final Map<StanzaListener, ListenerWrapper> syncRecvListeners = new LinkedHashMap<>();
/**
* List of PacketListeners that will be notified asynchronously when a new stanza(/packet) was received.
* List of PacketListeners that will be notified asynchronously when a new stanza was received.
*/
private final Map<StanzaListener, ListenerWrapper> asyncRecvListeners = new LinkedHashMap<>();
/**
* List of PacketListeners that will be notified when a new stanza(/packet) was sent.
* List of PacketListeners that will be notified when a new stanza was sent.
*/
private final Map<StanzaListener, ListenerWrapper> sendListeners =
new HashMap<>();
/**
* List of PacketListeners that will be notified when a new stanza(/packet) is about to be
* sent to the server. These interceptors may modify the stanza(/packet) before it is being
* List of PacketListeners that will be notified when a new stanza is about to be
* sent to the server. These interceptors may modify the stanza before it is being
* actually sent to the server.
*/
private final Map<StanzaListener, InterceptorWrapper> interceptors =
@ -267,7 +267,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
});
/**
* A executor service used to invoke the callbacks of synchronous stanza(/packet) listeners. We use a executor service to
* A executor service used to invoke the callbacks of synchronous stanza listeners. We use a executor service to
* decouple incoming stanza processing from callback invocation. It is important that order of callback invocation
* is the same as the order of the incoming stanzas. Therefore we use a <i>single</i> threaded executor service.
*/
@ -420,7 +420,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Logs in to the server using the strongest SASL mechanism supported by
* the server. If more than the connection's default stanza(/packet) timeout elapses in each step of the
* the server. If more than the connection's default stanza timeout elapses in each step of the
* authentication process without a response from the server, a
* {@link SmackException.NoResponseException} will be thrown.
* <p>
@ -716,8 +716,8 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* by closing the stream. The XMPPConnection can still be used for connecting to the server
* again. A custom unavailable presence is useful for communicating offline presence
* information such as "On vacation". Typically, just the status text of the presence
* stanza(/packet) is set with online information, but most XMPP servers will deliver the full
* presence stanza(/packet) with whatever data is set.
* stanza is set with online information, but most XMPP servers will deliver the full
* presence stanza with whatever data is set.
*
* @param unavailablePresence the optional presence stanza to send during shutdown.
* @throws NotConnectedException
@ -874,12 +874,12 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
}
/**
* Process all stanza(/packet) listeners for sending packets.
* Process all stanza listeners for sending packets.
* <p>
* Compared to {@link #firePacketInterceptors(Stanza)}, the listeners will be invoked in a new thread.
* </p>
*
* @param packet the stanza(/packet) to process.
* @param packet the stanza to process.
*/
@SuppressWarnings("javadoc")
protected void firePacketSendingListeners(final Stanza packet) {
@ -949,12 +949,12 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
}
/**
* Process interceptors. Interceptors may modify the stanza(/packet) that is about to be sent.
* Since the thread that requested to send the stanza(/packet) will invoke all interceptors, it
* Process interceptors. Interceptors may modify the stanza that is about to be sent.
* Since the thread that requested to send the stanza will invoke all interceptors, it
* is important that interceptors perform their work as soon as possible so that the
* thread does not remain blocked for a long period.
*
* @param packet the stanza(/packet) that is going to be sent to the server
* @param packet the stanza that is going to be sent to the server
*/
private void firePacketInterceptors(Stanza packet) {
List<StanzaListener> interceptorsToInvoke = new LinkedList<>();
@ -1037,8 +1037,8 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
}
/**
* Processes a stanza(/packet) after it's been fully parsed by looping through the installed
* stanza(/packet) collectors and listeners and letting them examine the stanza(/packet) to see if
* Processes a stanza after it's been fully parsed by looping through the installed
* stanza collectors and listeners and letting them examine the stanza to see if
* they are a match with the filter.
*
* @param stanza the stanza to process.
@ -1059,14 +1059,14 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Invoke {@link StanzaCollector#processStanza(Stanza)} for every
* StanzaCollector with the given packet. Also notify the receive listeners with a matching stanza(/packet) filter about the packet.
* StanzaCollector with the given packet. Also notify the receive listeners with a matching stanza filter about the packet.
* <p>
* This method will be invoked by the connections incoming processing thread which may be shared across multiple connections and
* thus it is important that no user code, e.g. in form of a callback, is invoked by this method. For the same reason,
* this method must not block for an extended period of time.
* </p>
*
* @param packet the stanza(/packet) to notify the StanzaCollectors and receive listeners about.
* @param packet the stanza to notify the StanzaCollectors and receive listeners about.
*/
protected void invokeStanzaCollectorsAndNotifyRecvListeners(final Stanza packet) {
if (packet instanceof IQ) {
@ -1302,7 +1302,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
}
/**
* A wrapper class to associate a stanza(/packet) filter with a listener.
* A wrapper class to associate a stanza filter with a listener.
*/
protected static class ListenerWrapper {
@ -1310,9 +1310,9 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
private final StanzaFilter packetFilter;
/**
* Create a class which associates a stanza(/packet) filter with a listener.
* Create a class which associates a stanza filter with a listener.
*
* @param packetListener the stanza(/packet) listener.
* @param packetListener the stanza listener.
* @param packetFilter the associated filter or null if it listen for all packets.
*/
public ListenerWrapper(StanzaListener packetListener, StanzaFilter packetFilter) {
@ -1330,7 +1330,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
}
/**
* A wrapper class to associate a stanza(/packet) filter with an interceptor.
* A wrapper class to associate a stanza filter with an interceptor.
*/
protected static class InterceptorWrapper {
@ -1338,7 +1338,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
private final StanzaFilter packetFilter;
/**
* Create a class which associates a stanza(/packet) filter with an interceptor.
* Create a class which associates a stanza filter with an interceptor.
*
* @param packetInterceptor the interceptor.
* @param packetFilter the associated filter or null if it intercepts all packets.

View file

@ -153,7 +153,7 @@ public final class SmackConfiguration {
}
/**
* Gets the default max size of a stanza(/packet) collector before it will delete
* Gets the default max size of a stanza collector before it will delete
* the older packets.
*
* @return The number of packets to queue before deleting older packets.
@ -163,7 +163,7 @@ public final class SmackConfiguration {
}
/**
* Sets the default max size of a stanza(/packet) collector before it will delete
* Sets the default max size of a stanza collector before it will delete
* the older packets.
*
* @param collectorSize the number of packets to queue before deleting older packets.

View file

@ -57,8 +57,8 @@ public class SmackException extends Exception {
}
/**
* Exception thrown always when there was no response to an request within the stanza(/packet) reply timeout of the used
* connection instance. You can modify (e.g. increase) the stanza(/packet) reply timeout with
* Exception thrown always when there was no response to an request within the stanza reply timeout of the used
* connection instance. You can modify (e.g. increase) the stanza reply timeout with
* {@link XMPPConnection#setReplyTimeout(long)}.
*/
public static final class NoResponseException extends SmackException {

View file

@ -33,7 +33,7 @@ import org.jivesoftware.smack.packet.Stanza;
* use than a {@link StanzaListener} when you need to wait for a specific
* result.<p>
*
* Each stanza(/packet) collector will queue up a configured number of packets for processing before
* Each stanza collector will queue up a configured number of packets for processing before
* older packets are automatically dropped. The default number is retrieved by
* {@link SmackConfiguration#getStanzaCollectorSize()}.
*
@ -47,7 +47,7 @@ public class StanzaCollector {
private final ArrayBlockingQueue<Stanza> resultQueue;
/**
* The stanza(/packet) collector which timeout for the next result will get reset once this collector collects a stanza.
* The stanza collector which timeout for the next result will get reset once this collector collects a stanza.
*/
private final StanzaCollector collectorToReset;
@ -56,7 +56,7 @@ public class StanzaCollector {
private boolean cancelled = false;
/**
* Creates a new stanza(/packet) collector. If the stanza(/packet) filter is <tt>null</tt>, then
* Creates a new stanza collector. If the stanza filter is <tt>null</tt>, then
* all packets will match this collector.
*
* @param connection the connection the collector is tied to.
@ -70,9 +70,9 @@ public class StanzaCollector {
}
/**
* Explicitly cancels the stanza(/packet) collector so that no more results are
* queued up. Once a stanza(/packet) collector has been cancelled, it cannot be
* re-enabled. Instead, a new stanza(/packet) collector must be created.
* Explicitly cancels the stanza collector so that no more results are
* queued up. Once a stanza collector has been cancelled, it cannot be
* re-enabled. Instead, a new stanza collector must be created.
*/
public void cancel() {
// If the packet collector has already been cancelled, do nothing.
@ -83,10 +83,10 @@ public class StanzaCollector {
}
/**
* Returns the stanza(/packet) filter associated with this stanza(/packet) collector. The packet
* Returns the stanza filter associated with this stanza collector. The packet
* filter is used to determine what packets are queued as results.
*
* @return the stanza(/packet) filter.
* @return the stanza filter.
* @deprecated use {@link #getStanzaFilter()} instead.
*/
@Deprecated
@ -105,12 +105,12 @@ public class StanzaCollector {
}
/**
* Polls to see if a stanza(/packet) is currently available and returns it, or
* Polls to see if a stanza is currently available and returns it, or
* immediately returns <tt>null</tt> if no packets are currently in the
* result queue.
*
* @param <P> type of the result stanza.
* @return the next stanza(/packet) result, or <tt>null</tt> if there are no more
* @return the next stanza result, or <tt>null</tt> if there are no more
* results.
*/
@SuppressWarnings("unchecked")
@ -119,7 +119,7 @@ public class StanzaCollector {
}
/**
* Polls to see if a stanza(/packet) is currently available and returns it, or
* Polls to see if a stanza is currently available and returns it, or
* immediately returns <tt>null</tt> if no packets are currently in the
* result queue.
* <p>
@ -139,7 +139,7 @@ public class StanzaCollector {
}
/**
* Returns the next available packet. The method call will block (not return) until a stanza(/packet) is
* Returns the next available packet. The method call will block (not return) until a stanza is
* available.
*
* @param <P> type of the result stanza.
@ -172,7 +172,7 @@ public class StanzaCollector {
/**
* Returns the next available packet. The method call will block (not return)
* until a stanza(/packet) is available or the <tt>timeout</tt> has elapsed. If the
* until a stanza is available or the <tt>timeout</tt> has elapsed. If the
* timeout elapses without a result, <tt>null</tt> will be returned.
*
* @param <P> type of the result stanza.
@ -266,7 +266,7 @@ public class StanzaCollector {
}
/**
* Get the number of collected stanzas this stanza(/packet) collector has collected so far.
* Get the number of collected stanzas this stanza collector has collected so far.
*
* @return the count of collected stanzas.
* @since 4.1
@ -276,10 +276,10 @@ public class StanzaCollector {
}
/**
* Processes a stanza(/packet) to see if it meets the criteria for this stanza(/packet) collector.
* If so, the stanza(/packet) is added to the result queue.
* Processes a stanza to see if it meets the criteria for this stanza collector.
* If so, the stanza is added to the result queue.
*
* @param packet the stanza(/packet) to process.
* @param packet the stanza to process.
*/
protected void processStanza(Stanza packet) {
if (packetFilter == null || packetFilter.accept(packet)) {
@ -302,9 +302,9 @@ public class StanzaCollector {
}
/**
* Get a new stanza(/packet) collector configuration instance.
* Get a new stanza collector configuration instance.
*
* @return a new stanza(/packet) collector configuration.
* @return a new stanza collector configuration.
*/
public static Configuration newConfiguration() {
return new Configuration();
@ -319,7 +319,7 @@ public class StanzaCollector {
}
/**
* Set the stanza(/packet) filter used by this collector. If <code>null</code>, then all packets will
* Set the stanza filter used by this collector. If <code>null</code>, then all packets will
* get collected by this collector.
*
* @param packetFilter

View file

@ -23,7 +23,7 @@ import org.jivesoftware.smack.packet.Stanza;
/**
* Provides a mechanism to listen for packets that pass a specified filter.
* This allows event-style programming -- every time a new stanza(/packet) is found,
* This allows event-style programming -- every time a new stanza is found,
* the {@link #processStanza(Stanza)} method will be called. This is the
* opposite approach to the functionality provided by a {@link StanzaCollector}
* which lets you block while waiting for results.
@ -40,14 +40,14 @@ import org.jivesoftware.smack.packet.Stanza;
public interface StanzaListener {
/**
* Process the next stanza(/packet) sent to this stanza(/packet) listener.
* Process the next stanza sent to this stanza listener.
* <p>
* If this listener is synchronous, then a single thread is responsible for invoking all listeners, so
* it's very important that implementations of this method not block
* for any extended period of time.
* </p>
*
* @param packet the stanza(/packet) to process.
* @param packet the stanza to process.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotLoggedInException

View file

@ -207,27 +207,27 @@ public interface XMPPConnection {
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException;
/**
* Creates a new stanza(/packet) collector collecting packets that are replies to <code>packet</code>.
* Does also send <code>packet</code>. The stanza(/packet) filter for the collector is an
* {@link IQReplyFilter}, guaranteeing that stanza(/packet) id and JID in the 'from' address have
* Creates a new stanza collector collecting packets that are replies to <code>packet</code>.
* Does also send <code>packet</code>. The stanza filter for the collector is an
* {@link IQReplyFilter}, guaranteeing that stanza id and JID in the 'from' address have
* expected values.
*
* @param packet the stanza(/packet) to filter responses from
* @return a new stanza(/packet) collector.
* @param packet the stanza to filter responses from
* @return a new stanza collector.
* @throws NotConnectedException
* @throws InterruptedException
*/
StanzaCollector createStanzaCollectorAndSend(IQ packet) throws NotConnectedException, InterruptedException;
/**
* Creates a new stanza(/packet) collector for this connection. A stanza(/packet) filter determines
* Creates a new stanza collector for this connection. A stanza filter determines
* which packets will be accumulated by the collector. A StanzaCollector is
* more suitable to use than a {@link StanzaListener} when you need to wait for
* a specific result.
*
* @param packetFilter the stanza(/packet) filter to use.
* @param packetFilter the stanza filter to use.
* @param packet the packet to send right after the collector got created
* @return a new stanza(/packet) collector.
* @return a new stanza collector.
* @throws InterruptedException
* @throws NotConnectedException
*/
@ -235,7 +235,7 @@ public interface XMPPConnection {
throws NotConnectedException, InterruptedException;
/**
* Creates a new stanza(/packet) collector for this connection. A stanza(/packet) filter
* Creates a new stanza collector for this connection. A stanza filter
* determines which packets will be accumulated by the collector. A
* StanzaCollector is more suitable to use than a {@link StanzaListener}
* when you need to wait for a specific result.
@ -247,95 +247,95 @@ public interface XMPPConnection {
* if an exception is thrown, or otherwise you may leak the StanzaCollector.
* </p>
*
* @param packetFilter the stanza(/packet) filter to use.
* @return a new stanza(/packet) collector.
* @param packetFilter the stanza filter to use.
* @return a new stanza collector.
*/
StanzaCollector createStanzaCollector(StanzaFilter packetFilter);
/**
* Create a new stanza(/packet) collector with the given stanza(/packet) collector configuration.
* Create a new stanza collector with the given stanza collector configuration.
* <p>
* Please make sure to cancel the collector when it is no longer required. See also
* {@link #createStanzaCollector(StanzaFilter)}.
* </p>
*
* @param configuration the stanza(/packet) collector configuration.
* @return a new stanza(/packet) collector.
* @param configuration the stanza collector configuration.
* @return a new stanza collector.
* @since 4.1
*/
StanzaCollector createStanzaCollector(StanzaCollector.Configuration configuration);
/**
* Remove a stanza(/packet) collector of this connection.
* Remove a stanza collector of this connection.
*
* @param collector a stanza(/packet) collectors which was created for this connection.
* @param collector a stanza collectors which was created for this connection.
*/
void removeStanzaCollector(StanzaCollector collector);
/**
* Registers a <b>synchronous</b> stanza(/packet) listener with this connection. A stanza(/packet) listener will be invoked only when
* an incoming stanza(/packet) is received. A stanza(/packet) filter determines which packets will be delivered to the listener. If
* the same stanza(/packet) listener is added again with a different filter, only the new filter will be used.
* Registers a <b>synchronous</b> stanza listener with this connection. A stanza listener will be invoked only when
* an incoming stanza is received. A stanza filter determines which packets will be delivered to the listener. If
* the same stanza listener is added again with a different filter, only the new filter will be used.
* <p>
* <b>Important:</b> This stanza(/packet) listeners will be called in the same <i>single</i> thread that processes all
* incoming stanzas. Only use this kind of stanza(/packet) filter if it does not perform any XMPP activity that waits for a
* <b>Important:</b> This stanza listeners will be called in the same <i>single</i> thread that processes all
* incoming stanzas. Only use this kind of stanza filter if it does not perform any XMPP activity that waits for a
* response. Consider using {@link #addAsyncStanzaListener(StanzaListener, StanzaFilter)} when possible, i.e. when
* the invocation order doesn't have to be the same as the order of the arriving packets. If the order of the
* arriving packets, consider using a {@link StanzaCollector} when possible.
* </p>
*
* @param packetListener the stanza(/packet) listener to notify of new received packets.
* @param packetFilter the stanza(/packet) filter to use.
* @param packetListener the stanza listener to notify of new received packets.
* @param packetFilter the stanza filter to use.
* @see #addStanzaInterceptor(StanzaListener, StanzaFilter)
* @since 4.1
*/
void addSyncStanzaListener(StanzaListener packetListener, StanzaFilter packetFilter);
/**
* Removes a stanza(/packet) listener for received packets from this connection.
* Removes a stanza listener for received packets from this connection.
*
* @param packetListener the stanza(/packet) listener to remove.
* @return true if the stanza(/packet) listener was removed
* @param packetListener the stanza listener to remove.
* @return true if the stanza listener was removed
* @since 4.1
*/
boolean removeSyncStanzaListener(StanzaListener packetListener);
/**
* Registers an <b>asynchronous</b> stanza(/packet) listener with this connection. A stanza(/packet) listener will be invoked only
* when an incoming stanza(/packet) is received. A stanza(/packet) filter determines which packets will be delivered to the listener.
* If the same stanza(/packet) listener is added again with a different filter, only the new filter will be used.
* Registers an <b>asynchronous</b> stanza listener with this connection. A stanza listener will be invoked only
* when an incoming stanza is received. A stanza filter determines which packets will be delivered to the listener.
* If the same stanza listener is added again with a different filter, only the new filter will be used.
* <p>
* Unlike {@link #addAsyncStanzaListener(StanzaListener, StanzaFilter)} stanza(/packet) listeners added with this method will be
* invoked asynchronously in their own thread. Use this method if the order of the stanza(/packet) listeners must not depend
* Unlike {@link #addAsyncStanzaListener(StanzaListener, StanzaFilter)} stanza listeners added with this method will be
* invoked asynchronously in their own thread. Use this method if the order of the stanza listeners must not depend
* on the order how the stanzas where received.
* </p>
*
* @param packetListener the stanza(/packet) listener to notify of new received packets.
* @param packetFilter the stanza(/packet) filter to use.
* @param packetListener the stanza listener to notify of new received packets.
* @param packetFilter the stanza filter to use.
* @see #addStanzaInterceptor(StanzaListener, StanzaFilter)
* @since 4.1
*/
void addAsyncStanzaListener(StanzaListener packetListener, StanzaFilter packetFilter);
/**
* Removes an <b>asynchronous</b> stanza(/packet) listener for received packets from this connection.
* Removes an <b>asynchronous</b> stanza listener for received packets from this connection.
*
* @param packetListener the stanza(/packet) listener to remove.
* @return true if the stanza(/packet) listener was removed
* @param packetListener the stanza listener to remove.
* @return true if the stanza listener was removed
* @since 4.1
*/
boolean removeAsyncStanzaListener(StanzaListener packetListener);
/**
* Registers a stanza(/packet) listener with this connection. The listener will be
* notified of every stanza(/packet) that this connection sends. A stanza(/packet) filter determines
* Registers a stanza listener with this connection. The listener will be
* notified of every stanza that this connection sends. A stanza filter determines
* which packets will be delivered to the listener. Note that the thread
* that writes packets will be used to invoke the listeners. Therefore, each
* stanza(/packet) listener should complete all operations quickly or use a different
* stanza listener should complete all operations quickly or use a different
* thread for processing.
*
* @param packetListener the stanza(/packet) listener to notify of sent packets.
* @param packetFilter the stanza(/packet) filter to use.
* @param packetListener the stanza listener to notify of sent packets.
* @param packetFilter the stanza filter to use.
* @deprecated use {@link #addStanzaSendingListener} instead
*/
// TODO Remove in Smack 4.4
@ -343,22 +343,22 @@ public interface XMPPConnection {
void addPacketSendingListener(StanzaListener packetListener, StanzaFilter packetFilter);
/**
* Registers a stanza(/packet) listener with this connection. The listener will be
* notified of every stanza(/packet) that this connection sends. A stanza(/packet) filter determines
* Registers a stanza listener with this connection. The listener will be
* notified of every stanza that this connection sends. A stanza filter determines
* which packets will be delivered to the listener. Note that the thread
* that writes packets will be used to invoke the listeners. Therefore, each
* stanza(/packet) listener should complete all operations quickly or use a different
* stanza listener should complete all operations quickly or use a different
* thread for processing.
*
* @param packetListener the stanza(/packet) listener to notify of sent packets.
* @param packetFilter the stanza(/packet) filter to use.
* @param packetListener the stanza listener to notify of sent packets.
* @param packetFilter the stanza filter to use.
*/
void addStanzaSendingListener(StanzaListener packetListener, StanzaFilter packetFilter);
/**
* Removes a stanza(/packet) listener for sending packets from this connection.
* Removes a stanza listener for sending packets from this connection.
*
* @param packetListener the stanza(/packet) listener to remove.
* @param packetListener the stanza listener to remove.
* @deprecated use {@link #removeStanzaSendingListener} instead
*/
// TODO Remove in Smack 4.4
@ -366,24 +366,24 @@ public interface XMPPConnection {
void removePacketSendingListener(StanzaListener packetListener);
/**
* Removes a stanza(/packet) listener for sending packets from this connection.
* Removes a stanza listener for sending packets from this connection.
*
* @param packetListener the stanza(/packet) listener to remove.
* @param packetListener the stanza listener to remove.
*/
void removeStanzaSendingListener(StanzaListener packetListener);
/**
* Registers a stanza(/packet) interceptor with this connection. The interceptor will be
* invoked every time a stanza(/packet) is about to be sent by this connection. Interceptors
* may modify the stanza(/packet) to be sent. A stanza(/packet) filter determines which packets
* Registers a stanza interceptor with this connection. The interceptor will be
* invoked every time a stanza is about to be sent by this connection. Interceptors
* may modify the stanza to be sent. A stanza filter determines which packets
* will be delivered to the interceptor.
*
* <p>
* NOTE: For a similar functionality on incoming packets, see {@link #addAsyncStanzaListener(StanzaListener, StanzaFilter)}.
* </p>
*
* @param packetInterceptor the stanza(/packet) interceptor to notify of packets about to be sent.
* @param packetFilter the stanza(/packet) filter to use.
* @param packetInterceptor the stanza interceptor to notify of packets about to be sent.
* @param packetFilter the stanza filter to use.
* @deprecated use {@link #addStanzaInterceptor} instead
*/
// TODO Remove in Smack 4.4
@ -391,24 +391,24 @@ public interface XMPPConnection {
void addPacketInterceptor(StanzaListener packetInterceptor, StanzaFilter packetFilter);
/**
* Registers a stanza(/packet) interceptor with this connection. The interceptor will be
* invoked every time a stanza(/packet) is about to be sent by this connection. Interceptors
* may modify the stanza(/packet) to be sent. A stanza(/packet) filter determines which packets
* Registers a stanza interceptor with this connection. The interceptor will be
* invoked every time a stanza is about to be sent by this connection. Interceptors
* may modify the stanza to be sent. A stanza filter determines which packets
* will be delivered to the interceptor.
*
* <p>
* NOTE: For a similar functionality on incoming packets, see {@link #addAsyncStanzaListener(StanzaListener, StanzaFilter)}.
* </p>
*
* @param packetInterceptor the stanza(/packet) interceptor to notify of packets about to be sent.
* @param packetFilter the stanza(/packet) filter to use.
* @param packetInterceptor the stanza interceptor to notify of packets about to be sent.
* @param packetFilter the stanza filter to use.
*/
void addStanzaInterceptor(StanzaListener packetInterceptor, StanzaFilter packetFilter);
/**
* Removes a stanza(/packet) interceptor.
* Removes a stanza interceptor.
*
* @param packetInterceptor the stanza(/packet) interceptor to remove.
* @param packetInterceptor the stanza interceptor to remove.
* @deprecated user {@link #removeStanzaInterceptor} instead
*/
// TODO Remove in Smack 4.4
@ -416,9 +416,9 @@ public interface XMPPConnection {
void removePacketInterceptor(StanzaListener packetInterceptor);
/**
* Removes a stanza(/packet) interceptor.
* Removes a stanza interceptor.
*
* @param packetInterceptor the stanza(/packet) interceptor to remove.
* @param packetInterceptor the stanza interceptor to remove.
*/
void removeStanzaInterceptor(StanzaListener packetInterceptor);
@ -431,7 +431,7 @@ public interface XMPPConnection {
long getReplyTimeout();
/**
* Set the stanza(/packet) reply timeout in milliseconds. In most cases, Smack will throw a
* Set the stanza reply timeout in milliseconds. In most cases, Smack will throw a
* {@link NoResponseException} if no reply to a request was received within the timeout period.
*
* @param timeout for a reply in milliseconds
@ -480,13 +480,13 @@ public interface XMPPConnection {
FromMode getFromMode();
/**
* Get the feature stanza(/packet) extensions for a given stream feature of the
* Get the feature stanza extensions for a given stream feature of the
* server, or <code>null</code> if the server doesn't support that feature.
*
* @param <F> {@link ExtensionElement} type of the feature.
* @param element
* @param namespace
* @return a stanza(/packet) extensions of the feature or <code>null</code>
* @return a stanza extensions of the feature or <code>null</code>
*/
<F extends ExtensionElement> F getFeature(String element, String namespace);
@ -659,9 +659,9 @@ public interface XMPPConnection {
/**
* Add a callback that is called exactly once and synchronously with the incoming stanza that matches the given
* stanza(/packet) filter.
* stanza filter.
*
* @param callback the callback invoked once the stanza(/packet) filter matches a stanza.
* @param callback the callback invoked once the stanza filter matches a stanza.
* @param packetFilter the filter to match stanzas or null to match all.
*/
void addOneTimeSyncCallback(StanzaListener callback, StanzaFilter packetFilter);

View file

@ -20,7 +20,7 @@ package org.jivesoftware.smack.filter;
import org.jivesoftware.smack.packet.Stanza;
/**
* Implements the logical AND operation over two or more stanza(/packet) filters.
* Implements the logical AND operation over two or more stanza filters.
* In other words, packets pass this filter if they pass <b>all</b> of the filters.
*
* @author Matt Tucker

View file

@ -24,7 +24,7 @@ import org.jxmpp.jid.Jid;
* Filter for packets where the "from" field exactly matches a specified JID. If the specified
* address is a bare JID then the filter will match any address whose bare JID matches the
* specified JID. But if the specified address is a full JID then the filter will only match
* if the sender of the stanza(/packet) matches the specified resource.
* if the sender of the stanza matches the specified resource.
*
* @author Gaston Dombiak
*/
@ -37,7 +37,7 @@ public final class FromMatchesFilter extends AbstractFromToMatchesFilter {
* filter address. The second parameter specifies whether the full or the bare addresses are
* compared.
*
* @param address The address to filter for. If <code>null</code> is given, the stanza(/packet) must not
* @param address The address to filter for. If <code>null</code> is given, the stanza must not
* have a from address.
* @param ignoreResourcepart
*/

View file

@ -30,7 +30,7 @@ import org.jxmpp.jid.Jid;
/**
* Filters for packets which are a valid reply to an IQ request.
* <p>
* Such a stanza(/packet) must have the same stanza(/packet) id and must be an IQ stanza(/packet) of type
* Such a stanza must have the same stanza id and must be an IQ stanza of type
* <code>RESULT</code> or <code>ERROR</code>. Moreover, it is necessary to check
* the <code>from</code> address to ignore forged replies.
* <p>
@ -63,7 +63,7 @@ public class IQReplyFilter implements StanzaFilter {
/**
* Filters for packets which are a valid reply to an IQ request.
* <p>
* Such a stanza(/packet) must have the same stanza(/packet) id and must be an IQ stanza(/packet) of type
* Such a stanza must have the same stanza id and must be an IQ stanza of type
* <code>RESULT</code> or <code>ERROR</code>. Moreover, it is necessary to check
* the <code>from</code> address to ignore forged replies.
* <p>

View file

@ -21,7 +21,7 @@ import org.jivesoftware.smack.packet.IQ.Type;
import org.jivesoftware.smack.util.Objects;
/**
* A filter for IQ stanza(/packet) types. Returns true only if the stanza(/packet) is an IQ packet
* A filter for IQ stanza types. Returns true only if the stanza is an IQ packet
* and it matches the type provided in the constructor.
*
* @author Alexander Wenckus

View file

@ -21,7 +21,7 @@ import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.util.Objects;
/**
* Implements the logical NOT operation on a stanza(/packet) filter. In other words, packets
* Implements the logical NOT operation on a stanza filter. In other words, packets
* pass this filter if they do not pass the supplied filter.
*
* @author Matt Tucker

View file

@ -20,7 +20,7 @@ package org.jivesoftware.smack.filter;
import org.jivesoftware.smack.packet.Stanza;
/**
* Implements the logical OR operation over two or more stanza(/packet) filters. In
* Implements the logical OR operation over two or more stanza filters. In
* other words, packets pass this filter if they pass <b>any</b> of the filters.
*
* @author Matt Tucker

View file

@ -22,7 +22,7 @@ import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.util.StringUtils;
/**
* Filters for packets with a particular type of stanza(/packet) extension.
* Filters for packets with a particular type of stanza extension.
*
* @author Matt Tucker
* @deprecated use {@link StanzaExtensionFilter} instead.
@ -34,12 +34,12 @@ public class PacketExtensionFilter implements StanzaFilter {
private final String namespace;
/**
* Creates a new stanza(/packet) extension filter. Packets will pass the filter if
* they have a stanza(/packet) extension that matches the specified element name
* Creates a new stanza extension filter. Packets will pass the filter if
* they have a stanza extension that matches the specified element name
* and namespace.
*
* @param elementName the XML element name of the stanza(/packet) extension.
* @param namespace the XML namespace of the stanza(/packet) extension.
* @param elementName the XML element name of the stanza extension.
* @param namespace the XML namespace of the stanza extension.
*/
public PacketExtensionFilter(String elementName, String namespace) {
StringUtils.requireNotNullOrEmpty(namespace, "namespace must not be null or empty");
@ -49,17 +49,17 @@ public class PacketExtensionFilter implements StanzaFilter {
}
/**
* Creates a new stanza(/packet) extension filter. Packets will pass the filter if they have a packet
* Creates a new stanza extension filter. Packets will pass the filter if they have a packet
* extension that matches the specified namespace.
*
* @param namespace the XML namespace of the stanza(/packet) extension.
* @param namespace the XML namespace of the stanza extension.
*/
public PacketExtensionFilter(String namespace) {
this(null, namespace);
}
/**
* Creates a new stanza(/packet) extension filter for the given stanza(/packet) extension.
* Creates a new stanza extension filter for the given stanza extension.
*
* @param packetExtension
*/

View file

@ -19,24 +19,24 @@ package org.jivesoftware.smack.filter;
/**
* Defines a way to filter packets for particular attributes. Stanza(/Packet) filters are used when
* constructing stanza(/packet) listeners or collectors -- the filter defines what packets match the criteria
* of the collector or listener for further stanza(/packet) processing.
* constructing stanza listeners or collectors -- the filter defines what packets match the criteria
* of the collector or listener for further stanza processing.
* <p>
* Several simple filters are pre-defined. These filters can be logically combined for more complex
* stanza(/packet) filtering by using the {@link org.jivesoftware.smack.filter.AndFilter AndFilter} and
* stanza filtering by using the {@link org.jivesoftware.smack.filter.AndFilter AndFilter} and
* {@link org.jivesoftware.smack.filter.OrFilter OrFilter} filters. It's also possible to define
* your own filters by implementing this interface. The code example below creates a trivial filter
* for packets with a specific ID (real code should use {@link StanzaIdFilter} instead).
*
* <pre>
* // Use an anonymous inner class to define a stanza(/packet) filter that returns
* // all packets that have a stanza(/packet) ID of &quot;RS145&quot;.
* // Use an anonymous inner class to define a stanza filter that returns
* // all packets that have a stanza ID of &quot;RS145&quot;.
* PacketFilter myFilter = new PacketFilter() {
* public boolean accept(Packet packet) {
* return &quot;RS145&quot;.equals(packet.getStanzaId());
* }
* };
* // Create a new stanza(/packet) collector using the filter we created.
* // Create a new stanza collector using the filter we created.
* StanzaCollector myCollector = packetReader.createStanzaCollector(myFilter);
* </pre>
*

View file

@ -21,7 +21,7 @@ import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.util.StringUtils;
/**
* Filters for packets with a particular stanza(/packet) ID.
* Filters for packets with a particular stanza ID.
*
* @author Matt Tucker
* @deprecated use {@link StanzaIdFilter} instead.
@ -32,9 +32,9 @@ public class PacketIDFilter implements StanzaFilter {
private final String packetID;
/**
* Creates a new stanza(/packet) ID filter using the specified packet's ID.
* Creates a new stanza ID filter using the specified packet's ID.
*
* @param packet the stanza(/packet) which the ID is taken from.
* @param packet the stanza which the ID is taken from.
* @deprecated use {@link StanzaIdFilter#StanzaIdFilter(Stanza)} instead.
*/
@Deprecated
@ -43,9 +43,9 @@ public class PacketIDFilter implements StanzaFilter {
}
/**
* Creates a new stanza(/packet) ID filter using the specified stanza(/packet) ID.
* Creates a new stanza ID filter using the specified stanza ID.
*
* @param packetID the stanza(/packet) ID to filter for.
* @param packetID the stanza ID to filter for.
* @deprecated use {@link StanzaIdFilter#StanzaIdFilter(Stanza)} instead.
*/
@Deprecated

View file

@ -42,7 +42,7 @@ public class PacketTypeFilter implements StanzaFilter {
private final Class<? extends Stanza> packetType;
/**
* Creates a new stanza(/packet) type filter that will filter for packets that are the
* Creates a new stanza type filter that will filter for packets that are the
* same type as <tt>packetType</tt>.
*
* @param packetType the Class type.

View file

@ -21,7 +21,7 @@ import org.jivesoftware.smack.packet.Presence.Type;
import org.jivesoftware.smack.util.Objects;
/**
* A filter for Presence types. Returns true only if the stanza is an Presence stanza(/packet) and it matches the type provided in the
* A filter for Presence types. Returns true only if the stanza is an Presence stanza and it matches the type provided in the
* constructor.
*/
public final class PresenceTypeFilter extends FlexibleStanzaTypeFilter<Presence> {

View file

@ -51,7 +51,7 @@ public interface StanzaFilter {
/**
* Tests whether or not the specified stanza should pass the filter.
*
* @param stanza the stanza(/packet) to test.
* @param stanza the stanza to test.
* @return true if and only if <tt>stanza</tt> passes the filter.
*/
boolean accept(Stanza stanza);

View file

@ -42,7 +42,7 @@ public final class StanzaTypeFilter implements StanzaFilter {
private final Class<? extends Stanza> packetType;
/**
* Creates a new stanza(/packet) type filter that will filter for packets that are the
* Creates a new stanza type filter that will filter for packets that are the
* same type as <tt>packetType</tt>.
*
* @param packetType the Class type.

View file

@ -91,11 +91,11 @@ public class AbstractError {
}
/**
* Returns the first stanza(/packet) extension that matches the specified element name and
* Returns the first stanza extension that matches the specified element name and
* namespace, or <tt>null</tt> if it doesn't exist.
*
* @param elementName the XML element name of the stanza(/packet) extension.
* @param namespace the XML element namespace of the stanza(/packet) extension.
* @param elementName the XML element name of the stanza extension.
* @param namespace the XML element namespace of the stanza extension.
* @param <PE> type of the ExtensionElement.
* @return the extension, or <tt>null</tt> if it doesn't exist.
*/

View file

@ -21,8 +21,8 @@ import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.parts.Resourcepart;
/**
* IQ stanza(/packet) used by Smack to bind a resource and to obtain the jid assigned by the server.
* There are two ways to bind a resource. One is simply sending an empty Bind stanza(/packet) where the
* IQ stanza used by Smack to bind a resource and to obtain the jid assigned by the server.
* There are two ways to bind a resource. One is simply sending an empty Bind stanza where the
* server will assign a new resource for this connection. The other option is to set a desired
* resource but the server may return a modified version of the sent resource.<p>
*

View file

@ -27,7 +27,7 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
/**
* Default implementation of the ExtensionElement interface. Unless a ExtensionElementProvider
* is registered with {@link org.jivesoftware.smack.provider.ProviderManager ProviderManager},
* instances of this class will be returned when getting stanza(/packet) extensions.<p>
* instances of this class will be returned when getting stanza extensions.<p>
*
* This class provides a very simple representation of an XML sub-document. Each element
* is a key in a Map with its CDATA being the value. For example, given the following
@ -55,7 +55,7 @@ public class DefaultExtensionElement implements ExtensionElement {
private Map<String,String> map;
/**
* Creates a new generic stanza(/packet) extension.
* Creates a new generic stanza extension.
*
* @param elementName the name of the element of the XML sub-document.
* @param namespace the namespace of the element.
@ -68,7 +68,7 @@ public class DefaultExtensionElement implements ExtensionElement {
/**
* Returns the XML element name of the extension sub-packet root element.
*
* @return the XML element name of the stanza(/packet) extension.
* @return the XML element name of the stanza extension.
*/
@Override
public String getElementName() {
@ -78,7 +78,7 @@ public class DefaultExtensionElement implements ExtensionElement {
/**
* Returns the XML namespace of the extension sub-packet root element.
*
* @return the XML namespace of the stanza(/packet) extension.
* @return the XML namespace of the stanza extension.
*/
@Override
public String getNamespace() {
@ -99,7 +99,7 @@ public class DefaultExtensionElement implements ExtensionElement {
/**
* Returns an unmodifiable collection of the names that can be used to get
* values of the stanza(/packet) extension.
* values of the stanza extension.
*
* @return the names.
*/
@ -111,7 +111,7 @@ public class DefaultExtensionElement implements ExtensionElement {
}
/**
* Returns a stanza(/packet) extension value given a name.
* Returns a stanza extension value given a name.
*
* @param name the name.
* @return the value.
@ -124,7 +124,7 @@ public class DefaultExtensionElement implements ExtensionElement {
}
/**
* Sets a stanza(/packet) extension value using the given name.
* Sets a stanza extension value using the given name.
*
* @param name the name.
* @param value the value.

View file

@ -19,14 +19,14 @@ package org.jivesoftware.smack.packet;
/**
* Interface to represent a XML element. This is similar to {@link ExtensionElement}, but does not
* carry a namespace and is usually included as child element of an stanza(/packet) extension.
* carry a namespace and is usually included as child element of an stanza extension.
*/
public interface Element {
/**
* Returns the XML representation of this Element.
*
* @return the stanza(/packet) extension as XML.
* @return the stanza extension as XML.
*/
CharSequence toXML();
}

View file

@ -25,12 +25,12 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
/**
* The base IQ (Info/Query) packet. IQ packets are used to get and set information
* on the server, including authentication, roster operations, and creating
* accounts. Each IQ stanza(/packet) has a specific type that indicates what type of action
* accounts. Each IQ stanza has a specific type that indicates what type of action
* is being taken: "get", "set", "result", or "error".<p>
*
* IQ packets can contain a single child element that exists in a specific XML
* namespace. The combination of the element name and namespace determines what
* type of IQ stanza(/packet) it is. Some example IQ subpacket snippets:<ul>
* type of IQ stanza it is. Some example IQ subpacket snippets:<ul>
*
* <li>&lt;query xmlns="jabber:iq:auth"&gt; -- an authentication IQ.
* <li>&lt;query xmlns="jabber:iq:private"&gt; -- a private storage IQ.
@ -237,7 +237,7 @@ public abstract class IQ extends Stanza {
/**
* Convenience method to create a new empty {@link Type#result IQ.Type.result}
* IQ based on a {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set}
* IQ. The new stanza(/packet) will be initialized with:<ul>
* IQ. The new stanza will be initialized with:<ul>
* <li>The sender set to the recipient of the originating IQ.
* <li>The recipient set to the sender of the originating IQ.
* <li>The type set to {@link Type#result IQ.Type.result}.
@ -246,7 +246,7 @@ public abstract class IQ extends Stanza {
* </ul>
*
* @param request the {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set} IQ packet.
* @throws IllegalArgumentException if the IQ stanza(/packet) does not have a type of
* @throws IllegalArgumentException if the IQ stanza does not have a type of
* {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set}.
* @return a new {@link Type#result IQ.Type.result} IQ based on the originating IQ.
*/
@ -257,7 +257,7 @@ public abstract class IQ extends Stanza {
/**
* Convenience method to create a new {@link Type#error IQ.Type.error} IQ
* based on a {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set}
* IQ. The new stanza(/packet) will be initialized with:<ul>
* IQ. The new stanza will be initialized with:<ul>
* <li>The sender set to the recipient of the originating IQ.
* <li>The recipient set to the sender of the originating IQ.
* <li>The type set to {@link Type#error IQ.Type.error}.
@ -268,7 +268,7 @@ public abstract class IQ extends Stanza {
*
* @param request the {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set} IQ packet.
* @param error the error to associate with the created IQ packet.
* @throws IllegalArgumentException if the IQ stanza(/packet) does not have a type of
* @throws IllegalArgumentException if the IQ stanza does not have a type of
* {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set}.
* @return a new {@link Type#error IQ.Type.error} IQ based on the originating IQ.
*/
@ -294,7 +294,7 @@ public abstract class IQ extends Stanza {
/**
* Convenience method to create a new {@link Type#error IQ.Type.error} IQ
* based on a {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set}
* IQ. The new stanza(/packet) will be initialized with:<ul>
* IQ. The new stanza will be initialized with:<ul>
* <li>The sender set to the recipient of the originating IQ.
* <li>The recipient set to the sender of the originating IQ.
* <li>The type set to {@link Type#error IQ.Type.error}.
@ -305,7 +305,7 @@ public abstract class IQ extends Stanza {
*
* @param request the {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set} IQ packet.
* @param error the error to associate with the created IQ packet.
* @throws IllegalArgumentException if the IQ stanza(/packet) does not have a type of
* @throws IllegalArgumentException if the IQ stanza does not have a type of
* {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set}.
* @return a new {@link Type#error IQ.Type.error} IQ based on the originating IQ.
*/

View file

@ -19,7 +19,7 @@ package org.jivesoftware.smack.packet;
/**
* Interface to represent a XML element. This is similar to {@link ExtensionElement}, but does not
* carry a namespace and is usually included as child element of an stanza(/packet) extension.
* carry a namespace and is usually included as child element of an stanza extension.
*/
public interface NamedElement extends Element {

View file

@ -47,7 +47,7 @@ public interface Packet extends TopLevelStreamElement {
String getPacketID();
/**
* Sets the unique ID of the packet. To indicate that a stanza(/packet) has no id
* Sets the unique ID of the packet. To indicate that a stanza has no id
* pass <code>null</code> as the packet's id value.
*
* @param id the unique ID for the packet.
@ -63,39 +63,39 @@ public interface Packet extends TopLevelStreamElement {
void setPacketID(String packetID);
/**
* Returns who the stanza(/packet) is being sent "to", or <tt>null</tt> if
* Returns who the stanza is being sent "to", or <tt>null</tt> if
* the value is not set. The XMPP protocol often makes the "to"
* attribute optional, so it does not always need to be set.<p>
*
* @return who the stanza(/packet) is being sent to, or <tt>null</tt> if the
* @return who the stanza is being sent to, or <tt>null</tt> if the
* value has not been set.
*/
String getTo();
/**
* Sets who the stanza(/packet) is being sent "to". The XMPP protocol often makes
* Sets who the stanza is being sent "to". The XMPP protocol often makes
* the "to" attribute optional, so it does not always need to be set.
*
* @param to who the stanza(/packet) is being sent to.
* @param to who the stanza is being sent to.
*/
void setTo(String to);
/**
* Returns who the stanza(/packet) is being sent "from" or <tt>null</tt> if
* Returns who the stanza is being sent "from" or <tt>null</tt> if
* the value is not set. The XMPP protocol often makes the "from"
* attribute optional, so it does not always need to be set.<p>
*
* @return who the stanza(/packet) is being sent from, or <tt>null</tt> if the
* @return who the stanza is being sent from, or <tt>null</tt> if the
* value has not been set.
*/
String getFrom();
/**
* Sets who the stanza(/packet) is being sent "from". The XMPP protocol often
* Sets who the stanza is being sent "from". The XMPP protocol often
* makes the "from" attribute optional, so it does not always need to
* be set.
*
* @param from who the stanza(/packet) is being sent to.
* @param from who the stanza is being sent to.
*/
void setFrom(String from);
@ -128,16 +128,16 @@ public interface Packet extends TopLevelStreamElement {
void setLanguage(String language);
/**
* Returns a copy of the stanza(/packet) extensions attached to the packet.
* Returns a copy of the stanza extensions attached to the packet.
*
* @return the stanza(/packet) extensions.
* @return the stanza extensions.
*/
List<ExtensionElement> getExtensions();
/**
* Return a set of all extensions with the given element name <i>and</i> namespace.
* <p>
* Changes to the returned set will update the stanza(/packet) extensions, if the returned set is not the empty set.
* Changes to the returned set will update the stanza extensions, if the returned set is not the empty set.
* </p>
*
* @param elementName the element name, must not be null.
@ -148,18 +148,18 @@ public interface Packet extends TopLevelStreamElement {
Set<ExtensionElement> getExtensions(String elementName, String namespace);
/**
* Returns the first extension of this stanza(/packet) that has the given namespace.
* Returns the first extension of this stanza that has the given namespace.
* <p>
* When possible, use {@link #getExtension(String,String)} instead.
* </p>
*
* @param namespace the namespace of the extension that is desired.
* @return the stanza(/packet) extension with the given namespace.
* @return the stanza extension with the given namespace.
*/
ExtensionElement getExtension(String namespace);
/**
* Returns the first stanza(/packet) extension that matches the specified element name and
* Returns the first stanza extension that matches the specified element name and
* namespace, or <tt>null</tt> if it doesn't exist. If the provided elementName is null,
* only the namespace is matched. Stanza(/Packet) extensions are
* are arbitrary XML sub-documents in standard XMPP packets. By default, a
@ -169,60 +169,60 @@ public interface Packet extends TopLevelStreamElement {
* class to handle custom parsing. In that case, the type of the Object
* will be determined by the provider.
*
* @param elementName the XML element name of the stanza(/packet) extension. (May be null)
* @param namespace the XML element namespace of the stanza(/packet) extension.
* @param elementName the XML element name of the stanza extension. (May be null)
* @param namespace the XML element namespace of the stanza extension.
* @param <PE> type of the ExtensionElement.
* @return the extension, or <tt>null</tt> if it doesn't exist.
*/
<PE extends ExtensionElement> PE getExtension(String elementName, String namespace);
/**
* Adds a stanza(/packet) extension to the packet. Does nothing if extension is null.
* Adds a stanza extension to the packet. Does nothing if extension is null.
*
* @param extension a stanza(/packet) extension.
* @param extension a stanza extension.
*/
void addExtension(ExtensionElement extension);
/**
* Adds a collection of stanza(/packet) extensions to the packet. Does nothing if extensions is null.
* Adds a collection of stanza extensions to the packet. Does nothing if extensions is null.
*
* @param extensions a collection of stanza(/packet) extensions
* @param extensions a collection of stanza extensions
*/
void addExtensions(Collection<ExtensionElement> extensions);
/**
* Check if a stanza(/packet) extension with the given element and namespace exists.
* Check if a stanza extension with the given element and namespace exists.
* <p>
* The argument <code>elementName</code> may be null.
* </p>
*
* @param elementName
* @param namespace
* @return true if a stanza(/packet) extension exists, false otherwise.
* @return true if a stanza extension exists, false otherwise.
*/
boolean hasExtension(String elementName, String namespace);
/**
* Check if a stanza(/packet) extension with the given namespace exists.
* Check if a stanza extension with the given namespace exists.
*
* @param namespace
* @return true if a stanza(/packet) extension exists, false otherwise.
* @return true if a stanza extension exists, false otherwise.
*/
boolean hasExtension(String namespace);
/**
* Remove the stanza(/packet) extension with the given elementName and namespace.
* Remove the stanza extension with the given elementName and namespace.
*
* @param elementName
* @param namespace
* @return the removed stanza(/packet) extension or null.
* @return the removed stanza extension or null.
*/
ExtensionElement removeExtension(String elementName, String namespace);
/**
* Removes a stanza(/packet) extension from the packet.
* Removes a stanza extension from the packet.
*
* @param extension the stanza(/packet) extension to remove.
* @return the removed stanza(/packet) extension or null.
* @param extension the stanza extension to remove.
* @return the removed stanza extension or null.
*/
ExtensionElement removeExtension(ExtensionElement extension);

View file

@ -28,7 +28,7 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
import org.jxmpp.jid.Jid;
/**
* Represents XMPP presence packets. Every presence stanza(/packet) has a type, which is one of
* Represents XMPP presence packets. Every presence stanza has a type, which is one of
* the following values:
* <ul>
* <li>{@link Presence.Type#available available} -- (Default) indicates the user is available to
@ -40,7 +40,7 @@ import org.jxmpp.jid.Jid;
* sender's presence.
* <li>{@link Presence.Type#unsubscribed unsubscribed} -- grant removal of subscription to
* sender's presence.
* <li>{@link Presence.Type#error error} -- the presence stanza(/packet) contains an error message.
* <li>{@link Presence.Type#error error} -- the presence stanza contains an error message.
* </ul><p>
*
* A number of attributes are optional:
@ -363,7 +363,7 @@ public final class Presence extends Stanza implements TypedCloneable<Presence> {
unsubscribed,
/**
* The presence stanza(/packet) contains an error message.
* The presence stanza contains an error message.
*/
error,

View file

@ -20,7 +20,7 @@ package org.jivesoftware.smack.packet;
import org.jivesoftware.smack.util.XmlStringBuilder;
/**
* IQ stanza(/packet) that will be sent to the server to establish a session.<p>
* IQ stanza that will be sent to the server to establish a session.<p>
*
* If a server supports sessions, it MUST include a <i>session</i> element in the
* stream features it advertises to a client after the completion of stream authentication.

View file

@ -115,7 +115,7 @@ public abstract class Stanza implements TopLevelStreamElement {
}
/**
* Sets the unique ID of the packet. To indicate that a stanza(/packet) has no id
* Sets the unique ID of the packet. To indicate that a stanza has no id
* pass <code>null</code> as the packet's id value.
*
* @param id the unique ID for the packet.
@ -163,11 +163,11 @@ public abstract class Stanza implements TopLevelStreamElement {
}
/**
* Returns who the stanza(/packet) is being sent "to", or <tt>null</tt> if
* Returns who the stanza is being sent "to", or <tt>null</tt> if
* the value is not set. The XMPP protocol often makes the "to"
* attribute optional, so it does not always need to be set.<p>
*
* @return who the stanza(/packet) is being sent to, or <tt>null</tt> if the
* @return who the stanza is being sent to, or <tt>null</tt> if the
* value has not been set.
*/
public Jid getTo() {
@ -175,10 +175,10 @@ public abstract class Stanza implements TopLevelStreamElement {
}
/**
* Sets who the stanza(/packet) is being sent "to". The XMPP protocol often makes
* Sets who the stanza is being sent "to". The XMPP protocol often makes
* the "to" attribute optional, so it does not always need to be set.
*
* @param to who the stanza(/packet) is being sent to.
* @param to who the stanza is being sent to.
* @throws IllegalArgumentException if to is not a valid JID String.
* @deprecated use {@link #setTo(Jid)} instead.
*/
@ -205,11 +205,11 @@ public abstract class Stanza implements TopLevelStreamElement {
}
/**
* Returns who the stanza(/packet) is being sent "from" or <tt>null</tt> if
* Returns who the stanza is being sent "from" or <tt>null</tt> if
* the value is not set. The XMPP protocol often makes the "from"
* attribute optional, so it does not always need to be set.<p>
*
* @return who the stanza(/packet) is being sent from, or <tt>null</tt> if the
* @return who the stanza is being sent from, or <tt>null</tt> if the
* value has not been set.
*/
public Jid getFrom() {
@ -217,11 +217,11 @@ public abstract class Stanza implements TopLevelStreamElement {
}
/**
* Sets who the stanza(/packet) is being sent "from". The XMPP protocol often
* Sets who the stanza is being sent "from". The XMPP protocol often
* makes the "from" attribute optional, so it does not always need to
* be set.
*
* @param from who the stanza(/packet) is being sent to.
* @param from who the stanza is being sent to.
* @throws IllegalArgumentException if from is not a valid JID String.
* @deprecated use {@link #setFrom(Jid)} instead.
*/
@ -315,7 +315,7 @@ public abstract class Stanza implements TopLevelStreamElement {
/**
* Return a list of all extensions with the given element name <em>and</em> namespace.
* <p>
* Changes to the returned set will update the stanza(/packet) extensions, if the returned set is not the empty set.
* Changes to the returned set will update the stanza extensions, if the returned set is not the empty set.
* </p>
*
* @param elementName the element name, must not be null.
@ -331,13 +331,13 @@ public abstract class Stanza implements TopLevelStreamElement {
}
/**
* Returns the first extension of this stanza(/packet) that has the given namespace.
* Returns the first extension of this stanza that has the given namespace.
* <p>
* When possible, use {@link #getExtension(String,String)} instead.
* </p>
*
* @param namespace the namespace of the extension that is desired.
* @return the stanza(/packet) extension with the given namespace.
* @return the stanza extension with the given namespace.
*/
public ExtensionElement getExtension(String namespace) {
return PacketUtil.extensionElementFrom(getExtensions(), null, namespace);
@ -371,9 +371,9 @@ public abstract class Stanza implements TopLevelStreamElement {
}
/**
* Adds a stanza(/packet) extension to the packet. Does nothing if extension is null.
* Adds a stanza extension to the packet. Does nothing if extension is null.
*
* @param extension a stanza(/packet) extension.
* @param extension a stanza extension.
*/
public void addExtension(ExtensionElement extension) {
if (extension == null) return;
@ -401,9 +401,9 @@ public abstract class Stanza implements TopLevelStreamElement {
}
/**
* Adds a collection of stanza(/packet) extensions to the packet. Does nothing if extensions is null.
* Adds a collection of stanza extensions to the packet. Does nothing if extensions is null.
*
* @param extensions a collection of stanza(/packet) extensions
* @param extensions a collection of stanza extensions
*/
public void addExtensions(Collection<ExtensionElement> extensions) {
if (extensions == null) return;
@ -413,14 +413,14 @@ public abstract class Stanza implements TopLevelStreamElement {
}
/**
* Check if a stanza(/packet) extension with the given element and namespace exists.
* Check if a stanza extension with the given element and namespace exists.
* <p>
* The argument <code>elementName</code> may be null.
* </p>
*
* @param elementName
* @param namespace
* @return true if a stanza(/packet) extension exists, false otherwise.
* @return true if a stanza extension exists, false otherwise.
*/
public boolean hasExtension(String elementName, String namespace) {
if (elementName == null) {
@ -433,10 +433,10 @@ public abstract class Stanza implements TopLevelStreamElement {
}
/**
* Check if a stanza(/packet) extension with the given namespace exists.
* Check if a stanza extension with the given namespace exists.
*
* @param namespace
* @return true if a stanza(/packet) extension exists, false otherwise.
* @return true if a stanza extension exists, false otherwise.
*/
public boolean hasExtension(String namespace) {
synchronized (packetExtensions) {
@ -450,11 +450,11 @@ public abstract class Stanza implements TopLevelStreamElement {
}
/**
* Remove the stanza(/packet) extension with the given elementName and namespace.
* Remove the stanza extension with the given elementName and namespace.
*
* @param elementName
* @param namespace
* @return the removed stanza(/packet) extension or null.
* @return the removed stanza extension or null.
*/
public ExtensionElement removeExtension(String elementName, String namespace) {
String key = XmppStringUtils.generateKey(elementName, namespace);
@ -464,10 +464,10 @@ public abstract class Stanza implements TopLevelStreamElement {
}
/**
* Removes a stanza(/packet) extension from the packet.
* Removes a stanza extension from the packet.
*
* @param extension the stanza(/packet) extension to remove.
* @return the removed stanza(/packet) extension or null.
* @param extension the stanza extension to remove.
* @return the removed stanza extension or null.
*/
public ExtensionElement removeExtension(ExtensionElement extension) {
return removeExtension(extension.getElementName(), extension.getNamespace());
@ -481,10 +481,10 @@ public abstract class Stanza implements TopLevelStreamElement {
/**
* Returns the extension sub-packets (including properties data) as an XML
* String, or the Empty String if there are no stanza(/packet) extensions.
* String, or the Empty String if there are no stanza extensions.
*
* @return the extension sub-packets as XML or the Empty String if there
* are no stanza(/packet) extensions.
* are no stanza extensions.
*/
protected final XmlStringBuilder getExtensionsXML() {
XmlStringBuilder xml = new XmlStringBuilder();
@ -529,7 +529,7 @@ public abstract class Stanza implements TopLevelStreamElement {
}
/**
* Append an XMPPError is this stanza(/packet) has one set.
* Append an XMPPError is this stanza has one set.
*
* @param xml the XmlStringBuilder to append the error to.
*/

View file

@ -28,7 +28,7 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
/**
* Represents an XMPP error sub-packet. Typically, a server responds to a request that has
* problems by sending the stanza(/packet) back and including an error packet. Each error has a type,
* problems by sending the stanza back and including an error packet. Each error has a type,
* error condition as well as as an optional text explanation. Typical errors are:<p>
*
* <table border=1>
@ -113,7 +113,7 @@ public class XMPPError extends AbstractError {
* @param conditionText
* @param errorGenerator
* @param descriptiveTexts
* @param extensions list of stanza(/packet) extensions
* @param extensions list of stanza extensions
* @param stanza the stanza carrying this XMPP error.
*/
public XMPPError(Condition condition, String conditionText, String errorGenerator, Type type, Map<String, String> descriptiveTexts,

View file

@ -19,7 +19,7 @@ package org.jivesoftware.smack.provider;
import org.jivesoftware.smack.packet.ExtensionElement;
/**
* Defines the information required to register a stanza(/packet) extension Provider with the {@link ProviderManager} when using the
* Defines the information required to register a stanza extension Provider with the {@link ProviderManager} when using the
* {@link ProviderLoader}.
*
* @author Robin Collier

View file

@ -65,7 +65,7 @@ import org.jxmpp.util.XmppStringUtils;
* interface, or extend the IQ class. In the former case, each IQProvider is responsible for
* parsing the raw XML stream to create an IQ instance. In the latter case, bean introspection
* is used to try to automatically set properties of the IQ instance using the values found
* in the IQ stanza(/packet) XML. For example, an XMPP time stanza(/packet) resembles the following:
* in the IQ stanza XML. For example, an XMPP time stanza resembles the following:
* <pre>
* &lt;iq type='result' to='joe@example.com' from='mary@example.com' id='time_1'&gt;
* &lt;query xmlns='jabber:iq:time'&gt;
@ -75,13 +75,13 @@ import org.jxmpp.util.XmppStringUtils;
* &lt;/query&gt;
* &lt;/iq&gt;</pre>
*
* In order for this stanza(/packet) to be automatically mapped to the Time object listed in the
* In order for this stanza to be automatically mapped to the Time object listed in the
* providers file above, it must have the methods setUtc(String), setTz(String), and
* setDisplay(String). The introspection service will automatically try to convert the String
* value from the XML into a boolean, int, long, float, double, or Class depending on the
* type the IQ instance expects.<p>
*
* A pluggable system for stanza(/packet) extensions, child elements in a custom namespace for
* A pluggable system for stanza extensions, child elements in a custom namespace for
* message and presence packets, also exists. Each extension provider
* is registered with a name space in the smack.providers file as in the following example:
*
@ -96,12 +96,12 @@ import org.jxmpp.util.XmppStringUtils;
* &lt;/smackProviders&gt;</pre>
*
* If multiple provider entries attempt to register to handle the same element name and namespace,
* the first entry loaded from the classpath will take precedence. Whenever a stanza(/packet) extension
* the first entry loaded from the classpath will take precedence. Whenever a stanza extension
* is found in a packet, parsing will be passed to the correct provider. Each provider
* can either implement the PacketExtensionProvider interface or be a standard Java Bean. In
* the former case, each extension provider is responsible for parsing the raw XML stream to
* construct an object. In the latter case, bean introspection is used to try to automatically
* set the properties of th class using the values in the stanza(/packet) extension sub-element. When an
* set the properties of th class using the values in the stanza extension sub-element. When an
* extension provider is not registered for an element name and namespace combination, Smack will
* store all top-level elements of the sub-packet in DefaultPacketExtension object and then
* attach it to the packet.<p>
@ -147,7 +147,7 @@ public final class ProviderManager {
/**
* Returns the IQ provider registered to the specified XML element name and namespace.
* For example, if a provider was registered to the element name "query" and the
* namespace "jabber:iq:time", then the following stanza(/packet) would trigger the provider:
* namespace "jabber:iq:time", then the following stanza would trigger the provider:
*
* <pre>
* &lt;iq type='result' to='joe@example.com' from='mary@example.com' id='time_1'&gt;
@ -221,9 +221,9 @@ public final class ProviderManager {
}
/**
* Returns the stanza(/packet) extension provider registered to the specified XML element name
* Returns the stanza extension provider registered to the specified XML element name
* and namespace. For example, if a provider was registered to the element name "x" and the
* namespace "jabber:x:event", then the following stanza(/packet) would trigger the provider:
* namespace "jabber:x:event", then the following stanza would trigger the provider:
*
* <pre>
* &lt;message to='romeo@montague.net' id='message_1'&gt;
@ -274,7 +274,7 @@ public final class ProviderManager {
*
* @param elementName the XML element name.
* @param namespace the XML namespace.
* @return the key of the removed stanza(/packet) extension provider
* @return the key of the removed stanza extension provider
*/
public static String removeExtensionProvider(String elementName, String namespace) {
String key = getKey(elementName, namespace);

View file

@ -140,7 +140,7 @@ public class PacketParserUtils {
* connection is optional and is used to return feature-not-implemented errors for unknown IQ stanzas.
*
* @param parser
* @return a stanza(/packet) which is either a Message, IQ or Presence.
* @return a stanza which is either a Message, IQ or Presence.
* @throws Exception
*/
public static Stanza parseStanza(XmlPullParser parser) throws Exception {
@ -903,7 +903,7 @@ public class PacketParserUtils {
* Parses an extension element.
*
* @param elementName the XML element name of the extension element.
* @param namespace the XML namespace of the stanza(/packet) extension.
* @param namespace the XML namespace of the stanza extension.
* @param parser the XML parser, positioned at the starting element of the extension.
*
* @return an extension element.
@ -920,7 +920,7 @@ public class PacketParserUtils {
* Parses an extension element.
*
* @param elementName the XML element name of the extension element.
* @param namespace the XML namespace of the stanza(/packet) extension.
* @param namespace the XML namespace of the stanza extension.
* @param parser the XML parser, positioned at the starting element of the extension.
*
* @return an extension element.

View file

@ -46,7 +46,7 @@ import org.jxmpp.stringprep.XmppStringprepException;
*
* Packets that should be processed by the client to simulate a received stanza
* can be delivered using the {@linkplain #processStanza(Stanza)} method.
* It invokes the registered stanza(/packet) interceptors and listeners.
* It invokes the registered stanza interceptors and listeners.
*
* @see XMPPConnection
* @author Guenther Niess
@ -147,7 +147,7 @@ public class DummyConnection extends AbstractXMPPConnection {
}
/**
* Returns the first stanza(/packet) that's sent through {@link #sendStanza(Stanza)}
* Returns the first stanza that's sent through {@link #sendStanza(Stanza)}
* and that has not been returned by earlier calls to this method.
*
* @return a sent packet.
@ -157,7 +157,7 @@ public class DummyConnection extends AbstractXMPPConnection {
}
/**
* Returns the first stanza(/packet) that's sent through {@link #sendStanza(Stanza)}
* Returns the first stanza 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.
@ -175,11 +175,11 @@ public class DummyConnection extends AbstractXMPPConnection {
}
/**
* Processes a stanza(/packet) through the installed stanza(/packet) collectors and listeners
* and letting them examine the stanza(/packet) to see if they are a match with the
* Processes a stanza through the installed stanza collectors and listeners
* and letting them examine the stanza to see if they are a match with the
* filter.
*
* @param packet the stanza(/packet) to process.
* @param packet the stanza to process.
*/
@Override
public void processStanza(Stanza packet) {

View file

@ -67,8 +67,8 @@ public class ThreadedDummyConnection extends DummyConnection {
}
/**
* Calling this method will cause the next sendStanza call with an IQ stanza(/packet) to timeout.
* This is accomplished by simply stopping the auto creating of the reply stanza(/packet)
* Calling this method will cause the next sendStanza call with an IQ stanza to timeout.
* This is accomplished by simply stopping the auto creating of the reply stanza
* or processing one that was entered via {@link #processStanza(Stanza)}.
*/
public void setTimeout() {