client/qos/PublishQos.h

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002 Name:      PublishQos.h
00003 Project:   xmlBlaster.org
00004 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
00005 ------------------------------------------------------------------------------*/
00006 
00040 #ifndef _CLIENT_QOS_PUBLISHQOS_H
00041 #define _CLIENT_QOS_PUBLISHQOS_H
00042 
00043 #include <util/xmlBlasterDef.h>
00044 #include <util/qos/storage/QueuePropertyBase.h>
00045 #include <util/PriorityEnum.h>
00046 #include <util/qos/MsgQosData.h>
00047 
00048 
00049 
00050 
00051 namespace org { namespace xmlBlaster { namespace client { namespace qos {
00052 
00053 class Dll_Export PublishQos
00054 {
00055 private:
00056    std::string     ME;
00057    org::xmlBlaster::util::Global&    global_;
00058    org::xmlBlaster::util::qos::MsgQosData msgQosData_;
00059 
00060 public:
00064    PublishQos(org::xmlBlaster::util::Global& global);
00065 
00073    PublishQos(org::xmlBlaster::util::Global& global, const org::xmlBlaster::util::Destination& destination);
00074 
00078    PublishQos(org::xmlBlaster::util::Global& global, bool persistent);
00079 
00083    const org::xmlBlaster::util::qos::MsgQosData& getData();
00084 
00089    org::xmlBlaster::util::PriorityEnum getPriority() const;
00090 
00097    void setPriority(org::xmlBlaster::util::PriorityEnum priority);
00098 
00105    void setForceUpdate(bool force);
00106 
00113    void setForceDestroy(bool forceDestroy);
00114 
00120    void setSubscribable(bool isSubcribeable);
00121 
00127    void setReadonly(bool readonly);
00128 
00136    void setVolatile(bool volatileFlag);
00137 
00141    bool isVolatile();
00142 
00146    void setPersistent(bool persistent);
00147 
00156    void setLifeTime(long lifeTime);
00157 
00164    void addDestination(const org::xmlBlaster::util::Destination& destination);
00165 
00170    org::xmlBlaster::util::SessionNameRef getSender();
00171 
00172    /*
00173     * Access sender name.
00174     * @param loginName of sender
00175     * @deprecated The sender is forced to the correct client name automatically
00176     */
00177    //void setSender(const org::xmlBlaster::util::SessionName& sender);
00178 
00183    void setState(const std::string& state);
00184 
00185    std::string getState();
00186 
00190    void setStateInfo(const std::string& stateInfo);
00191 
00192    std::string getStateInfo();
00193 
00197    void setTopicProperty(const org::xmlBlaster::util::qos::TopicProperty& topicProperty);
00198 
00222    template <typename T_VALUE> void addClientProperty(
00223             const std::string& name,
00224             const T_VALUE& value,
00225             const std::string& type="",
00226             const std::string& encoding="",
00227             const std::string& charset="") {
00228       msgQosData_.addClientProperty(name, value, type, encoding, charset);
00229    }
00230 
00235    void setClientProperties(const org::xmlBlaster::util::qos::QosData::ClientPropertyMap& cm);
00236 
00240    const org::xmlBlaster::util::qos::QosData::ClientPropertyMap& getClientProperties() const;
00241 
00246    std::string toString();
00247 
00252    std::string toXml();
00253 };
00254 
00255 }}}}
00256 
00257 #endif