Commit Graph

17 Commits

Author SHA1 Message Date
Florian Schmaus 6fec813ec0 Rework DiscoverInfo
Make Feature and Identity immutable and allow fast lookup of those two
in DiscoverInfo.
2014-10-31 23:44:04 +01:00
Florian Schmaus b60b20e312 Remove unnecessary multiplication in DiscoverInfo.hashCode() 2014-10-31 20:02:50 +01:00
Florian Schmaus 17bb738e9e Make PubSubManager.getNode(String) more robust
I've got reports from users that in some cases there can be multiple
identities. Not just one, and in this case, the node type may not be the
first identity. We now iterate over all identities until we either found
one of type "leaf" or "collection".

For example one user reports an ejabberd with PEP case, where the first
identity is of type "pep", the second of type "leaf" and a third one
with category "account" and type "registered".

Also extend DiscoverInfo API with hasIdentity(String, String) and
getIdentities(String, String).
2014-10-17 14:26:06 +02:00
Florian Schmaus b54d133b36 Add MultiUserChatManager
apply the Manager pattern to 'muc'. This prevents the user creating
multiple MultiUserChat instances for the same MUC.

Move the static method from MultiUserChat to MultiUserChatManager.

Also add AbstractNodeInformationProvider.
2014-10-13 22:32:34 +02:00
Florian Schmaus 452b2aca0f Add 'PacketParserUtils.addPacketextension()' 2014-10-08 16:01:19 +02:00
Florian Schmaus 6980c8e63d Rework Smack Provider design
this is the first stop towards fixing "SMACK-65: parsing should look for
depth", by providing the initial parsing depth to the provider. Some
methods (.e.g parseMessage) now use the depth as abort condition,
instead of a unclean String equals check.

parseIQ() and parseExtension() where both renamed to parse.

This also restricts the Exceptions thrown by the parse method, to just
XmlPullParserException, IOException and SmackException (not really a big
victory, but nevertheless a slight improvement).

StreamFeatureProvider is now gone, we simply use PacketExtensionProvider
for stream features.
2014-10-08 16:01:14 +02:00
Florian Schmaus f2718c2d76 Remove smack.util.Cache
and use the Cache from jxmpp-util-cache instead.
2014-09-13 00:38:11 +02:00
Florian Schmaus 6af5d5e462 SDM: Follow guidelines, perform put() where get() is performed 2014-08-26 13:50:47 +02:00
Florian Schmaus 5d159c4be2 Make ServiceDiscoveryManager use constant PacketFilters 2014-08-26 13:50:47 +02:00
Florian Schmaus bbf89c65bf Fix typo in XmlStringBuilder, it's not an Angel
s/rightAngelBracket/rightAngleBracket/
2014-08-20 21:25:14 +02:00
Florian Schmaus a5eebf3840 Make ServiceDiscoveryManager.findServices() more robust
the method should not throw an exception if the discovery of the service
fails.
2014-08-08 16:23:13 +02:00
Florian Schmaus 7b3331dda0 Add API to find services for a given feature
It's a common pattern to look for all services hosted under the users
service that provide a given feature. Let's provide an API for that and
use that API in the methods that benefit from it.
2014-07-26 07:14:42 +02:00
Florian Schmaus 8526f8ab29 Introduce packet.Element
Re-work filetransfer/bytestream stanza toXML() method to use
XmlStringBuilder. Move the ELEMENT and NAMESPACE definitions in the
right place, ie. the stanza class.
2014-07-05 11:59:45 +02:00
Júlio Cesar Bueno Cotta 9be0c480e3 Change IQ.Type to enum 2014-06-06 21:10:13 -03:00
Florian Schmaus beecb8a675 Make XMPPConnection an interface
create AbstractXMPPConnection.
2014-05-28 08:18:41 +02:00
Florian Schmaus 7a5533c823 Fix NPE in DiscoverInfo.Identities XmlStringBuilder
The 'name' attribute of an service discovery identity is
optional. Thanks to Jens Offenbach for reporting.
2014-05-07 12:46:24 +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