util/qos/storage/HistoryQueueProperty.cpp

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002 Name:      HistoryQueueProperty.cpp
00003 Project:   xmlBlaster.org
00004 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
00005 ------------------------------------------------------------------------------*/
00006 
00014 #include <util/qos/storage/HistoryQueueProperty.h>
00015 #include <util/lexical_cast.h>
00016 #include <util/Constants.h>
00017 #include <util/Global.h>
00018 
00019 
00020 
00021 using namespace org::xmlBlaster::util;
00022 using namespace std;
00023 
00024 namespace org { namespace xmlBlaster { namespace util { namespace qos { namespace storage {
00025 
00026 HistoryQueueProperty::HistoryQueueProperty(Global& global, const string& nodeId)
00027    : QueuePropertyBase(global, nodeId)
00028 {
00029    ME = "HistoryQueueProperty";
00030    setRelating(Constants::RELATING_HISTORY);
00031    QueuePropertyBase::initialize(Constants::RELATING_HISTORY);
00032 }
00033 
00034 HistoryQueueProperty::HistoryQueueProperty(const QueuePropertyBase& prop)
00035    : QueuePropertyBase(prop)
00036 {
00037 }
00038 
00039 HistoryQueueProperty& HistoryQueueProperty::operator =(const QueuePropertyBase& prop)
00040 {
00041    copy(prop);
00042    return *this;
00043 }
00044 
00045 string HistoryQueueProperty::getSettings()
00046 {
00047    string ret;
00048    ret += "type=" + getType() + " onOverflow=" + getOnOverflow() + " onFailure=" + getOnFailure() + " maxEntries=" + lexical_cast<std::string>(getMaxEntries());
00049    return ret;
00050 }
00051 
00052 bool HistoryQueueProperty::onOverflowDeadMessage()
00053 {
00054    if (Constants::ONOVERFLOW_DEADMESSAGE == getOnOverflow())
00055       return true;
00056    return false;
00057 }
00058 
00059 }}}}} // namespace
00060 
00061 #ifdef _XMLBLASTER_CLASSTEST
00062 
00063 
00064 using namespace std;
00065 using namespace org::xmlBlaster::util::qos::storage;
00066 
00067 int main(int args, char* argv[])
00068 {
00069    try {
00070 
00071       Global& glob = Global::getInstance();
00072       glob.initialize(args, argv);
00073       HistoryQueueProperty prop(glob, "");
00074 
00075       cout << prop.toXml() << endl;
00076    }
00077    catch (...) {
00078       cerr << "an exception occured in the main thread" << endl;
00079    }
00080 }
00081 
00082 #endif
00083 
00084 
00085 
00086