diff options
author | Kevin Smith <git@kismith.co.uk> | 2011-11-12 16:56:21 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2011-12-13 08:17:58 (GMT) |
commit | 81c09a0f6a3e87b078340d7f35d0dea4c03f3a6d (patch) | |
tree | 4371c5808ee26b2b5ed79ace9ccb439ff2988945 /Swiften/Network/BOSHConnectionFactory.h | |
parent | fd17fe0d239f97cedebe4ceffa234155bd299b68 (diff) | |
download | swift-contrib-81c09a0f6a3e87b078340d7f35d0dea4c03f3a6d.zip swift-contrib-81c09a0f6a3e87b078340d7f35d0dea4c03f3a6d.tar.bz2 |
BOSH Support for Swiften
This adds support for BOSH to Swiften. It does not expose it to Swift.
Release-Notes: Swiften now allows connects over BOSH, if used appropriately.
Diffstat (limited to 'Swiften/Network/BOSHConnectionFactory.h')
-rw-r--r-- | Swiften/Network/BOSHConnectionFactory.h | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/Swiften/Network/BOSHConnectionFactory.h b/Swiften/Network/BOSHConnectionFactory.h index 7431cf4..3750057 100644 --- a/Swiften/Network/BOSHConnectionFactory.h +++ b/Swiften/Network/BOSHConnectionFactory.h @@ -4,19 +4,40 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2011 Kevin Smith + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + #pragma once +#include <string> + #include <Swiften/Network/ConnectionFactory.h> #include <Swiften/Network/HostAddressPort.h> +#include <Swiften/TLS/TLSContextFactory.h> +#include <Swiften/Base/URL.h> namespace Swift { - class BOSHConnectionFactory : public ConnectionFactory { - public: - BOSHConnectionFactory(ConnectionFactory* connectionFactory); - virtual boost::shared_ptr<Connection> createConnection(); +class XMLParserFactory; + +class BOSHConnectionFactory { + public: + BOSHConnectionFactory(const URL& boshURL, ConnectionFactory* connectionFactory, XMLParserFactory* xmlParserFactory, TLSContextFactory* tlsFactory); + + /** + * @param overrideFactory If non-NULL, creates a connection over the given factory instead. + */ + boost::shared_ptr<Connection> createConnection(ConnectionFactory* overrideFactory); + ConnectionFactory* getRawConnectionFactory() {return connectionFactory;} + TLSContextFactory* getTLSContextFactory() {return tlsFactory;} + private: + URL boshURL; + ConnectionFactory* connectionFactory; + XMLParserFactory* xmlParserFactory; + TLSContextFactory* tlsFactory; +}; - private: - ConnectionFactory* connectionFactory_; - }; } |