1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 20:12:07 +01:00
Commit graph

1782 commits

Author SHA1 Message Date
Florian Schmaus
4a366007d6 Merge pull request #3 from Tsyko/xep-0332
Initial implementation of "HTTP over XMPP transport" (XEP-0332)
2014-03-20 12:25:24 +01:00
atsykholyas
236ea71cee Added support for HOXT (XEP-0332)
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.
2014-03-20 12:36:04 +02:00
Florian Schmaus
fcc8414a92 "not connected" is now a checked Exception thrown by sendPacket()
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
2014-03-19 15:56:41 +01:00
Florian Schmaus
d8c656270e Switch jbosh to 0.8.0-SNAPSHOT 2014-03-19 13:14:03 +01:00
Florian Schmaus
d349940537 Move DNS resolving into connect()
It was misplaced in ConnectionConfiguration anyways, as the sole
instantiation of a ConnectionConfiguration should not cause any network
I/O.
2014-03-19 13:14:03 +01:00
Florian Schmaus
dbab9b8995 Unify StringUtils.escapeForXML()
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.
2014-03-19 13:13:02 +01:00
Florian Schmaus
c592b4f046 Improve Exceptions (SMACK-426) 2014-03-19 09:00:10 +01:00
Florian Schmaus
9c8d7af3bf Fix error handling in BOSHConnection
getCause() never throws. Not sure why the code was written that
way. Thanks to CSH for reporting.
2014-03-19 09:00:10 +01:00
Florian Schmaus
44a5408bc0 Move host/port from ConnectionConfiguration to XMPPConnection
There semantic is that they now report the host used to establish the
connection. Therefore BOSHConfiguration needs to hostAddresses for
getURI().
2014-03-19 09:00:10 +01:00
Florian Schmaus
81d49d2f60 ChatManager should not throw a NPE if 'from' is null
Fixes SMACK-551
2014-03-19 09:00:10 +01:00
Florian Schmaus
ec82f63191 Move sample/ into resources/ 2014-03-19 09:00:10 +01:00
Florian Schmaus
ae64b0ad4b Fix javadoc in MUCInitialPresence.History 2014-03-19 09:00:10 +01:00
Florian Schmaus
91f0a091df Fix javadoc warning in xdata.Form 2014-03-19 09:00:10 +01:00
Florian Schmaus
4db967079f getInstanceFor() for ChatManager and AccountManager 2014-03-19 08:59:45 +01:00
Florian Schmaus
6197f6200f Move duplicate sendPacket() code into XMPPConnection 2014-03-17 19:52:52 +01:00
Florian Schmaus
c3f9ec4f94 Return the group if it exists in Roster.createGroup() 2014-03-17 19:21:20 +01:00
Florian Schmaus
a46d02ca32 Remove old Apache commons collections from codebase
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.
2014-03-17 14:47:55 +01:00
Florian Schmaus
f73a3afbca Add Chat.close() (SMACK-356) 2014-03-17 09:14:17 +01:00
Daniele Ricci
596008e90a Configuration flag for disabling session request on login
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>
2014-03-15 14:47:55 +01:00
Florian Schmaus
364cbd81da Add getter for connectionCounter to XMPPConnection 2014-03-15 11:39:38 +01:00
Florian Schmaus
64e7b8a868 Move getRoster() to XMPPConnection
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.
2014-03-15 11:21:49 +01:00
Florian Schmaus
4b56446e40 Introduce SmackException
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
2014-03-14 01:46:42 +01:00
Florian Schmaus
4b6f09f962 Move processPacket() method to XMPPConnection
This removes code duplication in BOSHConnection and TCPConnection's
PacketReader, by moving the common code to the superclass
XMPPConnection.
2014-03-14 00:25:22 +01:00
Florian Schmaus
89ed4d7492 Edit Eclipse formatting style
- Enums go on their own line
- Enable on/off formatter tags
2014-03-12 11:12:05 +01:00
Georg Lukas
d5195c4004 Update XMPPError to RFC6120
Fixes SMACK-445
2014-03-11 20:40:39 +01:00
Florian Schmaus
67722aea93 Fix typo: s/interna_server_error/internal_server_error/ 2014-03-11 19:30:55 +01:00
Florian Schmaus
7341421ca9 Announce support for vcard-temp/XEP-54
Add VCardManager to setup the vcard-temp feature. Fixes SMACK-414.
2014-03-11 19:18:08 +01:00
Florian Schmaus
b9f07046d3 Remove java.beans dependency
The java.beans package is not available on all platforms (e.g. Android).
2014-03-11 19:06:28 +01:00
Florian Schmaus
d655e130ca Make jul.properties only configure Smack's namespace
Fixes SMACK-535
2014-03-11 19:04:25 +01:00
Florian Schmaus
d8a8f79701 Cleanup of deprecated methods (SMACK-432) 2014-03-11 19:04:25 +01:00
Florian Schmaus
bd6828db38 Make EntityCapsManager's node version configurable
Also some cleanup of caps code.
2014-03-11 09:20:55 +01:00
Florian Schmaus
4fb5b85806 Re-activate all ignored unit-tests
Make all unit tests functional again.
2014-03-10 22:41:34 +01:00
Florian Schmaus
a6ed3b2514 Use static block in XMPPError
The Condition to ErrorSpecification map is now build within a static
block.
2014-03-10 22:37:42 +01:00
Florian Schmaus
b8a5437b28 Fix all javadoc warnings 2014-03-10 21:58:12 +01:00
Florian Schmaus
0058631ed6 AMP should use provider/packet packages and JUL
- Move AMPExtensionProvider to amp.provider
- Move AMPExtension to amp.packet
- Move java.util.logging for logging

