Commit Graph

30 Commits

Author SHA1 Message Date
Florian Schmaus 64d134052d Enable javadoc checkstyle
and fix violations.
2015-03-29 12:29:32 +02:00
Florian Schmaus 5e86db4f80 Substitute 'packet' with 'stanza(/packet)' in javadoc 2015-03-21 09:36:28 +01:00
Florian Schmaus d4a6d8e653 Rename PacketFilter (and implementing classes) and PacketExtension
to StanzaFilter and ExtensionElement.
2015-02-28 13:49:38 +01:00
Florian Schmaus 1190edad0f Add 'Packet' interface
to aid transition to the new 'Stanza' class ('Packet' was renamed to
'Stanza' a few commits before this).
2015-02-06 09:34:58 +01:00
Florian Schmaus 4698805a34 Rename 'Packet' class to 'Stanza'
Smack still uses the term 'Packet' in some places. This is just the
first step towards using correct XMPP terms in Smack.
2015-02-06 09:34:51 +01:00
Florian Schmaus 9fc26f1d83 Use MultiMap for Stanza extension elements 2015-02-05 11:04:38 +01:00
Florian Schmaus 293f90c6c6 Add StanzaIdUtil 2015-01-19 18:51:53 +01:00
Florian Schmaus 4a5732d679 Fix Packet's javadoc
ID_NOT_AVAILABLE was removed in
8b16c49a31
2015-01-19 14:04:05 +01:00
Florian Schmaus 8409dddffd Add PacketUtil.extensionElementFrom()
and deprecate extensionElementfromCollection()
2015-01-19 08:41:21 +01:00
Florian Schmaus 55a967da93 Add Packet.toString() 2014-12-27 21:12:59 +01:00
Florian Schmaus 9286a1decb Rework XMPP Error class design
Introduce AbstractError, change 'Conditions' to enums. Because of
AbstractError, it was necessary that PlainStreamElement and
TopLevelStreamElement becomes an interface. Thus the implementation of
TopLevelStreamElement.toString() had to be removed.

This adds

- policy-violation
- unexpected-request

to XMPPError.Condition, and removes the

- payment-required
- remote-server-error
- unexpected-condition
- request-timeout

Conditions

The file transfer code does now no longer throw XMPPErrorExceptions, but
SmackExceptions.

Fixes SMACK-608. Makes it possible to resolves SMACK-386.
2014-11-25 13:19:32 +01:00
Florian Schmaus 646a4a6f90 Add support for SASL failure 'text' elements
- Also move toString() into TopLevelStreamElement.
- Fix SASLFailure toXML xmlnsAttribute(NAMESPACE)
- Improve SASLFailure parsing
- And introduce XmlUnitUtils
2014-11-19 09:57:39 +01:00
Florian Schmaus 9e797c1b17 Enable PacketExtensions for IQs
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.
2014-11-10 11:43:18 +01:00
Florian Schmaus 77a4867450 Change Packet.getExtensionsXML()
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.
2014-11-05 20:25:51 +01:00
Florian Schmaus 10643cce7c Use LinkedHashMap for PacketExtensions in Packet
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.
2014-11-05 17:58:32 +01:00
Florian Schmaus c1aef37081 Undeprecate Packet.getExtension(String)
as there a valid uses for it, see for example ChatStateManager:173.
2014-10-31 17:12:24 +01:00
Florian Schmaus b73bb27463 Improve Packet javadoc 2014-10-29 14:05:38 +01:00
Florian Schmaus d60b63a89a Remove hashCode/equals from Message and Packet
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).
2014-10-28 15:11:48 +01:00
Florian Schmaus 416f42deb7 Make fields in Packet and Message final 2014-10-28 15:11:48 +01:00
Florian Schmaus f94f7590a6 Store packet extensions in a HashMap
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).
2014-10-28 15:11:43 +01:00
Florian Schmaus 2dc93d7639 Add support for XEP-0059: Result Set Management
SMACK-581
2014-09-13 12:28:18 +02:00
Florian Schmaus c024931de8 Remove XmlLangStanza
since all stanza types could have 'xml:lang' defined as top-level
stream element attribute.
2014-09-12 11:26:09 +02:00
Florian Schmaus fc51f3df48 Add support for XEP-0198: Stream Management
- De-duplicate code by moving it into AbstractXMPPConnection
- Introduce TopLevelStreamElement as superclass for all XMPP stream elements.
- Add SynchronizationPoint, ParserUtils
- Add ParserUtils

Fixes SMACK-333 and SMACK-521
2014-09-11 09:49:16 +02:00
Florian Schmaus 67011fc322 Remove xmlns field from Packet
Stanzas do not have a xmlns attribute in their top level element.
2014-09-03 17:56:51 +02:00
Florian Schmaus 7735a5224c Merge branch '4.0'
Conflicts:
	smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferManager.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferNegotiator.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java
	smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamRequestTest.java
	smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InitiationListenerTest.java
	smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/InitiationListenerTest.java
2014-07-14 14:31:09 +02:00
Florian Schmaus bd0ada480b Improve DeliveryReceipt code, add javadoc
Also make Packet.getExtension() use Generics
2014-07-13 11:39:01 +02:00
Florian Schmaus bdf9a75c4f Use XmlStringBuilder in RosterPacket and XMPPError 2014-07-07 12:30:36 +02:00
Florian Schmaus 8b16c49a31 Remove Packet.ID_NOT_AVAILABLE 2014-07-06 23:57:06 +02:00
Florian Schmaus c7db63612c Remove javadoc references to code now in JXMPP 2014-06-02 16:59:45 +02:00
Florian Schmaus 91fd15ad86 Prefix subprojects with 'smack-'
instead of using the old baseName=smack appendix=project.name approach,
we are now going convention over configuration and renaming the
subprojects directories to the proper name.

Having a prefix is actually very helpful, because the resulting
libraries will be named like the subproject. And a core-4.0.0-rc1.jar is
not as explicit about what it actually *is* as a
smack-core-4.0.0-rc1.jar.

SMACK-265
2014-04-28 19:44:14 +02:00
Renamed from core/src/main/java/org/jivesoftware/smack/packet/Packet.java (Browse further)