client/qos/PublishQos.cpp

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002 Name:      PublishQos.cpp
00003 Project:   xmlBlaster.org
00004 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
00005 ------------------------------------------------------------------------------*/
00006 
00007 #include <client/qos/PublishQos.h>
00008 #include <util/Global.h>
00009 
00010 using namespace org::xmlBlaster::util;
00011 using namespace org::xmlBlaster::util::qos;
00012 using namespace std;
00013 
00014 namespace org { namespace xmlBlaster { namespace client { namespace qos {
00015 
00016    PublishQos::PublishQos(Global& global)
00017       : ME("PublishQos"), global_(global), msgQosData_(global, "")
00018    {
00019       // deprecated
00020       //setLifeTime(global_.getProperty().getLongProperty("message.lifeTime", -1));
00021    }
00022 
00023    PublishQos::PublishQos(Global& global, const Destination& destination)
00024       : ME("PublishQos"), global_(global), msgQosData_(global, "")
00025    {
00026       addDestination(destination);
00027    }
00028 
00029    PublishQos::PublishQos(Global& global, bool persistent)
00030       : ME("PublishQos"), global_(global), msgQosData_(global, "")
00031    {
00032       setPersistent(persistent);
00033    }
00034 
00035    const MsgQosData& PublishQos::getData()
00036    {
00037       return msgQosData_;
00038    }
00039 
00040    PriorityEnum PublishQos::getPriority() const
00041    {
00042       return msgQosData_.getPriority();
00043    }
00044 
00051    void PublishQos::setPriority(PriorityEnum priority)
00052    {
00053       msgQosData_.setPriority(priority);
00054    }
00055 
00061    void PublishQos::setForceUpdate(bool force)
00062    {
00063       msgQosData_.setForceUpdate(force);
00064    }
00065 
00071    void PublishQos::setForceDestroy(bool forceDestroy)
00072    {
00073       msgQosData_.setForceDestroy(forceDestroy);
00074    }
00075 
00076    void PublishQos::setSubscribable(bool isSubcribeable)
00077    {
00078       msgQosData_.setSubscribable(isSubcribeable);
00079    }
00080 
00086    void PublishQos::setReadonly(bool readonly)
00087    {
00088       msgQosData_.setReadonly(readonly);
00089    }
00090 
00098    void PublishQos::setVolatile(bool volatileFlag)
00099    {
00100       msgQosData_.setVolatile(volatileFlag);
00101    }
00102 
00106    bool PublishQos::isVolatile()
00107    {
00108       return msgQosData_.isVolatile();
00109    }
00110 
00114    void PublishQos::setPersistent(bool persistent)
00115    {
00116       msgQosData_.setPersistent(persistent);
00117    }
00118 
00127    void PublishQos::setLifeTime(long lifeTime)
00128    {
00129       msgQosData_.setLifeTime(lifeTime);
00130    }
00131 
00138    void PublishQos::addDestination(const Destination& destination)
00139    {
00140       msgQosData_.addDestination(destination);
00141    }
00142 
00147    SessionNameRef PublishQos::getSender()
00148    {
00149       return msgQosData_.getSender();
00150    }
00151 
00152    /*
00153    void PublishQos::setSender(const SessionName& sender)
00154    {
00155       msgQosData_.setSender(sender);
00156    }
00157    */
00158 
00163    void PublishQos::setState(const string& state)
00164    {
00165       msgQosData_.setState(state);
00166    }
00167 
00168    string PublishQos::getState()
00169    {
00170       return msgQosData_.getState();
00171    }
00172 
00176    void PublishQos::setStateInfo(const string& stateInfo)
00177    {
00178       msgQosData_.setStateInfo(stateInfo);
00179    }
00180 
00181    string PublishQos::getStateInfo()
00182    {
00183       return msgQosData_.getStateInfo();
00184    }
00185 
00189    void PublishQos::setTopicProperty(const TopicProperty& topicProperty)
00190    {
00191       msgQosData_.setTopicProperty(topicProperty);
00192    }
00193 
00194    void PublishQos::setClientProperties(const QosData::ClientPropertyMap& cm)
00195    {
00196       msgQosData_.setClientProperties(cm);
00197    }
00198 
00199    const QosData::ClientPropertyMap& PublishQos::getClientProperties() const
00200    {
00201       return msgQosData_.getClientProperties();
00202    }
00203 
00208    string PublishQos::toString()
00209    {
00210       return toXml();
00211    }
00212 
00217    string PublishQos::toXml()
00218    {
00219       return msgQosData_.toXml();
00220    }
00221 
00222 }}}}