util/qos/TopicProperty.h

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002 Name:      TopicProperty.h
00003 Project:   xmlBlaster.org
00004 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
00005 ------------------------------------------------------------------------------*/
00006 
00022 #ifndef _UTIL_QOS_TOPICPROPERTY_H
00023 #define _UTIL_QOS_TOPICPROPERTY_H
00024 
00025 #include <util/xmlBlasterDef.h>
00026 #include <string>
00027 #include <util/I_Log.h>
00028 #include <util/qos/storage/MsgUnitStoreProperty.h>
00029 #include <util/qos/storage/HistoryQueueProperty.h>
00030 #include <util/Prop.h>
00031 
00032 namespace org { namespace xmlBlaster { namespace util { namespace qos {
00033  // TODO: Change to use glob instead of org::xmlBlaster::util::Global singleton! What about performance? Put variable into org::xmlBlaster::util::Global?
00043 extern Dll_Export const long destroyDelay_DEFAULT_DEFAULT;
00045 extern Dll_Export const bool DEFAULT_readonly;
00046 
00047 class Dll_Export TopicProperty
00048 {
00049 private:
00050    std::string ME;
00051    org::xmlBlaster::util::Global& global_;
00052    org::xmlBlaster::util::I_Log& log_;
00053    org::xmlBlaster::util::qos::storage::MsgUnitStoreProperty* msgUnitStoreProperty_;
00054    org::xmlBlaster::util::qos::storage::HistoryQueueProperty* historyQueueProperty_;
00055 
00056    /* If Pub/Sub style update: contains the subscribe ID which caused this topic */
00057    //std::string subscriptionId;
00058 
00059    bool readonly_; //  = DEFAULT_readonly;
00060 
00065    long destroyDelay_;
00066 
00067    long destroyDelay_DEFAULT; // = org::xmlBlaster::util::Global.instance().getProperty().get("topic.destroyDelay", destroyDelay_DEFAULT_DEFAULT);
00068 
00069    Prop<bool> createDomEntry_;
00070 
00071    void copy(const TopicProperty& prop);
00072 
00073 public:
00077    TopicProperty(org::xmlBlaster::util::Global& global);
00078 
00079    TopicProperty(const TopicProperty& prop);
00080    TopicProperty& operator =(const TopicProperty& prop);
00081 
00082    ~TopicProperty();
00083 
00087    void setReadonly(bool readonly);
00088 
00092    bool isReadonly();
00093 
00097    long getDestroyDelay();
00098 
00102    void setDestroyDelay(long destroyDelay);
00103 
00109    bool createDomEntry() const;
00110 
00116    void setCreateDomEntry(bool createDomEntry);
00117 
00118    bool hasMsgUnitStoreProperty();
00119 
00123    org::xmlBlaster::util::qos::storage::MsgUnitStoreProperty getMsgUnitStoreProperty();
00124 
00125    void setMsgUnitStoreProperty(const org::xmlBlaster::util::qos::storage::MsgUnitStoreProperty& msgUnitStoreProperty);
00126 
00127    bool hasHistoryQueueProperty();
00128 
00132    org::xmlBlaster::util::qos::storage::HistoryQueueProperty getHistoryQueueProperty();
00133 
00134    void setHistoryQueueProperty(const org::xmlBlaster::util::qos::storage::HistoryQueueProperty& historyQueueProperty);
00135 
00142    std::string toXml(const std::string& extraOffset="");
00143 };
00144 
00145 }}}}
00146 #endif