Follow XEP-170 recommendations: Resource binding *after* compression.
Fixes also a bunch of race conditions related to the wait()/notify()
pattern used in the early stages of a Connection where
createPacketCollectorAndSend(Packet).nextResultOrThrow() can not be
used. Those wait()/notify() patterns are currently
- SASL authentication
- compression
- resource binding
Fixes SMACK-454
Fix a race condition in useCompression where the compression request was
send outside the synchronized block, this could cause notify() to be
called without a previoius call to wait().
s/streamCompressionDenied/streamCompressionNegotiationDone/ and re-use
the method once the server ack'd stream compression.
Also don't call notifyConnectionError() when requestStreamCompression()
encounters an exception, instead throw the exception.
Instead of using the connectionID, we now use a new boolean
lastFeaturesParsed to mark when startup() is able to continue or when a
NoResponseException should be thrown.
Fixes the problem when the connectionId was set and the wait() would
timeout, resulting in startup() believing that everything was ok, while
in fact the features where not yet received (or parsed). SMACK-558.
This commit renames classes as follows:
* TCPConnection --> XMPPTCPConnection
* BOSHConnection --> XMPPBOSHConnection
There are two reasons for this rename. First, it is there to indicate
that the classes actually _are_ XMPP connections, using different
transport mechanisms. Second, it makes auto-completion in IDEs easier,
the developer can type XMPP<complete> and choose the right backend.
Also remove the Exceptions from the signature of getRoster().
Extend ConnectionListener with connected() and authenticated()
callbacks, required by Roster to be notified so that the Roster can be
loaded *after* login.
SmackException (and it's subclasses) is for all errors/exceptions not
defined by any XMPP specification. XMPPException is now an abstract
class for all errors defined by the XMPP specifications.
Methods that involve an IQ exchange now either return the result, which
is obtained by IQ response, or they throw an XMPPErrorException if an IQ
error was the result of the IQ set/get. If there was no response from
the server within the default packet timeout, a NoResponseException will
be thrown.
XMPP SASL errors are now also reported accordingly.
SMACK-426