1 /*------------------------------------------------------------------------------
 2 Name:      QueryKeyData.h
 3 Project:   xmlBlaster.org
 4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
 5 ------------------------------------------------------------------------------*/
 6 
 7 /**
 8  * This class encapsulates the Message key information of query invocations. 
 9  * <p />
10  * <ul>
11  * <li>SubscribeKey Client side access facade</i>
12  * <li>UnSubscribeKey Client side access facade</i>
13  * <li>GetKey Client side access facade</i>
14  * <li>EraseKey Client side access facade</i>
15  * </ul>
16  * <p>
17  * For the xml representation see MsgKeySaxFactory.
18  * </p>
19  * @see org.xmlBlaster.util.key.QueryKeySaxFactory
20  */
21 
22 #ifndef _UTIL_KEY_QUERYKEYDATA_H
23 #define _UTIL_KEY_QUERYKEYDATA_H
24 
25 #include <util/key/KeyData.h>
26 #include <util/qos/AccessFilterQos.h>
27 #include <string>
28 #include <vector>
29 
30 namespace org { namespace xmlBlaster { namespace util { namespace key {
31 
32 typedef std::vector<org::xmlBlaster::util::qos::AccessFilterQos> AccessFilterVector;
33 
34 class Dll_Export QueryKeyData : public KeyData
35 {
36 protected:
37 
38    /**
39     * subscribe(), get() and cluster configuration keys may contain a filter rule
40     */
41    AccessFilterVector accessFilterVector_;
42 
43 public:
44 
45    /**
46     * Minimal constructor.
47     */
48    QueryKeyData(org::xmlBlaster::util::Global& global);
49    
50    QueryKeyData(org::xmlBlaster::util::Global& global, const std::string& query, const std::string& queryType);
51 
52    QueryKeyData(const QueryKeyData& key);
53 
54    std::string checkQueryType(const std::string& queryType);
55 
56    QueryKeyData& operator =(const QueryKeyData& key);
57 
58    void setOid(const std::string& oid);
59 
60    void setQueryType(const std::string& queryType);
61 
62    /**
63     * Your XPath query std::string. 
64     * @param str Your tags in ASCII XML syntax
65     */
66    void setQueryString(const std::string& tags);
67 
68    std::string getQueryString() const;
69 
70    /**
71     * Return the filters or array with size==0 if none is specified. 
72     * <p />
73     * For subscribe() and get() and cluster messages.
74     * @return never null
75     */
76    AccessFilterVector getAccessFilterVector() const;
77 
78    void addFilter(const org::xmlBlaster::util::qos::AccessFilterQos& qos);
79 
80    /**
81     * Dump state of this object into a XML ASCII std::string.
82     * <br>
83     * @param extraOffset indenting of tags for nice output
84     * @return internal state of the query as a XML ASCII std::string
85     */
86    virtual std::string toXml(const std::string& extraOffset) const;
87    virtual std::string toXml() const;
88 
89    /**
90     * Allocate a clone. 
91     * @return The caller needs to free it with 'delete'.
92     */
93    QueryKeyData* getClone() const;
94 };
95 
96 }}}} // namespace
97 
98 #endif


syntax highlighted by Code2HTML, v. 0.9.1