Also change StringUtils.escapeForXML() and Packet.toXML() to return
CharSequence instead of String. XmlStringBuilder now has 'optX' methods.
Remove XmlUtils in favor of XmlStringBuilder
If whitespace (e.g. \n \t) needs to be preserved, then XML elements
should be used instead of attributes. Since we do this now in
DirectoryRosterStore, there is also no longer a need for an
specialized StringUtils.escapeForXML().
Also introduce XmlStringBuilder, which should become the default way
to implement Packet.toXML() and the like.
This is initial impementation of XEP-0332 (SMACK-552) -
HTTP over XMPP transport.
Created extensions, providers and unit tests.
Two features are missing: jingle and sipub.
There is a unsolveable race condition between the connection state and
sendPacket(), i.e. the connection could go down, right after the
method calling sendPacket is called, but before sendPacket() is
invoked. Before this change, sendPacket() has thrown an unchecked
IllegalStateException, which could be ignored by the Smack user, who
would also not notice the race condition. We have decided to throw a
checked Exception in this case now, to make the Smack user aware of
this situation.
SMACK-426
Rework StringUtils.escapeForXML() so that it can be used also for
StringUtils.xmlAttribEncodeBinary(). escapeForXML() now uses a
switch/case statement, which should leave the (JIT) compiler more room
for optimizations.
Removing the "do not escape unicode character references", because
this behavior, introduced with
8264ebdfb5, is incorrect.
ChatManager's Chat instances are now removed by Chat.close(), removing
the need for a Map with Hard to Weak references.
ChatStateManager can simply use WeakHashMap.
Although this was mandatory on RFC 3921, RFC 6120/6121 don't even mention this part of the protocol.
Signed-off-by: Daniele Ricci <daniele.athome@gmail.com>
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
Use Type enum instead of String for PrivacyItem's constructor. Add
getName() to PrivacyList. Remove PrivacyRule, as it just adds unnecessary
complexity spliting PrivacyItem and PrivacyRule, they belong
together. Don't mix camel-case and c-style method names. Some minor
improvements. Add parser test.