diff options
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_; - }; } |