1 /*------------------------------------------------------------------------------
 2 Name:      SubscribeReturnQos.cpp
 3 Project:   xmlBlaster.org
 4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
 5 ------------------------------------------------------------------------------*/
 6 
 7 /**
 8  * Data container handling of status returned by subscribe(), unSubscribe(), erase() and ping(). 
 9  * <p>
10  * This data holder is accessible through decorators, each of them allowing a specialized view on the data:
11  * </p>
12  * <ul>
13  * <li>SubscribeReturnQos Returned QoS of a subscribe() invocation (Client side)</i>
14  * <li>UnSubscribeReturnQos Returned QoS of a unSubscribe() invocation (Client side)</i>
15  * <li>EraseReturnQos Returned QoS of an erase() invocation (Client side)</i>
16  * </ul>
17  * <p>
18  * For the xml representation see StatusQosSaxFactory.
19  * </p>
20  * @see org.xmlBlaster.util.qos.StatusQosSaxFactory
21  * @see org.xmlBlaster.test.classtest.qos.StatusQosFactoryTest
22  * @author xmlBlaster@marcelruff.info
23  * @author michele@laghi.eu
24  */
25 
26 #include <client/qos/SubscribeReturnQos.h>
27 #include <util/Global.h>
28 
29 using namespace org::xmlBlaster::util;
30 using namespace org::xmlBlaster::util::qos;
31 using namespace std;
32 
33 namespace org { namespace xmlBlaster { namespace client { namespace qos {
34 
35    SubscribeReturnQos::SubscribeReturnQos(Global& global, const StatusQosData& data)
36       : ME("SubscribeReturnQos"), global_(global), data_(data)
37    {
38    }
39 
40    SubscribeReturnQos::SubscribeReturnQos(Global& global)
41       : ME("SubscribeReturnQos"), global_(global), data_(global)
42    {
43    }
44 
45    SubscribeReturnQos::SubscribeReturnQos(const SubscribeReturnQos& data)
46      : ME(data.ME), global_(data.global_), data_(data.data_)
47    {
48    }
49 
50    SubscribeReturnQos SubscribeReturnQos::operator =(const SubscribeReturnQos& other)
51    {
52       if (this != &other) data_ = other.data_;
53       return *this;
54    }
55 
56    string SubscribeReturnQos::getState() const
57    {
58       return data_.getState();
59    }
60 
61    string SubscribeReturnQos::getStateInfo() const
62    {
63       return data_.getStateInfo();
64    }
65 
66    string SubscribeReturnQos::getSubscriptionId() const
67    {
68       return data_.getSubscriptionId();
69    }
70 
71    string SubscribeReturnQos::toXml(const string& extraOffset) const
72    {
73       return data_.toXml(extraOffset);
74    }
75 
76    StatusQosData& SubscribeReturnQos::getData()
77    {
78       return data_;
79    }
80 
81    bool SubscribeReturnQos::isPersistent() const {
82       return data_.isPersistent();
83    }    
84 
85    bool SubscribeReturnQos::isFakedReturn() const {
86       return data_.getStateInfo().find(Constants::INFO_QUEUED) == 0;
87    }    
88 }}}} // namespace


syntax highlighted by Code2HTML, v. 0.9.1