util/key/KeyData.h

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002 Name:      KeyData.h
00003 Project:   xmlBlaster.org
00004 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
00005 ------------------------------------------------------------------------------*/
00006 #ifndef _UTIL_KEY_KEYDATA_H
00007 #define _UTIL_KEY_KEYDATA_H
00008 
00009 #include <util/xmlBlasterDef.h>
00010 #include <util/I_Log.h>
00011 #include <util/ReferenceCounterBase.h>
00012 #include <util/ReferenceHolder.h>
00013 
00014 namespace org { namespace xmlBlaster { namespace util { namespace key {
00015 
00017 extern Dll_Export const char* CONTENTMIME_DEFAULT;
00018 
00020 extern Dll_Export const char* DEFAULT_DOMAIN;
00021 
00023 extern Dll_Export const char* QUERYTYPE_DEFAULT;
00024 
00050 class Dll_Export KeyData : public org::xmlBlaster::util::ReferenceCounterBase
00051 {
00052 protected:
00053    std::string ME;
00054    org::xmlBlaster::util::Global& global_;
00055    org::xmlBlaster::util::I_Log&    log_;
00056 
00058    mutable std::string oid_;
00059 
00061    std::string contentMime_;
00062    
00064    std::string contentMimeExtended_;
00065 
00067    std::string domain_;
00068    
00070    mutable bool isGeneratedOid_;
00071    
00073    std::string queryType_;
00074    
00076    std::string queryString_;
00077 
00078    void init();
00079 
00080    void copy(const KeyData& key);
00081 
00082 public:
00086    KeyData(org::xmlBlaster::util::Global& global);
00087 
00091    KeyData(const KeyData& key);
00092 
00096    KeyData& operator =(const KeyData& key);
00097 
00098    virtual ~KeyData();
00099 
00100    void setOid(const std::string& oid);
00101 
00105    std::string getOid() const;
00106 
00116    bool isDeadMessage() const;
00117 
00121    bool isPluginInternal() const;
00122 
00126    bool isInternal() const;
00127 
00131    bool isAdministrative() const;
00132 
00139    void setContentMime(const std::string& contentMime);
00140 
00147    std::string getContentMime() const;
00148 
00158    void setContentMimeExtended(const std::string& contentMimeExtended);
00159 
00169    std::string getContentMimeExtended() const;
00170 
00178    void setDomain(const std::string& domain);
00179 
00184    std::string getDomain() const;
00185 
00189    bool isDefaultDomain() const;
00190 
00195    std::string getQueryType() const;
00196 
00197    bool isExact() const;
00198 
00199    bool isQuery() const;
00200 
00201    bool isXPath() const;
00202 
00203    bool isDomain() const;
00204 
00208    int size() const;
00209 
00217    virtual std::string toXml(const std::string& extraOffset) const;
00218    virtual std::string toXml() const;
00219 
00224    virtual KeyData* getClone() const;
00225 
00230    std::string generateOid(const std::string& uniquePrefix) const;
00231    
00235    bool isGeneratedOid() const;
00236 };
00237 
00238 typedef org::xmlBlaster::util::ReferenceHolder<org::xmlBlaster::util::key::KeyData> KeyDataRef;
00239 
00240 }}}} // namespaces
00241 
00242 #endif
00243