1 /*------------------------------------------------------------------------------
 2 Name:      MsgKeyBase.h
 3 Project:   xmlBlaster.org
 4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
 5 ------------------------------------------------------------------------------*/
 6 
 7 /**
 8  * Wrap a XML key for an unSubscribe() invocation. 
 9  * <p>
10  * See QueryKeySaxFactory for a syntax description of the allowed xml structure
11  * </p>
12  * This is the base class for the org::xmlBlaster::client::key::UpdateKey and the org::xmlBlaster::client::key::PublishKey. 
13  *
14  * @author <a href="mailto:xmlBlaster@marcelruff.info">Marcel Ruff</a>
15  * @author <a href="mailto:laghi@swissinfo.org">Michele Laghi</a>
16  */
17 
18 #ifndef _CLIENT_KEY_MSGKEYBASE_H
19 #define _CLIENT_KEY_MSGKEYBASE_H
20 
21 #include <util/key/MsgKeyData.h>
22 #include <util/I_Log.h>
23 
24 namespace org { namespace xmlBlaster { namespace client { namespace key {
25 
26 class Dll_Export MsgKeyBase
27 {
28 protected:
29    std::string  ME;
30    org::xmlBlaster::util::Global& global_;
31    org::xmlBlaster::util::I_Log&    log_;
32 
33    /**
34     * subscribe(), get() and cluster configuration keys may contain a filter rule
35     */
36    org::xmlBlaster::util::key::MsgKeyData msgKeyData_;
37 
38 public:
39 
40    /**
41     * Minimal constructor.
42     */
43    MsgKeyBase(org::xmlBlaster::util::Global& global);
44    
45    MsgKeyBase(org::xmlBlaster::util::Global& global, const org::xmlBlaster::util::key::MsgKeyData& data);
46 
47    MsgKeyBase(const MsgKeyBase& key);
48 
49    MsgKeyBase& operator =(const MsgKeyBase& key);
50 
51    const org::xmlBlaster::util::key::MsgKeyData& getData() const;
52 
53    org::xmlBlaster::util::Global& getGlobal() { return global_; }
54 
55    /**
56     *  @return The key oid or "" if not set (see org::xmlBlaster::util::key::MsgKeyData.getOid() which generates the oid if it was "").
57     */
58    std::string getOid() const;
59 
60    /**
61     * Find out which mime type (syntax) the content of the message has.
62     * @return The MIME type, for example "text/xml" in &lt;key oid='' contentMime='text/xml'><br />
63     *         default is "text/plain" if not set
64     * @see <a href="ftp://ftp.std.com/customers3/src/mail/istd::map-3.3/RFC1521.TXT">RFC1521 - MIME (Multipurpose Internet Mail Extensions)</a>
65     */
66    std::string getContentMime() const;
67 
68    /**
69     * Some further specifying information of the content.
70     * <p />
71     * For example the application version number the document in the content.<br />
72     * You may use this attribute for you own purposes.
73     * @return The MIME-extended info, for example<br />
74     *         "Version 1.1" in &lt;key oid='' contentMime='text/xml' contentMimeExtended='Version 1.1'><br />
75     *         or "" (empty std::string) if not known
76     */
77    std::string getContentMimeExtended() const;
78 
79    /**
80     * Access the domain setting
81     * @return A domain std::string or null
82     */
83    std::string getDomain() const;
84 
85    /**
86     * Dump state of this object into a XML ASCII std::string.
87     * <br>
88     * @param extraOffset indenting of tags for nice output
89     * @return internal state of the query as a XML ASCII std::string
90     */
91    std::string toXml(const std::string& extraOffset="") const;
92 
93 };
94 
95 }}}} // namespace
96 
97 #endif


syntax highlighted by Code2HTML, v. 0.9.1