1 /*------------------------------------------------------------------------------
 2 Name:      UpdateReturnQos.h
 3 Project:   xmlBlaster.org
 4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
 5 ------------------------------------------------------------------------------*/
 6 
 7 /**
 8  * Handling the returned QoS (quality of service) of an update() call. 
 9  * <p />
10  * If you are a Java client you can use this class to generate the QoS
11  * which you need to return in an update()
12  * <p />
13  * Example:
14  * <pre>
15  *   &lt;qos>
16  *     &lt;state id='OK'/>
17  *  &lt;/qos>
18  * </pre>
19  * @see org.xmlBlaster.test.classtest.qos.StatusQosFactoryTest
20  * @see <a href="http://www.xmlBlaster.org/xmlBlaster/doc/requirements/interface.update.html" target="others">the interface.update requirement</a>
21  */
22 
23 #ifndef _CLIENT_QOS_UPDATERETURNQOS_H
24 #define _CLIENT_QOS_UPDATERETURNQOS_H
25 
26 #include <util/qos/StatusQosData.h>
27 
28 
29 
30 
31 
32 namespace org { namespace xmlBlaster { namespace client { namespace qos {
33 
34 class Dll_Export UpdateReturnQos
35 {
36 private:
37    std::string        ME;
38    org::xmlBlaster::util::Global&       global_;
39    org::xmlBlaster::util::qos::StatusQosData data_;
40 
41 public:
42 
43    /**
44     * Constructs the specialized quality of service object for status informations,
45     * e.g. for a return of a subscribe() call
46     * <p>
47     * The state defaults to Constants::STATE_OK
48     * </p>
49     * @param The factory which knows how to serialize and parse me
50     */
51    UpdateReturnQos(org::xmlBlaster::util::Global& global, const org::xmlBlaster::util::qos::StatusQosData& data);
52 
53    UpdateReturnQos(const UpdateReturnQos& data);
54 
55    UpdateReturnQos operator =(const UpdateReturnQos& data);
56 
57    /**
58     * Set state of message on update().
59     * @return "OK", "ERROR" etc. See Constants::java
60     */
61    void setState(const std::string& state);
62 
63    /**
64     * Set state of message on update().
65     * @return The human readable info text
66     */
67    void setStateInfo(const std::string& stateInfo);
68 
69    /**
70     * Dump state of this object into a XML ASCII std::string.
71     * <br>
72     * @param extraOffset indenting of tags for nice output
73     * @return internal state of the status as a XML ASCII std::string
74     */
75    std::string toXml(const std::string& extraOffset="") const;
76 
77 };
78 
79 }}}} // namespace
80 
81 #endif


syntax highlighted by Code2HTML, v. 0.9.1