SMACK-544
2014-03-10 17:03:07 +01:00
Florian Schmaus
6110872062 Cleanup of PrivacyList API
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.
2014-03-10 15:32:17 +01:00
Florian Schmaus
b489828027 Improve IQReplyFilter
Only log spoof attempts if the from filter doesn't match. Previously all
non-matches where logged as spoof attempts.
Fix String.format() s/%d/%s/
2014-03-10 12:20:20 +01:00
Florian Schmaus
8e693ba5d5 Add nightly javadoc and documentation link to README 2014-03-10 10:23:33 +01:00
Florian Schmaus
a3ab886896 Reworked compression-jzlib and compressionHandlers
- There is now no longer the need to use reflection for
compression-jzlib.
- compressionHandlers are a global configuration property and therefore
belong in SmackConfiguration.
2014-03-10 10:20:52 +01:00
Florian Schmaus
489816c61f Renamed Connection to XMPPConnection 2014-03-10 09:45:50 +01:00
Florian Schmaus
f3e007bad5 NPE check in SmackConfiguration 2014-03-09 23:43:34 +01:00
Florian Schmaus
1f2183605c Make IQReplyFilter aware of user-less connection state
SMACK-533
2014-03-09 21:31:48 +01:00
Florian Schmaus
a7ec0338bc Don't set SASL authid parameter to username (SMACK-371)
RFC4616 states that if the authorization identity (authzid) parameter is
null, then it is derived from the authentication
identity (authcid). Smack currently sets both, authzid and authcid, to
the username, resulting in auth attempts of

userid\0userid\0password

instead of

userid\0password

Which are different users on most systems (e.g. Kerberos).

We now set only SASLMechanism.authenticationId to username. The
authenticate(String, CallbackHandler) method does now not longer receive
the username, as it's send by the CallbackHandler.
2014-03-09 14:59:45 +01:00
Florian Schmaus
f7fc38e1f4 Refactor Managers to subclass abstract Manager
Also use ServiceDiscoveryManager.supportsFeature() where possible.
2014-03-09 14:59:45 +01:00
Florian Schmaus
93eea8ab8d Move gradle subproject configuration into the subproject 2014-03-09 14:59:45 +01:00
Lars Noschinski
45226080e6 Fix typo in variable name 2014-03-09 14:59:45 +01:00
Lars Noschinski
1a2933793c Tune documentation
Waiting for an answer is synchronous behaviour, not asynchronous.
2014-03-09 14:59:45 +01:00
Lars Noschinski
4cb799228c Cleanup texts and comments 2014-03-09 11:20:32 +01:00
Lars Noschinski
86a4bfa43f Remove deprecated constructor for FromMatchesFilter (SMACK-71) 2014-03-09 11:20:32 +01:00
Georg Lukas
62de78ef7c SMACK-53: create VersionProvider and VersionManager
The VersionProvider is used to parse Version IQs. Integration:

	providerManager.addIQProvider("query", Version.NAMESPACE, new VersionProvider());

The VersionManager is used to reply to Version IQs. Integration:

	VersionManger.getInstanceFor(connection).setVersion(
		new Version("App Name", "1.23", "Operating System"));
2014-03-09 11:20:31 +01:00