Since c81cd34561 we can report not
connected/authenticated when the client is disconnected but the stream
could be resumed. The previous behavior caused some confusion among
the users.
The 'break' statement in the END_DOCUMENT case should break the parsing
loop and not the switch/case within. Therefore we need to add a loop
label on break on that label.
Introducing a clean split between the constant connection configuration
parameters, which are now all in ConnectionConfiguration and the dynamic
connection state (e.g. hostAddresses) which are now in
AbstractXMPPConnection.
Also removed all arguments of login() since the username, password,
resource and callback handler need now to be configured via
ConnectionConfiguration.
Also remove documentation/extensions/messageevents.md, as it's already
in documentation/legacy
This is actually only part one, i.e. with this commit if the user adds a
PacketExtension to an IQ it will be included in IQ.toXml(). Which was
previously only the case if the IQ subclass explicitly included packet
extensions.
The second part of the change is to change the IQ provider, so that
packet extensions are automatically parsed.
Cases where PacketExtensions are used for Message and IQ are slightly
changed. The IQ sublcass now only has a field with this
PacketExtension (see for example
bytestreams.ibb.packet.DataPacketExtension).
Also changed hoxt API: Removed unnecessary indirection and made the
API more Smack idiomatic.
Remove the synchronized, as getExtensions() is properly synchronized and will
return a copy.
Return XmlStringBuilder instead of CharSequence to take advantage of
fast XmlStringBuilder.append(XmlStringBuilder).
Mark the method as final, as it should not be overwritten.
to keep the order in which the elements are added.
Some XEPs define a Schema using 'xs:sequence' (see for example XEP-60 §
17.1), so the order the PacketExtensions are added should be the same
they are transformed to a XML String.
In order to prevent
<iq to='...' from='...' type='result' id='1'>
<mynode xmlns='my:namespace' myattr='...'>
<somenode\>
</mynode>
</iq>
showing up as UnparsedResultIQ like this:
<iq to='...' from='...' type='result' id='1'>
<somenode\>
</iq>
Also make executorService a non-ScheduledExecutorService. This was an
artifact from times where executorService as used to schedule
Runnables. But now it's just used to queue the receive packets in
Runnables and call the packet collectors and listeners.
- rename idStanzaAcknowledged to stanzaIdAcknowledged
- introduce smWasEnabledAtLeastOnce and throw
StreamManagementNotEnabledExceptions
- enable SM is SM resumption is enabled
Also remove unnecessary done() check in nextStreamElement() and remove
wrong comment in !instantShutdown branch. There is no mechanism to
forcible close the socket.
Those where never correctly implemented and are not really used. If you
want to compare Packets, compare their toXML() result.
N.B. that we keep hashCode/equals for Message.(Subject|Body) because
those are correct and are in-use ('bodies' and 'subjects' are Sets in
Message).
allowing O(1) lookups for PacketExtensions
The one EntityCapsManagerTest becomes obsolete with this change, as
duplicate extension elements (RFC 6120 § 8.4) are now no longer possible
after the stanza has been parsed (they still may be received on the
wire, but only the last duplicate will be added).
sendListeners are now invoked *after* the packet has been put on the
wire.
Also sending listener exceptions are not catched and not only
NotConnectedExceptions. And a exception does not cause a 'break' but a
'continue' now. Log level is WARNING now.