Implement data processing options (DbConnection::categories).

Refs #4782
This commit is contained in:
Gunnar Beutner 2013-10-29 16:08:52 +01:00
parent f39eff323e
commit 8c5bff3f75
3 changed files with 14 additions and 2 deletions

View File

@ -407,6 +407,9 @@ void IdoMysqlConnection::ExecuteQuery(const DbQuery& query)
ASSERT(query.Category != DbCatInvalid);
if ((query.Category & GetCategories()) == 0)
return;
if (!m_Connected)
return;

View File

@ -73,7 +73,7 @@ void DbConnection::ProgramStatusHandler(void)
DbQuery query1;
query1.Table = "programstatus";
query1.Type = DbQueryDelete;
query1.Type = DbCatProgramStatus;
query1.Category = DbCatProgramStatus;
query1.WhereCriteria = boost::make_shared<Dictionary>();
query1.WhereCriteria->Set("instance_id", 0); /* DbConnection class fills in real ID */
DbObject::OnQuery(query1);

View File

@ -1,3 +1,4 @@
#include "db_ido/dbquery.h"
#include "base/dynamicobject.h"
#include <boost/smart_ptr/make_shared.hpp>
@ -13,6 +14,14 @@ class DbConnection : DynamicObject
[config] Dictionary::Ptr cleanup {
default {{{ return boost::make_shared<Dictionary>(); }}}
};
[config] int categories {
default {{{
return DbCatConfig | DbCatState | DbCatAcknowledgement |
DbCatComment | DbCatDowntime | DbCatEventHandler | DbCatExternalCommand | DbCatFlapping |
DbCatLog | DbCatNotification | DbCatProgramStatus | DbCatRetention | DbCatStateHistory;
}}}
};
};
}
}