client/protocol/I_XmlBlasterConnection.h

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002 Name:      I_XmlBlasterConnection.h
00003 Project:   xmlBlaster.org
00004 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
00005 Comment:   Interface (virtual class)
00006 ------------------------------------------------------------------------------*/
00007 
00014 #ifndef _CLIENT_PROTOCOL_I_XMLBLASTERCONNECTION_H
00015 #define _CLIENT_PROTOCOL_I_XMLBLASTERCONNECTION_H
00016 
00017 #include <string>
00018 #include <vector>
00019 #include <util/xmlBlasterDef.h>
00020 #include <util/MessageUnit.h>
00021 #include <util/qos/ConnectQos.h>
00022 #include <util/qos/DisconnectQos.h> 
00023 #include <client/qos/EraseQos.h>
00024 #include <client/qos/EraseReturnQos.h>
00025 #include <client/qos/GetQos.h>
00026 #include <client/qos/GetReturnQos.h>
00027 #include <client/qos/PublishQos.h>
00028 #include <client/qos/PublishReturnQos.h>
00029 #include <client/qos/SubscribeQos.h>
00030 #include <client/qos/SubscribeReturnQos.h>
00031 #include <client/qos/UnSubscribeQos.h>
00032 #include <client/qos/UnSubscribeReturnQos.h>
00033 #include <client/key/EraseKey.h>
00034 #include <client/key/GetKey.h>
00035 #include <client/key/GetReturnKey.h>
00036 #include <client/key/PublishKey.h>
00037 #include <client/key/SubscribeKey.h>
00038 #include <client/key/UnSubscribeKey.h>
00039 
00040 /* Would be nicer to declare only instead of including them all:
00041 namespace org { namespace xmlBlaster { namespace util {
00042    class MessageUnit;
00043 }}}
00044 
00045 namespace org { namespace xmlBlaster { namespace client { namespace qos {
00046    class EraseQos;
00047    class EraseReturnQos;
00048    class GetQos;
00049    class GetReturnQos;
00050    class PublishQos;
00051    class PublishReturnQos;
00052    class SubscribeQos;
00053    class SubscribeReturnQos;
00054    class UnSubscribeQos;
00055    class UnSubscribeReturnQos;  // is a typedef -> would all compilers eat it?
00056 }}}}
00057 
00058 namespace org { namespace xmlBlaster { namespace client { namespace key {
00059    class EraseKey;
00060    class GetKey;
00061    class GetReturnKey;
00062    class PublishKey;
00063    class SubscribeKey;
00064    class UnSubscribeKey;
00065 }}}}
00066 */
00067 
00068 namespace org { namespace xmlBlaster { namespace client { namespace protocol {
00069 
00070    class Dll_Export I_XmlBlasterConnection
00071    {
00072    public:
00073       virtual ~I_XmlBlasterConnection() {}
00074 
00083       virtual org::xmlBlaster::util::qos::ConnectReturnQosRef connect(const org::xmlBlaster::util::qos::ConnectQosRef& qos) = 0;
00084 
00089       virtual bool disconnect(const org::xmlBlaster::util::qos::DisconnectQos& qos) = 0;
00090 
00091       // Could make sense to the SOCKET driver, returns new SocketCallbackImpl
00092       //public org::xmlBlaster::client::I_CallbackServer getCbServerInstance() throws org::xmlBlaster::util::XmlBlasterException;
00093 
00097       virtual std::string getProtocol() = 0;
00098 
00103       virtual bool shutdown() = 0;
00104 
00105       virtual std::string getLoginName() = 0;
00106 
00107       virtual bool isLoggedIn() = 0;
00108 
00109       virtual std::string ping(const std::string& qos) = 0;
00110 
00111       virtual org::xmlBlaster::client::qos::SubscribeReturnQos subscribe(const org::xmlBlaster::client::key::SubscribeKey& key, const org::xmlBlaster::client::qos::SubscribeQos& qos) = 0;
00112 
00113       virtual std::vector<org::xmlBlaster::util::MessageUnit> get(const org::xmlBlaster::client::key::GetKey& key, const org::xmlBlaster::client::qos::GetQos& qos) = 0;
00114 
00115       virtual std::vector<org::xmlBlaster::client::qos::UnSubscribeReturnQos> 
00116          unSubscribe(const org::xmlBlaster::client::key::UnSubscribeKey& key, const org::xmlBlaster::client::qos::UnSubscribeQos& qos) = 0;
00117 
00118       virtual org::xmlBlaster::client::qos::PublishReturnQos publish(const org::xmlBlaster::util::MessageUnit& msgUnit) = 0;
00119 
00120       virtual void publishOneway(const std::vector<org::xmlBlaster::util::MessageUnit> &msgUnitArr) = 0;
00121 
00122       virtual std::vector<org::xmlBlaster::client::qos::PublishReturnQos> publishArr(const std::vector<org::xmlBlaster::util::MessageUnit> &msgUnitArr) = 0;
00123 
00124       virtual std::vector<org::xmlBlaster::client::qos::EraseReturnQos> erase(const org::xmlBlaster::client::key::EraseKey& key, const org::xmlBlaster::client::qos::EraseQos& qos) = 0;
00125    };
00126 
00127 }}}} // namespaces
00128 
00129 #endif