1 /*------------------------------------------------------------------------------
 2 Name:      EraseQos.h
 3 Project:   xmlBlaster.org
 4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
 5 ------------------------------------------------------------------------------*/
 6 
 7 /**
 8  * This class encapsulates the QoS of an erase() request. 
 9  * <p />
10  * A full specified <b>erase</b> qos could look like this:<br />
11  * <pre>
12  *&lt;qos>
13  *   &lt;!-- The subscribers shall not be notified when this message is destroyed -->
14  *   &lt;notify>false&lt;/notify> <!-- currently not implemented -->
15  *&lt;/qos>
16  * </pre>
17  * <p />
18  * see xmlBlaster/src/dtd/XmlQoS.xml
19  * @see org.xmlBlaster.util.qos.QueryQosData
20  * @see org.xmlBlaster.util.qos.QueryQosSaxFactory
21  * @see <a href="http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.erase.html">erase interface</a>
22  */
23 
24 #ifndef _CLIENT_QOS_ERASEQOS_H
25 #define _CLIENT_QOS_ERASEQOS_H
26 
27 #include <util/xmlBlasterDef.h>
28 #include <client/qos/UnSubscribeQos.h>
29 #include <util/qos/HistoryQos.h>
30 
31 namespace org { namespace xmlBlaster { namespace client { namespace qos {
32 
33 class Dll_Export EraseQos : public org::xmlBlaster::client::qos::UnSubscribeQos
34 {
35 public:
36    EraseQos(org::xmlBlaster::util::Global& global);
37 
38    EraseQos(org::xmlBlaster::util::Global& global, const org::xmlBlaster::util::qos::QueryQosData& data);
39 
40    EraseQos(const EraseQos& qos);
41 
42    EraseQos& operator =(const EraseQos& qos);
43 
44    /**
45     * Add a client property key and value. 
46     * @param name The unique key, a duplicate key will overwrite the old setting
47     * @param value "vector<unsigned char>" and "unsigned char *" types are treated as a blob
48     * @see ClientProperty::#ClientProperty
49     */
50    template <typename T_VALUE> void addClientProperty(
51             const std::string& name,
52             const T_VALUE& value,
53             const std::string& type="",
54             const std::string& encoding="") {
55       data_.addClientProperty(name, value, type, encoding);
56    }
57 
58    /**
59     * Defaults to false: If a topic is still referenced by callback messages
60     * it will be not erased immediately but we wait until all pending messages are delivered. 
61     * @see <a href="http://www.xmlBlaster.org/xmlBlaster/doc/requirements/engine.message.lifecycle.html">engine.message.lifecycle requirement</a>
62     */
63    void setForceDestroy(bool forceDestroy);
64 
65    void setHistoryQos(org::xmlBlaster::util::qos::HistoryQos historyQos);
66 
67    /*
68     * Mark the erase request to be persistent. 
69     * <p>
70     * NOTE: The request is only persistent in the client side
71     * queue if we are polling for xmlBlaster.
72     * </p>
73    void setPersistent(bool persistent);
74    */
75 
76    /*
77     * NOT IMPLEMENTED
78     * @param notify true - notify subscribers that message is erased (default is true)
79    void setWantNotify(bool notify);
80    */
81 };
82 
83 }}}} // namespace
84 
85 #endif


syntax highlighted by Code2HTML, v. 0.9.1