rhmessaging commits: r4518 - in store/trunk/cpp/lib: gen/qmf/com/redhat/rhm/store and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: tedross
Date: 2012-10-30 13:46:55 -0400 (Tue, 30 Oct 2012)
New Revision: 4518
Modified:
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/JournalImpl.h
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/MessageStoreImpl.h
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.h
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.h
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.h
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.h
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Package.h
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.h
Log:
Regenerated the qmf files. Updated the usage of the management interface to match
changes in the qpid code.
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2012-10-30 17:46:55 UTC (rev 4518)
@@ -70,7 +70,6 @@
_dlen(0),
_dtok(),
_external(false),
- _mgmtObject(0),
deleteCallback(onDelete)
{
getEventsFireEventsPtr = new GetEventsFireEvent(this, getEventsTimeout);
@@ -99,9 +98,9 @@
inactivityFireEventPtr->cancel();
free_read_buffers();
- if (_mgmtObject != 0) {
+ if (_mgmtObject.get() != 0) {
_mgmtObject->resourceDestroy();
- _mgmtObject = 0;
+ _mgmtObject.reset();
}
log(LOG_NOTICE, "Destroyed");
@@ -113,8 +112,7 @@
_agent = a;
if (_agent != 0)
{
- _mgmtObject = new _qmf::Journal
- (_agent, (qpid::management::Manageable*) this);
+ _mgmtObject = _qmf::Journal::shared_ptr(new _qmf::Journal(_agent, (qpid::management::Manageable*) this));
_mgmtObject->set_name(_jid);
_mgmtObject->set_directory(_jdir.dirname());
@@ -375,11 +373,11 @@
JournalImpl::enqueue_txn_data_record(const void* const data_buff, const size_t tot_data_len,
const size_t this_data_len, data_tok* dtokp, const std::string& xid, const bool transient)
{
- bool txn_incr = _mgmtObject != 0 ? _tmap.in_map(xid) : false;
+ bool txn_incr = _mgmtObject.get() != 0 ? _tmap.in_map(xid) : false;
handleIoResult(jcntl::enqueue_txn_data_record(data_buff, tot_data_len, this_data_len, dtokp, xid, transient));
- if (_mgmtObject != 0)
+ if (_mgmtObject.get() != 0)
{
if (!txn_incr) // If this xid was not in _tmap, it will be now...
_mgmtObject->inc_txn();
@@ -393,11 +391,11 @@
JournalImpl::enqueue_extern_txn_data_record(const size_t tot_data_len, data_tok* dtokp,
const std::string& xid, const bool transient)
{
- bool txn_incr = _mgmtObject != 0 ? _tmap.in_map(xid) : false;
+ bool txn_incr = _mgmtObject.get() != 0 ? _tmap.in_map(xid) : false;
handleIoResult(jcntl::enqueue_extern_txn_data_record(tot_data_len, dtokp, xid, transient));
- if (_mgmtObject != 0)
+ if (_mgmtObject.get() != 0)
{
if (!txn_incr) // If this xid was not in _tmap, it will be now...
_mgmtObject->inc_txn();
@@ -412,7 +410,7 @@
{
handleIoResult(jcntl::dequeue_data_record(dtokp, txn_coml_commit));
- if (_mgmtObject != 0)
+ if (_mgmtObject.get() != 0)
{
_mgmtObject->inc_dequeues();
_mgmtObject->inc_txnDequeues();
@@ -423,11 +421,11 @@
void
JournalImpl::dequeue_txn_data_record(data_tok* const dtokp, const std::string& xid, const bool txn_coml_commit)
{
- bool txn_incr = _mgmtObject != 0 ? _tmap.in_map(xid) : false;
+ bool txn_incr = _mgmtObject.get() != 0 ? _tmap.in_map(xid) : false;
handleIoResult(jcntl::dequeue_txn_data_record(dtokp, xid, txn_coml_commit));
- if (_mgmtObject != 0)
+ if (_mgmtObject.get() != 0)
{
if (!txn_incr) // If this xid was not in _tmap, it will be now...
_mgmtObject->inc_txn();
@@ -442,7 +440,7 @@
{
handleIoResult(jcntl::txn_abort(dtokp, xid));
- if (_mgmtObject != 0)
+ if (_mgmtObject.get() != 0)
{
_mgmtObject->dec_txn();
_mgmtObject->inc_txnAborts();
@@ -454,7 +452,7 @@
{
handleIoResult(jcntl::txn_commit(dtokp, xid));
- if (_mgmtObject != 0)
+ if (_mgmtObject.get() != 0)
{
_mgmtObject->dec_txn();
_mgmtObject->inc_txnCommits();
@@ -469,9 +467,9 @@
ifep->cancel();
jcntl::stop(block_till_aio_cmpl);
- if (_mgmtObject != 0) {
+ if (_mgmtObject.get() != 0) {
_mgmtObject->resourceDestroy();
- _mgmtObject = 0;
+ _mgmtObject.reset();
}
}
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/JournalImpl.h 2012-10-30 17:46:55 UTC (rev 4518)
@@ -100,7 +100,7 @@
bool _external;
qpid::management::ManagementAgent* _agent;
- qmf::com::redhat::rhm::store::Journal* _mgmtObject;
+ qmf::com::redhat::rhm::store::Journal::shared_ptr _mgmtObject;
DeleteCallback deleteCallback;
public:
@@ -207,7 +207,7 @@
virtual void wr_aio_cb(std::vector<mrg::journal::data_tok*>& dtokl);
virtual void rd_aio_cb(std::vector<u_int16_t>& pil);
- qpid::management::ManagementObject* GetManagementObject (void) const
+ qpid::management::ManagementObject::shared_ptr GetManagementObject (void) const
{ return _mgmtObject; }
qpid::management::Manageable::status_t ManagementMethod (uint32_t,
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2012-10-30 17:46:55 UTC (rev 4518)
@@ -75,7 +75,6 @@
isInit(false),
envPath(envpath),
timer(timer_),
- mgmtObject(0),
agent(0)
{}
@@ -226,7 +225,7 @@
agent = broker->getManagementAgent();
if (agent != 0) {
_qmf::Package packageInitializer(agent);
- mgmtObject = new _qmf::Store(agent, this, broker);
+ mgmtObject = _qmf::Store::shared_ptr(new _qmf::Store(agent, this, broker));
mgmtObject->set_location(storeDir);
mgmtObject->set_defaultInitialFileCount(numJrnlFiles);
@@ -403,9 +402,9 @@
}
}
- if (mgmtObject != 0) {
+ if (mgmtObject.get() != 0) {
mgmtObject->resourceDestroy();
- mgmtObject = 0;
+ mgmtObject.reset();
}
}
@@ -445,7 +444,7 @@
if (!tplStorePtr->is_ready()) {
journal::jdir::create_dir(getTplBaseDir());
tplStorePtr->initialize(tplNumJrnlFiles, false, 0, tplJrnlFsizeSblks, tplWCacheNumPages, tplWCachePgSizeSblks);
- if (mgmtObject != 0) mgmtObject->set_tplIsInitialized(true);
+ if (mgmtObject.get() != 0) mgmtObject->set_tplIsInitialized(true);
}
}
@@ -481,9 +480,9 @@
QPID_LOG(error, "Unknown error in MessageStoreImpl::~MessageStoreImpl()");
}
- if (mgmtObject != 0) {
+ if (mgmtObject.get() != 0) {
mgmtObject->resourceDestroy();
- mgmtObject = 0;
+ mgmtObject.reset();
}
}
@@ -708,7 +707,7 @@
//recover transactions:
for (txn_list::iterator i = prepared.begin(); i != prepared.end(); i++) {
const PreparedTransaction pt = *i;
- if (mgmtObject != 0) {
+ if (mgmtObject.get() != 0) {
mgmtObject->inc_tplTransactionDepth();
mgmtObject->inc_tplTxnPrepares();
}
@@ -1439,7 +1438,7 @@
tplStorePtr->dequeue_txn_data_record(txn.getDtok(), txn.getXid(), commit);
}
txn.complete(commit);
- if (mgmtObject != 0) {
+ if (mgmtObject.get() != 0) {
mgmtObject->dec_tplTransactionDepth();
if (commit)
mgmtObject->inc_tplTxnCommits();
@@ -1493,7 +1492,7 @@
ctxt->prepare(tplStorePtr.get());
// make sure all the data is written to disk before returning
ctxt->sync();
- if (mgmtObject != 0) {
+ if (mgmtObject.get() != 0) {
mgmtObject->inc_tplTransactionDepth();
mgmtObject->inc_tplTxnPrepares();
}
Modified: store/trunk/cpp/lib/MessageStoreImpl.h
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.h 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/MessageStoreImpl.h 2012-10-30 17:46:55 UTC (rev 4518)
@@ -154,7 +154,7 @@
const char* envPath;
qpid::sys::Timer& timer;
- qmf::com::redhat::rhm::store::Store* mgmtObject;
+ qmf::com::redhat::rhm::store::Store::shared_ptr mgmtObject;
qpid::management::ManagementAgent* agent;
@@ -363,7 +363,7 @@
void abort(qpid::broker::TransactionContext& ctxt);
- qpid::management::ManagementObject* GetManagementObject (void) const
+ qpid::management::ManagementObject::shared_ptr GetManagementObject (void) const
{ return mgmtObject; }
inline qpid::management::Manageable::status_t ManagementMethod (u_int32_t, qpid::management::Args&)
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.cpp 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.cpp 2012-10-30 17:46:55 UTC (rev 4518)
@@ -36,8 +36,8 @@
using qpid::management::Mutex;
using std::string;
-string EventCreated::packageName = string ("com.redhat.rhm.store");
-string EventCreated::eventName = string ("created");
+string EventCreated::PACKAGE_NAME = string ("com.redhat.rhm.store");
+string EventCreated::EVENT_NAME = string ("created");
uint8_t EventCreated::md5Sum[16] =
{0x6f,0x7,0x35,0xf6,0xdc,0xa3,0x18,0x29,0x23,0xf0,0x19,0x61,0xcc,0xe7,0x1c,0x5b};
@@ -59,7 +59,7 @@
void EventCreated::registerSelf(ManagementAgent* agent)
{
- agent->registerEvent(packageName, eventName, md5Sum, writeSchema);
+ agent->registerEvent(PACKAGE_NAME, EVENT_NAME, md5Sum, writeSchema);
}
void EventCreated::writeSchema (std::string& schema)
@@ -71,8 +71,8 @@
// Schema class header:
buf.putOctet (CLASS_KIND_EVENT);
- buf.putShortString (packageName); // Package Name
- buf.putShortString (eventName); // Event Name
+ buf.putShortString (PACKAGE_NAME); // Package Name
+ buf.putShortString (EVENT_NAME); // Event Name
buf.putBin128 (md5Sum); // Schema Hash
buf.putShort (3); // Argument Count
@@ -128,3 +128,8 @@
map["numFiles"] = ::qpid::types::Variant(numFiles);
}
+
+bool EventCreated::match(const std::string& evt, const std::string& pkg)
+{
+ return EVENT_NAME == evt && PACKAGE_NAME == pkg;
+}
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.h 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.h 2012-10-30 17:46:55 UTC (rev 4518)
@@ -25,6 +25,7 @@
// Please do not edit.
#include "qpid/management/ManagementEvent.h"
+#include "qmf/BrokerImportExport.h"
namespace qmf {
namespace com {
@@ -33,12 +34,10 @@
namespace store {
-class EventCreated : public ::qpid::management::ManagementEvent
+QPID_BROKER_CLASS_EXTERN class EventCreated : public ::qpid::management::ManagementEvent
{
private:
static void writeSchema (std::string& schema);
- static std::string packageName;
- static std::string eventName;
static uint8_t md5Sum[MD5_LEN];
const std::string& jrnlId;
@@ -47,20 +46,25 @@
public:
+ QPID_BROKER_EXTERN static std::string PACKAGE_NAME;
+ QPID_BROKER_EXTERN static std::string EVENT_NAME;
+
writeSchemaCall_t getWriteSchemaCall(void) { return writeSchema; }
- EventCreated(const std::string& _jrnlId,
+ QPID_BROKER_EXTERN EventCreated(const std::string& _jrnlId,
const uint32_t _fileSize,
const uint16_t _numFiles);
- ~EventCreated() {};
+ QPID_BROKER_EXTERN ~EventCreated() {};
static void registerSelf(::qpid::management::ManagementAgent* agent);
- std::string& getPackageName() const { return packageName; }
- std::string& getEventName() const { return eventName; }
+ std::string& getPackageName() const { return PACKAGE_NAME; }
+ std::string& getEventName() const { return EVENT_NAME; }
uint8_t* getMd5Sum() const { return md5Sum; }
uint8_t getSeverity() const { return 5; }
- void encode(std::string& buffer) const;
- void mapEncode(::qpid::types::Variant::Map& map) const;
+ QPID_BROKER_EXTERN void encode(std::string& buffer) const;
+ QPID_BROKER_EXTERN void mapEncode(::qpid::types::Variant::Map& map) const;
+
+ QPID_BROKER_EXTERN static bool match(const std::string& evt, const std::string& pkg);
};
}}}}}
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.cpp 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.cpp 2012-10-30 17:46:55 UTC (rev 4518)
@@ -36,8 +36,8 @@
using qpid::management::Mutex;
using std::string;
-string EventEnqThresholdExceeded::packageName = string ("com.redhat.rhm.store");
-string EventEnqThresholdExceeded::eventName = string ("enqThresholdExceeded");
+string EventEnqThresholdExceeded::PACKAGE_NAME = string ("com.redhat.rhm.store");
+string EventEnqThresholdExceeded::EVENT_NAME = string ("enqThresholdExceeded");
uint8_t EventEnqThresholdExceeded::md5Sum[16] =
{0x5b,0x1f,0xd4,0x87,0x9c,0xf6,0x1e,0xc3,0xdc,0x3e,0xc4,0x4,0x49,0xf3,0xa8,0xf3};
@@ -57,7 +57,7 @@
void EventEnqThresholdExceeded::registerSelf(ManagementAgent* agent)
{
- agent->registerEvent(packageName, eventName, md5Sum, writeSchema);
+ agent->registerEvent(PACKAGE_NAME, EVENT_NAME, md5Sum, writeSchema);
}
void EventEnqThresholdExceeded::writeSchema (std::string& schema)
@@ -69,8 +69,8 @@
// Schema class header:
buf.putOctet (CLASS_KIND_EVENT);
- buf.putShortString (packageName); // Package Name
- buf.putShortString (eventName); // Event Name
+ buf.putShortString (PACKAGE_NAME); // Package Name
+ buf.putShortString (EVENT_NAME); // Event Name
buf.putBin128 (md5Sum); // Schema Hash
buf.putShort (2); // Argument Count
@@ -118,3 +118,8 @@
map["what"] = ::qpid::types::Variant(what);
}
+
+bool EventEnqThresholdExceeded::match(const std::string& evt, const std::string& pkg)
+{
+ return EVENT_NAME == evt && PACKAGE_NAME == pkg;
+}
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.h 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.h 2012-10-30 17:46:55 UTC (rev 4518)
@@ -25,6 +25,7 @@
// Please do not edit.
#include "qpid/management/ManagementEvent.h"
+#include "qmf/BrokerImportExport.h"
namespace qmf {
namespace com {
@@ -33,12 +34,10 @@
namespace store {
-class EventEnqThresholdExceeded : public ::qpid::management::ManagementEvent
+QPID_BROKER_CLASS_EXTERN class EventEnqThresholdExceeded : public ::qpid::management::ManagementEvent
{
private:
static void writeSchema (std::string& schema);
- static std::string packageName;
- static std::string eventName;
static uint8_t md5Sum[MD5_LEN];
const std::string& jrnlId;
@@ -46,19 +45,24 @@
public:
+ QPID_BROKER_EXTERN static std::string PACKAGE_NAME;
+ QPID_BROKER_EXTERN static std::string EVENT_NAME;
+
writeSchemaCall_t getWriteSchemaCall(void) { return writeSchema; }
- EventEnqThresholdExceeded(const std::string& _jrnlId,
+ QPID_BROKER_EXTERN EventEnqThresholdExceeded(const std::string& _jrnlId,
const std::string& _what);
- ~EventEnqThresholdExceeded() {};
+ QPID_BROKER_EXTERN ~EventEnqThresholdExceeded() {};
static void registerSelf(::qpid::management::ManagementAgent* agent);
- std::string& getPackageName() const { return packageName; }
- std::string& getEventName() const { return eventName; }
+ std::string& getPackageName() const { return PACKAGE_NAME; }
+ std::string& getEventName() const { return EVENT_NAME; }
uint8_t* getMd5Sum() const { return md5Sum; }
uint8_t getSeverity() const { return 4; }
- void encode(std::string& buffer) const;
- void mapEncode(::qpid::types::Variant::Map& map) const;
+ QPID_BROKER_EXTERN void encode(std::string& buffer) const;
+ QPID_BROKER_EXTERN void mapEncode(::qpid::types::Variant::Map& map) const;
+
+ QPID_BROKER_EXTERN static bool match(const std::string& evt, const std::string& pkg);
};
}}}}}
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.cpp 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.cpp 2012-10-30 17:46:55 UTC (rev 4518)
@@ -36,8 +36,8 @@
using qpid::management::Mutex;
using std::string;
-string EventFull::packageName = string ("com.redhat.rhm.store");
-string EventFull::eventName = string ("full");
+string EventFull::PACKAGE_NAME = string ("com.redhat.rhm.store");
+string EventFull::EVENT_NAME = string ("full");
uint8_t EventFull::md5Sum[16] =
{0x23,0x4c,0x70,0xc1,0xb0,0xeb,0x4e,0x5d,0x72,0x37,0x56,0x60,0xc3,0x10,0x78,0x68};
@@ -57,7 +57,7 @@
void EventFull::registerSelf(ManagementAgent* agent)
{
- agent->registerEvent(packageName, eventName, md5Sum, writeSchema);
+ agent->registerEvent(PACKAGE_NAME, EVENT_NAME, md5Sum, writeSchema);
}
void EventFull::writeSchema (std::string& schema)
@@ -69,8 +69,8 @@
// Schema class header:
buf.putOctet (CLASS_KIND_EVENT);
- buf.putShortString (packageName); // Package Name
- buf.putShortString (eventName); // Event Name
+ buf.putShortString (PACKAGE_NAME); // Package Name
+ buf.putShortString (EVENT_NAME); // Event Name
buf.putBin128 (md5Sum); // Schema Hash
buf.putShort (2); // Argument Count
@@ -118,3 +118,8 @@
map["what"] = ::qpid::types::Variant(what);
}
+
+bool EventFull::match(const std::string& evt, const std::string& pkg)
+{
+ return EVENT_NAME == evt && PACKAGE_NAME == pkg;
+}
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.h 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.h 2012-10-30 17:46:55 UTC (rev 4518)
@@ -25,6 +25,7 @@
// Please do not edit.
#include "qpid/management/ManagementEvent.h"
+#include "qmf/BrokerImportExport.h"
namespace qmf {
namespace com {
@@ -33,12 +34,10 @@
namespace store {
-class EventFull : public ::qpid::management::ManagementEvent
+QPID_BROKER_CLASS_EXTERN class EventFull : public ::qpid::management::ManagementEvent
{
private:
static void writeSchema (std::string& schema);
- static std::string packageName;
- static std::string eventName;
static uint8_t md5Sum[MD5_LEN];
const std::string& jrnlId;
@@ -46,19 +45,24 @@
public:
+ QPID_BROKER_EXTERN static std::string PACKAGE_NAME;
+ QPID_BROKER_EXTERN static std::string EVENT_NAME;
+
writeSchemaCall_t getWriteSchemaCall(void) { return writeSchema; }
- EventFull(const std::string& _jrnlId,
+ QPID_BROKER_EXTERN EventFull(const std::string& _jrnlId,
const std::string& _what);
- ~EventFull() {};
+ QPID_BROKER_EXTERN ~EventFull() {};
static void registerSelf(::qpid::management::ManagementAgent* agent);
- std::string& getPackageName() const { return packageName; }
- std::string& getEventName() const { return eventName; }
+ std::string& getPackageName() const { return PACKAGE_NAME; }
+ std::string& getEventName() const { return EVENT_NAME; }
uint8_t* getMd5Sum() const { return md5Sum; }
uint8_t getSeverity() const { return 3; }
- void encode(std::string& buffer) const;
- void mapEncode(::qpid::types::Variant::Map& map) const;
+ QPID_BROKER_EXTERN void encode(std::string& buffer) const;
+ QPID_BROKER_EXTERN void mapEncode(::qpid::types::Variant::Map& map) const;
+
+ QPID_BROKER_EXTERN static bool match(const std::string& evt, const std::string& pkg);
};
}}}}}
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.cpp 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.cpp 2012-10-30 17:46:55 UTC (rev 4518)
@@ -36,8 +36,8 @@
using qpid::management::Mutex;
using std::string;
-string EventRecovered::packageName = string ("com.redhat.rhm.store");
-string EventRecovered::eventName = string ("recovered");
+string EventRecovered::PACKAGE_NAME = string ("com.redhat.rhm.store");
+string EventRecovered::EVENT_NAME = string ("recovered");
uint8_t EventRecovered::md5Sum[16] =
{0x23,0x28,0x44,0x5a,0x72,0xb0,0x1e,0xda,0x7d,0xff,0x0,0x9,0x1,0x6d,0xa8,0xd4};
@@ -67,7 +67,7 @@
void EventRecovered::registerSelf(ManagementAgent* agent)
{
- agent->registerEvent(packageName, eventName, md5Sum, writeSchema);
+ agent->registerEvent(PACKAGE_NAME, EVENT_NAME, md5Sum, writeSchema);
}
void EventRecovered::writeSchema (std::string& schema)
@@ -79,8 +79,8 @@
// Schema class header:
buf.putOctet (CLASS_KIND_EVENT);
- buf.putShortString (packageName); // Package Name
- buf.putShortString (eventName); // Event Name
+ buf.putShortString (PACKAGE_NAME); // Package Name
+ buf.putShortString (EVENT_NAME); // Event Name
buf.putBin128 (md5Sum); // Schema Hash
buf.putShort (7); // Argument Count
@@ -168,3 +168,8 @@
map["numTxnDeq"] = ::qpid::types::Variant(numTxnDeq);
}
+
+bool EventRecovered::match(const std::string& evt, const std::string& pkg)
+{
+ return EVENT_NAME == evt && PACKAGE_NAME == pkg;
+}
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.h 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.h 2012-10-30 17:46:55 UTC (rev 4518)
@@ -25,6 +25,7 @@
// Please do not edit.
#include "qpid/management/ManagementEvent.h"
+#include "qmf/BrokerImportExport.h"
namespace qmf {
namespace com {
@@ -33,12 +34,10 @@
namespace store {
-class EventRecovered : public ::qpid::management::ManagementEvent
+QPID_BROKER_CLASS_EXTERN class EventRecovered : public ::qpid::management::ManagementEvent
{
private:
static void writeSchema (std::string& schema);
- static std::string packageName;
- static std::string eventName;
static uint8_t md5Sum[MD5_LEN];
const std::string& jrnlId;
@@ -51,24 +50,29 @@
public:
+ QPID_BROKER_EXTERN static std::string PACKAGE_NAME;
+ QPID_BROKER_EXTERN static std::string EVENT_NAME;
+
writeSchemaCall_t getWriteSchemaCall(void) { return writeSchema; }
- EventRecovered(const std::string& _jrnlId,
+ QPID_BROKER_EXTERN EventRecovered(const std::string& _jrnlId,
const uint32_t _fileSize,
const uint16_t _numFiles,
const uint32_t _numEnq,
const uint32_t _numTxn,
const uint32_t _numTxnEnq,
const uint32_t _numTxnDeq);
- ~EventRecovered() {};
+ QPID_BROKER_EXTERN ~EventRecovered() {};
static void registerSelf(::qpid::management::ManagementAgent* agent);
- std::string& getPackageName() const { return packageName; }
- std::string& getEventName() const { return eventName; }
+ std::string& getPackageName() const { return PACKAGE_NAME; }
+ std::string& getEventName() const { return EVENT_NAME; }
uint8_t* getMd5Sum() const { return md5Sum; }
uint8_t getSeverity() const { return 5; }
- void encode(std::string& buffer) const;
- void mapEncode(::qpid::types::Variant::Map& map) const;
+ QPID_BROKER_EXTERN void encode(std::string& buffer) const;
+ QPID_BROKER_EXTERN void mapEncode(::qpid::types::Variant::Map& map) const;
+
+ QPID_BROKER_EXTERN static bool match(const std::string& evt, const std::string& pkg);
};
}}}}}
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp 2012-10-30 17:46:55 UTC (rev 4518)
@@ -7,9 +7,9 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
-//
+//
// http://www.apache.org/licenses/LICENSE-2.0
-//
+//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -29,8 +29,10 @@
#include "Journal.h"
#include "ArgsJournalExpand.h"
+
#include <iostream>
#include <sstream>
+#include <string.h>
using namespace qmf::com::redhat::rhm::store;
using qpid::management::ManagementAgent;
@@ -58,7 +60,7 @@
readPageSize = 0;
readPages = 0;
initialFileCount = 0;
- autoExpand = 0;
+ autoExpand = false;
currentFileCount = 0;
maxFileCount = 0;
dataFileSize = 0;
@@ -87,11 +89,13 @@
for (int idx = 0; idx < maxThreads; idx++)
perThreadStatsArray[idx] = 0;
+
}
Journal::~Journal ()
{
+
for (int idx = 0; idx < maxThreads; idx++)
if (perThreadStatsArray[idx] != 0)
delete perThreadStatsArray[idx];
@@ -741,7 +745,6 @@
}
-
void Journal::mapEncodeValues (::qpid::types::Variant::Map& _map,
bool includeProperties,
bool includeStatistics)
@@ -832,42 +835,68 @@
if ((_i = _map.find("queueRef")) != _map.end()) {
queueRef = _i->second;
+ } else {
+ queueRef = ::qpid::management::ObjectId();
}
if ((_i = _map.find("name")) != _map.end()) {
name = (_i->second).getString();
+ } else {
+ name = "";
}
if ((_i = _map.find("directory")) != _map.end()) {
directory = (_i->second).getString();
+ } else {
+ directory = "";
}
if ((_i = _map.find("baseFileName")) != _map.end()) {
baseFileName = (_i->second).getString();
+ } else {
+ baseFileName = "";
}
if ((_i = _map.find("writePageSize")) != _map.end()) {
writePageSize = _i->second;
+ } else {
+ writePageSize = 0;
}
if ((_i = _map.find("writePages")) != _map.end()) {
writePages = _i->second;
+ } else {
+ writePages = 0;
}
if ((_i = _map.find("readPageSize")) != _map.end()) {
readPageSize = _i->second;
+ } else {
+ readPageSize = 0;
}
if ((_i = _map.find("readPages")) != _map.end()) {
readPages = _i->second;
+ } else {
+ readPages = 0;
}
if ((_i = _map.find("initialFileCount")) != _map.end()) {
initialFileCount = _i->second;
+ } else {
+ initialFileCount = 0;
}
if ((_i = _map.find("autoExpand")) != _map.end()) {
autoExpand = _i->second;
+ } else {
+ autoExpand = false;
}
if ((_i = _map.find("currentFileCount")) != _map.end()) {
currentFileCount = _i->second;
+ } else {
+ currentFileCount = 0;
}
if ((_i = _map.find("maxFileCount")) != _map.end()) {
maxFileCount = _i->second;
+ } else {
+ maxFileCount = 0;
}
if ((_i = _map.find("dataFileSize")) != _map.end()) {
dataFileSize = _i->second;
+ } else {
+ dataFileSize = 0;
}
}
@@ -883,6 +912,8 @@
::qpid::types::Variant::Map::const_iterator _i;
if ((_i = inMap.find("by")) != inMap.end()) {
ioArgs.i_by = _i->second;
+ } else {
+ ioArgs.i_by = 0;
}
bool allow = coreObject->AuthorizeMethod(METHOD_EXPAND, ioArgs, userId);
if (allow)
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h 2012-10-30 17:46:55 UTC (rev 4518)
@@ -1,6 +1,6 @@
-#ifndef _MANAGEMENT_JOURNAL_
-#define _MANAGEMENT_JOURNAL_
+#ifndef _MANAGEMENT_COM_REDHAT_RHM_STORE_JOURNAL_
+#define _MANAGEMENT_COM_REDHAT_RHM_STORE_JOURNAL_
//
// Licensed to the Apache Software Foundation (ASF) under one
@@ -25,6 +25,8 @@
// Please do not edit.
#include "qpid/management/ManagementObject.h"
+#include "qmf/BrokerImportExport.h"
+#include <limits>
namespace qpid {
namespace management {
@@ -39,7 +41,7 @@
namespace store {
-class Journal : public ::qpid::management::ManagementObject
+QPID_BROKER_CLASS_EXTERN class Journal : public ::qpid::management::ManagementObject
{
private:
@@ -85,6 +87,8 @@
// Per-Thread Statistics
+
+ public:
struct PerThreadStats {
uint64_t enqueues;
uint64_t dequeues;
@@ -99,6 +103,7 @@
uint64_t readBusyFailures;
};
+ private:
struct PerThreadStats** perThreadStatsArray;
@@ -127,44 +132,50 @@
void aggregatePerThreadStats(struct PerThreadStats*) const;
public:
- static void writeSchema(std::string& schema);
- void mapEncodeValues(::qpid::types::Variant::Map& map,
- bool includeProperties=true,
- bool includeStatistics=true);
- void mapDecodeValues(const ::qpid::types::Variant::Map& map);
- void doMethod(std::string& methodName,
- const ::qpid::types::Variant::Map& inMap,
- ::qpid::types::Variant::Map& outMap,
- const std::string& userId);
- std::string getKey() const;
+ typedef boost::shared_ptr<Journal> shared_ptr;
- uint32_t writePropertiesSize() const;
- void readProperties(const std::string& buf);
- void writeProperties(std::string& buf) const;
- void writeStatistics(std::string& buf, bool skipHeaders = false);
- void doMethod(std::string& methodName,
- const std::string& inBuf,
- std::string& outBuf,
- const std::string& userId);
+ QPID_BROKER_EXTERN static void writeSchema(std::string& schema);
+ QPID_BROKER_EXTERN void mapEncodeValues(::qpid::types::Variant::Map& map,
+ bool includeProperties=true,
+ bool includeStatistics=true);
+ QPID_BROKER_EXTERN void mapDecodeValues(const ::qpid::types::Variant::Map& map);
+ QPID_BROKER_EXTERN void doMethod(std::string& methodName,
+ const ::qpid::types::Variant::Map& inMap,
+ ::qpid::types::Variant::Map& outMap,
+ const std::string& userId);
+ QPID_BROKER_EXTERN std::string getKey() const;
+ QPID_BROKER_EXTERN uint32_t writePropertiesSize() const;
+ QPID_BROKER_EXTERN void readProperties(const std::string& buf);
+ QPID_BROKER_EXTERN void writeProperties(std::string& buf) const;
+ QPID_BROKER_EXTERN void writeStatistics(std::string& buf, bool skipHeaders = false);
+ QPID_BROKER_EXTERN void doMethod(std::string& methodName,
+ const std::string& inBuf,
+ std::string& outBuf,
+ const std::string& userId);
+
writeSchemaCall_t getWriteSchemaCall() { return writeSchema; }
- Journal(::qpid::management::ManagementAgent* agent,
- ::qpid::management::Manageable* coreObject);
- ~Journal();
+ QPID_BROKER_EXTERN Journal(
+ ::qpid::management::ManagementAgent* agent,
+ ::qpid::management::Manageable* coreObject);
+ QPID_BROKER_EXTERN ~Journal();
+
void setReference(::qpid::management::ObjectId objectId) { queueRef = objectId; }
- static void registerSelf(::qpid::management::ManagementAgent* agent);
+ QPID_BROKER_EXTERN static void registerSelf(
+ ::qpid::management::ManagementAgent* agent);
+
std::string& getPackageName() const { return packageName; }
std::string& getClassName() const { return className; }
uint8_t* getMd5Sum() const { return md5Sum; }
// Method IDs
- static const uint32_t METHOD_EXPAND = 1;
+ QPID_BROKER_EXTERN static const uint32_t METHOD_EXPAND = 1;
// Accessor Methods
inline void set_queueRef (const ::qpid::management::ObjectId& val) {
@@ -457,6 +468,11 @@
instChanged = true;
}
+
+
+ struct PerThreadStats* getStatistics() { return getThreadStats(); }
+ void statisticsUpdated() { instChanged = true; }
+
};
}}}}}
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Package.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Package.h 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Package.h 2012-10-30 17:46:55 UTC (rev 4518)
@@ -25,6 +25,7 @@
// Please do not edit.
#include "qpid/management/ManagementAgent.h"
+#include "qmf/BrokerImportExport.h"
namespace qmf {
namespace com {
@@ -36,8 +37,8 @@
class Package
{
public:
- Package (::qpid::management::ManagementAgent* agent);
- ~Package () {}
+ QPID_BROKER_EXTERN Package (::qpid::management::ManagementAgent* agent);
+ QPID_BROKER_EXTERN ~Package () {}
};
}}}}}
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.cpp 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.cpp 2012-10-30 17:46:55 UTC (rev 4518)
@@ -7,9 +7,9 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
-//
+//
// http://www.apache.org/licenses/LICENSE-2.0
-//
+//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -28,8 +28,10 @@
#include "qpid/management/ManagementAgent.h"
#include "Store.h"
+
#include <iostream>
#include <sstream>
+#include <string.h>
using namespace qmf::com::redhat::rhm::store;
using qpid::management::ManagementAgent;
@@ -51,7 +53,7 @@
location = "";
defaultInitialFileCount = 0;
defaultDataFileSize = 0;
- tplIsInitialized = 0;
+ tplIsInitialized = false;
tplDirectory = "";
tplWritePageSize = 0;
tplWritePages = 0;
@@ -71,11 +73,13 @@
for (int idx = 0; idx < maxThreads; idx++)
perThreadStatsArray[idx] = 0;
+
}
Store::~Store ()
{
+
for (int idx = 0; idx < maxThreads; idx++)
if (perThreadStatsArray[idx] != 0)
delete perThreadStatsArray[idx];
@@ -485,7 +489,6 @@
}
-
void Store::mapEncodeValues (::qpid::types::Variant::Map& _map,
bool includeProperties,
bool includeStatistics)
@@ -546,36 +549,58 @@
if ((_i = _map.find("brokerRef")) != _map.end()) {
brokerRef = _i->second;
+ } else {
+ brokerRef = ::qpid::management::ObjectId();
}
if ((_i = _map.find("location")) != _map.end()) {
location = (_i->second).getString();
+ } else {
+ location = "";
}
if ((_i = _map.find("defaultInitialFileCount")) != _map.end()) {
defaultInitialFileCount = _i->second;
+ } else {
+ defaultInitialFileCount = 0;
}
if ((_i = _map.find("defaultDataFileSize")) != _map.end()) {
defaultDataFileSize = _i->second;
+ } else {
+ defaultDataFileSize = 0;
}
if ((_i = _map.find("tplIsInitialized")) != _map.end()) {
tplIsInitialized = _i->second;
+ } else {
+ tplIsInitialized = false;
}
if ((_i = _map.find("tplDirectory")) != _map.end()) {
tplDirectory = (_i->second).getString();
+ } else {
+ tplDirectory = "";
}
if ((_i = _map.find("tplWritePageSize")) != _map.end()) {
tplWritePageSize = _i->second;
+ } else {
+ tplWritePageSize = 0;
}
if ((_i = _map.find("tplWritePages")) != _map.end()) {
tplWritePages = _i->second;
+ } else {
+ tplWritePages = 0;
}
if ((_i = _map.find("tplInitialFileCount")) != _map.end()) {
tplInitialFileCount = _i->second;
+ } else {
+ tplInitialFileCount = 0;
}
if ((_i = _map.find("tplDataFileSize")) != _map.end()) {
tplDataFileSize = _i->second;
+ } else {
+ tplDataFileSize = 0;
}
if ((_i = _map.find("tplCurrentFileCount")) != _map.end()) {
tplCurrentFileCount = _i->second;
+ } else {
+ tplCurrentFileCount = 0;
}
}
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.h 2012-10-30 17:45:52 UTC (rev 4517)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.h 2012-10-30 17:46:55 UTC (rev 4518)
@@ -1,6 +1,6 @@
-#ifndef _MANAGEMENT_STORE_
-#define _MANAGEMENT_STORE_
+#ifndef _MANAGEMENT_COM_REDHAT_RHM_STORE_STORE_
+#define _MANAGEMENT_COM_REDHAT_RHM_STORE_STORE_
//
// Licensed to the Apache Software Foundation (ASF) under one
@@ -25,6 +25,8 @@
// Please do not edit.
#include "qpid/management/ManagementObject.h"
+#include "qmf/BrokerImportExport.h"
+#include <limits>
namespace qpid {
namespace management {
@@ -39,7 +41,7 @@
namespace store {
-class Store : public ::qpid::management::ManagementObject
+QPID_BROKER_CLASS_EXTERN class Store : public ::qpid::management::ManagementObject
{
private:
@@ -71,12 +73,15 @@
// Per-Thread Statistics
+
+ public:
struct PerThreadStats {
uint64_t tplTxnPrepares;
uint64_t tplTxnCommits;
uint64_t tplTxnAborts;
};
+ private:
struct PerThreadStats** perThreadStatsArray;
@@ -97,37 +102,43 @@
void aggregatePerThreadStats(struct PerThreadStats*) const;
public:
- static void writeSchema(std::string& schema);
- void mapEncodeValues(::qpid::types::Variant::Map& map,
- bool includeProperties=true,
- bool includeStatistics=true);
- void mapDecodeValues(const ::qpid::types::Variant::Map& map);
- void doMethod(std::string& methodName,
- const ::qpid::types::Variant::Map& inMap,
- ::qpid::types::Variant::Map& outMap,
- const std::string& userId);
- std::string getKey() const;
+ typedef boost::shared_ptr<Store> shared_ptr;
- uint32_t writePropertiesSize() const;
- void readProperties(const std::string& buf);
- void writeProperties(std::string& buf) const;
- void writeStatistics(std::string& buf, bool skipHeaders = false);
- void doMethod(std::string& methodName,
- const std::string& inBuf,
- std::string& outBuf,
- const std::string& userId);
+ QPID_BROKER_EXTERN static void writeSchema(std::string& schema);
+ QPID_BROKER_EXTERN void mapEncodeValues(::qpid::types::Variant::Map& map,
+ bool includeProperties=true,
+ bool includeStatistics=true);
+ QPID_BROKER_EXTERN void mapDecodeValues(const ::qpid::types::Variant::Map& map);
+ QPID_BROKER_EXTERN void doMethod(std::string& methodName,
+ const ::qpid::types::Variant::Map& inMap,
+ ::qpid::types::Variant::Map& outMap,
+ const std::string& userId);
+ QPID_BROKER_EXTERN std::string getKey() const;
+ QPID_BROKER_EXTERN uint32_t writePropertiesSize() const;
+ QPID_BROKER_EXTERN void readProperties(const std::string& buf);
+ QPID_BROKER_EXTERN void writeProperties(std::string& buf) const;
+ QPID_BROKER_EXTERN void writeStatistics(std::string& buf, bool skipHeaders = false);
+ QPID_BROKER_EXTERN void doMethod(std::string& methodName,
+ const std::string& inBuf,
+ std::string& outBuf,
+ const std::string& userId);
+
writeSchemaCall_t getWriteSchemaCall() { return writeSchema; }
- Store(::qpid::management::ManagementAgent* agent,
- ::qpid::management::Manageable* coreObject, ::qpid::management::Manageable* _parent);
- ~Store();
+ QPID_BROKER_EXTERN Store(
+ ::qpid::management::ManagementAgent* agent,
+ ::qpid::management::Manageable* coreObject, ::qpid::management::Manageable* _parent);
+ QPID_BROKER_EXTERN ~Store();
+
- static void registerSelf(::qpid::management::ManagementAgent* agent);
+ QPID_BROKER_EXTERN static void registerSelf(
+ ::qpid::management::ManagementAgent* agent);
+
std::string& getPackageName() const { return packageName; }
std::string& getClassName() const { return className; }
uint8_t* getMd5Sum() const { return md5Sum; }
@@ -287,6 +298,11 @@
instChanged = true;
}
+
+
+ struct PerThreadStats* getStatistics() { return getThreadStats(); }
+ void statisticsUpdated() { instChanged = true; }
+
};
}}}}}
12 years, 1 month
rhmessaging commits: r4517 - store/branches.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2012-10-30 13:45:52 -0400 (Tue, 30 Oct 2012)
New Revision: 4517
Added:
store/branches/qpid-0.18/
Log:
Create branch for qpid 0-18 release
12 years, 1 month
rhmessaging commits: r4516 - store/tags.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2012-10-30 13:45:11 -0400 (Tue, 30 Oct 2012)
New Revision: 4516
Added:
store/tags/qpid-0.18-release/
Log:
Create tag for qpid 0-18 release
12 years, 1 month
rhmessaging commits: r4515 - store/trunk/cpp/tests/python_tests.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2012-10-05 10:33:48 -0400 (Fri, 05 Oct 2012)
New Revision: 4515
Modified:
store/trunk/cpp/tests/python_tests/client_persistence.py
store/trunk/cpp/tests/python_tests/store_test.py
Log:
QPID-4347 - Checkin from kgiusti: Verifies that store/recovery of federation works
Modified: store/trunk/cpp/tests/python_tests/client_persistence.py
===================================================================
--- store/trunk/cpp/tests/python_tests/client_persistence.py 2012-09-25 20:44:25 UTC (rev 4514)
+++ store/trunk/cpp/tests/python_tests/client_persistence.py 2012-10-05 14:33:48 UTC (rev 4515)
@@ -132,8 +132,40 @@
broker = self.broker(store_args(), name="test_message_reject")
qmf = Qmf(broker)
assert qmf.queue_message_count("tmr") == 0
+
+ def test_route(self):
+ """ Test the recovery of a route (link and bridge objects."""
+ broker = self.broker(store_args(), name="test_route", expect=EXPECT_EXIT_OK)
+ qmf = Qmf(broker)
+ qmf_broker_obj = qmf.get_objects("broker")[0]
+
+ # create a "link"
+ link_args = {"host":"a.fake.host.com", "port":9999, "durable":True,
+ "authMechanism":"PLAIN", "username":"guest", "password":"guest",
+ "transport":"tcp"}
+ result = qmf_broker_obj.create("link", "test-link", link_args, False)
+ self.assertEqual(result.status, 0, result)
+ link = qmf.get_objects("link")[0]
+
+ # create bridge
+ bridge_args = {"link":"test-link", "src":"amq.direct", "dest":"amq.fanout",
+ "key":"my-key", "durable":True}
+ result = qmf_broker_obj.create("bridge", "test-bridge", bridge_args, False);
+ self.assertEqual(result.status, 0, result)
+ bridge = qmf.get_objects("bridge")[0]
+
+ broker.terminate()
+
+ # recover the link and bridge
+ broker = self.broker(store_args(), name="test_route")
+ qmf = Qmf(broker)
+ qmf_broker_obj = qmf.get_objects("broker")[0]
+ self.assertEqual(len(qmf.get_objects("link")), 1)
+ self.assertEqual(len(qmf.get_objects("bridge")), 1)
+
+
class AlternateExchangePropertyTests(StoreTest):
"""
Test the persistence of the Alternate Exchange property for exchanges and queues.
Modified: store/trunk/cpp/tests/python_tests/store_test.py
===================================================================
--- store/trunk/cpp/tests/python_tests/store_test.py 2012-09-25 20:44:25 UTC (rev 4514)
+++ store/trunk/cpp/tests/python_tests/store_test.py 2012-10-05 14:33:48 UTC (rev 4515)
@@ -109,6 +109,10 @@
def queue_empty(self, queue_name):
"""Check if a queue is empty (has no messages waiting)"""
return self.queue_message_count(queue_name) == 0
+
+ def get_objects(self, target_class, target_package="org.apache.qpid.broker"):
+ return self.__session.getObjects(_class=target_class, _package=target_package)
+
def close(self):
self.__session.delBroker(self.__broker)
12 years, 2 months