-DI2_CIB_BUILD \
$(BOOST_CPPFLAGS) \
-I${top_srcdir}/base \
+ -I${top_srcdir}/dyn \
-I${top_srcdir}/jsonrpc \
-I${top_srcdir}/icinga \
-I${top_srcdir}/third-party/popen-noshell
$(BOOST_SIGNALS_LIB) \
$(BOOST_THREAD_LIB) \
${top_builddir}/base/libbase.la \
+ ${top_builddir}/dyn/libdyn.la \
${top_builddir}/jsonrpc/libjsonrpc.la \
${top_builddir}/icinga/libicinga.la \
${top_builddir}/third-party/popen-noshell/libpopen_noshell.la
Component::Ptr component = app->GetComponent("cibsync");
if (!component) {
- ConfigObject::Ptr cibsyncComponentConfig = boost::make_shared<ConfigObject>("component", "cibsync");
- cibsyncComponentConfig->SetLocal(true);
- cibsyncComponentConfig->Commit();
+ ConfigItemBuilder::Ptr cb = boost::make_shared<ConfigItemBuilder>();
+ cb->SetType("component");
+ cb->SetName("cibsync");
+ cb->SetLocal(true);
+ ConfigItem::Ptr ci = cb->Compile();
+ ci->Commit();
}
}
* updates from all the other Icinga components.
*/
+#include <i2-dyn.h>
#include <i2-icinga.h>
#ifdef I2_CIB_BUILD
checker_la_CPPFLAGS = \
$(BOOST_CPPFLAGS) \
-I${top_srcdir}/base \
+ -I${top_srcdir}/dyn \
-I${top_srcdir}/jsonrpc \
-I${top_srcdir}/icinga \
-I${top_srcdir}/cib
$(BOOST_SIGNALS_LIB) \
$(BOOST_THREAD_LIB) \
${top_builddir}/base/libbase.la \
+ ${top_builddir}/dyn/libdyn.la \
${top_builddir}/jsonrpc/libjsonrpc.la \
${top_builddir}/icinga/libicinga.la \
${top_builddir}/cib/libcib.la
cibsync_la_CPPFLAGS = \
$(BOOST_CPPFLAGS) \
-I${top_srcdir}/base \
+ -I${top_srcdir}/dyn \
-I${top_srcdir}/jsonrpc \
-I${top_srcdir}/icinga \
-I${top_srcdir}/cib
$(BOOST_SIGNALS_LIB) \
$(BOOST_THREAD_LIB) \
${top_builddir}/base/libbase.la \
+ ${top_builddir}/dyn/libdyn.la \
${top_builddir}/jsonrpc/libjsonrpc.la \
${top_builddir}/icinga/libicinga.la \
${top_builddir}/cib/libcib.la
compat_la_CPPFLAGS = \
$(BOOST_CPPFLAGS) \
-I${top_srcdir}/base \
+ -I${top_srcdir}/dyn \
-I${top_srcdir}/jsonrpc \
-I${top_srcdir}/icinga \
-I${top_srcdir}/cib
$(BOOST_SIGNALS_LIB) \
$(BOOST_THREAD_LIB) \
${top_builddir}/base/libbase.la \
+ ${top_builddir}/dyn/libdyn.la \
${top_builddir}/jsonrpc/libjsonrpc.la \
${top_builddir}/icinga/libicinga.la \
${top_builddir}/cib/libcib.la
Dictionary::Iterator it;
for (it = serviceDescs->Begin(); it != serviceDescs->End(); it++) {
Variant desc = it->second;
- ConfigItem::Ptr serviceItem;
+
+ ConfigItemBuilder::Ptr builder = boost::make_shared<ConfigItemBuilder>(item->GetDebugInfo());
string name;
namebuf << item->GetName() << "-" << string(desc);
name = namebuf.str();
- serviceItem = boost::make_shared<ConfigItem>("service", name, item->GetDebugInfo());
- serviceItem->AddParent(desc);
-
- ExpressionList::Ptr exprl = boost::make_shared<ExpressionList>();
-
- Expression localExpr("__local", OperatorSet, 1, item->GetDebugInfo());
- exprl->AddExpression(localExpr);
-
- Expression abstractExpr("__abstract", OperatorSet, 0, item->GetDebugInfo());
- exprl->AddExpression(abstractExpr);
-
- Expression typeExpr("__type", OperatorSet, "service", item->GetDebugInfo());
- exprl->AddExpression(typeExpr);
-
- Expression nameExpr("__name", OperatorSet, name, item->GetDebugInfo());
- exprl->AddExpression(nameExpr);
-
- Expression hostExpr("host_name", OperatorSet, item->GetName(), item->GetDebugInfo());
- exprl->AddExpression(hostExpr);
+ builder->SetType("service");
+ builder->SetName(name);
- Expression aliasExpr("alias", OperatorSet, string(desc), item->GetDebugInfo());
- exprl->AddExpression(aliasExpr);
+ builder->AddParent(desc);
+ builder->AddExpression("host_name", OperatorSet, item->GetName());
+ builder->AddExpression("alias", OperatorSet, string(desc));
Dictionary::Ptr macros;
- if (host->GetProperty("macros", ¯os)) {
- Expression macrosExpr("macros", OperatorPlus, macros, item->GetDebugInfo());
- exprl->AddExpression(macrosExpr);
- }
+ if (host->GetProperty("macros", ¯os))
+ builder->AddExpression("macros", OperatorPlus, macros);
long checkInterval;
- if (host->GetProperty("check_interval", &checkInterval)) {
- Expression checkExpr("check_interval", OperatorSet, checkInterval, item->GetDebugInfo());
- exprl->AddExpression(checkExpr);
- }
+ if (host->GetProperty("check_interval", &checkInterval))
+ builder->AddExpression("check_interval", OperatorSet, checkInterval);
long retryInterval;
- if (host->GetProperty("retry_interval", &retryInterval)) {
- Expression retryExpr("retry_interval", OperatorSet, retryInterval, item->GetDebugInfo());
- exprl->AddExpression(retryExpr);
- }
+ if (host->GetProperty("retry_interval", &retryInterval))
+ builder->AddExpression("retry_interval", OperatorSet, retryInterval);
Dictionary::Ptr sgroups;
- if (host->GetProperty("servicegroups", &sgroups)) {
- Expression sgroupsExpr("servicegroups", OperatorPlus, sgroups, item->GetDebugInfo());
- exprl->AddExpression(sgroupsExpr);
- }
+ if (host->GetProperty("servicegroups", &sgroups))
+ builder->AddExpression("servicegroups", OperatorPlus, sgroups);
Dictionary::Ptr checkers;
- if (host->GetProperty("checkers", &checkers)) {
- Expression checkersExpr("checkers", OperatorSet, checkers, item->GetDebugInfo());
- exprl->AddExpression(checkersExpr);
- }
+ if (host->GetProperty("checkers", &checkers))
+ builder->AddExpression("checkers", OperatorSet, checkers);
- serviceItem->SetExpressionList(exprl);
+ ConfigItem::Ptr serviceItem = builder->Compile();
ConfigObject::Ptr service = serviceItem->Commit();
newServices->SetProperty(name, serviceItem);
delegation_la_CPPFLAGS = \
$(BOOST_CPPFLAGS) \
-I${top_srcdir}/base \
+ -I${top_srcdir}/dyn \
-I${top_srcdir}/jsonrpc \
-I${top_srcdir}/icinga \
-I${top_srcdir}/cib
$(BOOST_SIGNALS_LIB) \
$(BOOST_THREAD_LIB) \
${top_builddir}/base/libbase.la \
+ ${top_builddir}/dyn/libdyn.la \
${top_builddir}/jsonrpc/libjsonrpc.la \
${top_builddir}/icinga/libicinga.la \
${top_builddir}/cib/libcib.la
demo_la_CPPFLAGS = \
$(BOOST_CPPFLAGS) \
-I${top_srcdir}/base \
+ -I${top_srcdir}/dyn \
-I${top_srcdir}/jsonrpc \
-I${top_srcdir}/icinga
$(BOOST_SIGNALS_LIB) \
$(BOOST_THREAD_LIB) \
${top_builddir}/base/libbase.la \
+ ${top_builddir}/dyn/libdyn.la \
${top_builddir}/jsonrpc/libjsonrpc.la \
${top_builddir}/icinga/libicinga.la
discovery_la_CPPFLAGS = \
$(BOOST_CPPFLAGS) \
-I${top_srcdir}/base \
+ -I${top_srcdir}/dyn \
-I${top_srcdir}/jsonrpc \
-I${top_srcdir}/icinga \
-I${top_srcdir}/cib
$(BOOST_SIGNALS_LIB) \
$(BOOST_THREAD_LIB) \
${top_builddir}/base/libbase.la \
+ ${top_builddir}/dyn/libdyn.la \
${top_builddir}/jsonrpc/libjsonrpc.la \
${top_builddir}/icinga/libicinga.la \
${top_builddir}/cib/libcib.la
i2-dyn.h \
configitem.cpp \
configitem.h \
+ configitembuilder.cpp \
+ configitembuilder.h \
debuginfo.h \
expression.cpp \
expression.h \
int yyparse(ConfigCompiler *context);
static stack<ExpressionList::Ptr> m_ExpressionLists;
-static ConfigItem::Ptr m_Object;
+static ConfigItemBuilder::Ptr m_Item;
static bool m_Abstract;
static bool m_Local;
static Dictionary::Ptr m_Array;
static const yytype_uint16 yyrline[] =
{
0, 100, 100, 101, 104, 104, 107, 113, 118, 113,
- 148, 149, 152, 156, 162, 163, 166, 173, 174, 178,
- 177, 189, 190, 192, 193, 194, 197, 205, 219, 228,
- 229, 230, 231, 232, 238, 243, 247, 253, 254, 255,
- 262, 261, 273, 279, 280, 282, 284, 285
+ 138, 139, 142, 146, 152, 153, 156, 163, 164, 168,
+ 167, 179, 180, 182, 183, 184, 187, 195, 209, 218,
+ 219, 220, 221, 222, 228, 233, 237, 243, 244, 245,
+ 252, 251, 263, 269, 270, 272, 274, 275
};
#endif
/* Line 1806 of yacc.c */
#line 118 "config_parser.yy"
{
- m_Object = boost::make_shared<ConfigItem>((yyvsp[(4) - (5)].text), (yyvsp[(5) - (5)].text), yylloc);
- free((yyvsp[(4) - (5)].text));
- free((yyvsp[(5) - (5)].text));
+ m_Item = boost::make_shared<ConfigItemBuilder>(yylloc);
+ m_Item->SetType((yyvsp[(4) - (5)].text));
+ m_Item->SetName((yyvsp[(5) - (5)].text));
}
break;
delete (yyvsp[(8) - (8)].variant);
ExpressionList::Ptr exprl = dynamic_pointer_cast<ExpressionList>(exprl_object);
- Expression typeexpr("__type", OperatorSet, m_Object->GetType(), yylloc);
- exprl->AddExpression(typeexpr);
+ m_Item->AddExpressionList(exprl);
+ m_Item->SetLocal(m_Local);
+ m_Item->SetAbstract(m_Abstract);
- Expression nameexpr("__name", OperatorSet, m_Object->GetName(), yylloc);
- exprl->AddExpression(nameexpr);
-
- Expression abstractexpr("__abstract", OperatorSet, m_Abstract ? 1 : 0, yylloc);
- exprl->AddExpression(abstractexpr);
-
- Expression localexpr("__local", OperatorSet, m_Local ? 1 : 0, yylloc);
- exprl->AddExpression(localexpr);
-
- m_Object->SetExpressionList(exprl);
-
- context->AddObject(m_Object);
- m_Object.reset();
+ context->AddObject(m_Item->Compile());
+ m_Item.reset();
}
break;
case 12:
/* Line 1806 of yacc.c */
-#line 153 "config_parser.yy"
+#line 143 "config_parser.yy"
{
m_Abstract = true;
}
case 13:
/* Line 1806 of yacc.c */
-#line 157 "config_parser.yy"
+#line 147 "config_parser.yy"
{
m_Local = true;
}
case 16:
/* Line 1806 of yacc.c */
-#line 167 "config_parser.yy"
+#line 157 "config_parser.yy"
{
- m_Object->AddParent((yyvsp[(1) - (1)].text));
+ m_Item->AddParent((yyvsp[(1) - (1)].text));
free((yyvsp[(1) - (1)].text));
}
break;
case 19:
/* Line 1806 of yacc.c */
-#line 178 "config_parser.yy"
+#line 168 "config_parser.yy"
{
m_ExpressionLists.push(boost::make_shared<ExpressionList>());
}
case 20:
/* Line 1806 of yacc.c */
-#line 183 "config_parser.yy"
+#line 173 "config_parser.yy"
{
(yyval.variant) = new Variant(m_ExpressionLists.top());
m_ExpressionLists.pop();
case 26:
/* Line 1806 of yacc.c */
-#line 198 "config_parser.yy"
+#line 188 "config_parser.yy"
{
Expression expr((yyvsp[(1) - (3)].text), (yyvsp[(2) - (3)].op), *(yyvsp[(3) - (3)].variant), yylloc);
free((yyvsp[(1) - (3)].text));
case 27:
/* Line 1806 of yacc.c */
-#line 206 "config_parser.yy"
+#line 196 "config_parser.yy"
{
Expression subexpr((yyvsp[(3) - (6)].text), (yyvsp[(5) - (6)].op), *(yyvsp[(6) - (6)].variant), yylloc);
free((yyvsp[(3) - (6)].text));
case 28:
/* Line 1806 of yacc.c */
-#line 220 "config_parser.yy"
+#line 210 "config_parser.yy"
{
Expression expr((yyvsp[(1) - (1)].text), OperatorSet, (yyvsp[(1) - (1)].text), yylloc);
free((yyvsp[(1) - (1)].text));
case 33:
/* Line 1806 of yacc.c */
-#line 233 "config_parser.yy"
+#line 223 "config_parser.yy"
{
(yyval.op) = (yyvsp[(1) - (1)].op);
}
case 34:
/* Line 1806 of yacc.c */
-#line 239 "config_parser.yy"
+#line 229 "config_parser.yy"
{
(yyval.variant) = new Variant((yyvsp[(1) - (1)].text));
free((yyvsp[(1) - (1)].text));
case 35:
/* Line 1806 of yacc.c */
-#line 244 "config_parser.yy"
+#line 234 "config_parser.yy"
{
(yyval.variant) = new Variant((yyvsp[(1) - (1)].num));
}
case 36:
/* Line 1806 of yacc.c */
-#line 248 "config_parser.yy"
+#line 238 "config_parser.yy"
{
(yyval.variant) = new Variant();
}
case 39:
/* Line 1806 of yacc.c */
-#line 256 "config_parser.yy"
+#line 246 "config_parser.yy"
{
(yyval.variant) = (yyvsp[(1) - (1)].variant);
}
case 40:
/* Line 1806 of yacc.c */
-#line 262 "config_parser.yy"
+#line 252 "config_parser.yy"
{
m_Array = boost::make_shared<Dictionary>();
}
case 41:
/* Line 1806 of yacc.c */
-#line 267 "config_parser.yy"
+#line 257 "config_parser.yy"
{
(yyval.variant) = new Variant(m_Array);
m_Array.reset();
case 42:
/* Line 1806 of yacc.c */
-#line 274 "config_parser.yy"
+#line 264 "config_parser.yy"
{
m_Array->AddUnnamedProperty(*(yyvsp[(1) - (1)].variant));
delete (yyvsp[(1) - (1)].variant);
/* Line 1806 of yacc.c */
-#line 1795 "config_parser.cc"
+#line 1785 "config_parser.cc"
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
/* Line 2067 of yacc.c */
-#line 287 "config_parser.yy"
+#line 277 "config_parser.yy"
int yyparse(ConfigCompiler *context);
static stack<ExpressionList::Ptr> m_ExpressionLists;
-static ConfigItem::Ptr m_Object;
+static ConfigItemBuilder::Ptr m_Item;
static bool m_Abstract;
static bool m_Local;
static Dictionary::Ptr m_Array;
}
attributes T_OBJECT T_IDENTIFIER T_STRING
{
- m_Object = boost::make_shared<ConfigItem>($4, $5, yylloc);
- free($4);
- free($5);
+ m_Item = boost::make_shared<ConfigItemBuilder>(yylloc);
+ m_Item->SetType($4);
+ m_Item->SetName($5);
}
inherits_specifier expressionlist
{
delete $8;
ExpressionList::Ptr exprl = dynamic_pointer_cast<ExpressionList>(exprl_object);
- Expression typeexpr("__type", OperatorSet, m_Object->GetType(), yylloc);
- exprl->AddExpression(typeexpr);
+ m_Item->AddExpressionList(exprl);
+ m_Item->SetLocal(m_Local);
+ m_Item->SetAbstract(m_Abstract);
- Expression nameexpr("__name", OperatorSet, m_Object->GetName(), yylloc);
- exprl->AddExpression(nameexpr);
-
- Expression abstractexpr("__abstract", OperatorSet, m_Abstract ? 1 : 0, yylloc);
- exprl->AddExpression(abstractexpr);
-
- Expression localexpr("__local", OperatorSet, m_Local ? 1 : 0, yylloc);
- exprl->AddExpression(localexpr);
-
- m_Object->SetExpressionList(exprl);
-
- context->AddObject(m_Object);
- m_Object.reset();
+ context->AddObject(m_Item->Compile());
+ m_Item.reset();
}
;
inherits_item: T_STRING
{
- m_Object->AddParent($1);
+ m_Item->AddParent($1);
free($1);
}
;
using namespace icinga;
-ConfigItem::ConfigItem(const string& type, const string& name, const DebugInfo& debuginfo)
- : m_Type(type), m_Name(name), m_DebugInfo(debuginfo)
+ConfigItem::ConfigItem(const string& type, const string& name,
+ const ExpressionList::Ptr& exprl, const vector<string>& parents,
+ const DebugInfo& debuginfo)
+ : m_Type(type), m_Name(name), m_ExpressionList(exprl),
+ m_Parents(parents), m_DebugInfo(debuginfo)
{
}
return m_ExpressionList;
}
-void ConfigItem::SetExpressionList(const ExpressionList::Ptr& exprl)
-{
- m_ExpressionList = exprl;
-}
-
vector<string> ConfigItem::GetParents(void) const
{
return m_Parents;
}
-void ConfigItem::AddParent(const string& parent)
-{
- m_Parents.push_back(parent);
-}
-
void ConfigItem::CalculateProperties(Dictionary::Ptr dictionary) const
{
vector<string>::const_iterator it;
typedef ObjectMap<pair<string, string>, ConfigItem::Ptr> TNMap;
- ConfigItem(const string& type, const string& name, const DebugInfo& debuginfo);
+ ConfigItem(const string& type, const string& name,
+ const ExpressionList::Ptr& exprl, const vector<string>& parents,
+ const DebugInfo& debuginfo);
string GetType(void) const;
string GetName(void) const;
vector<string> GetParents(void) const;
- void AddParent(const string& parent);
ExpressionList::Ptr GetExpressionList(void) const;
- void SetExpressionList(const ExpressionList::Ptr& exprl);
void CalculateProperties(Dictionary::Ptr dictionary) const;
private:
string m_Type;
string m_Name;
- DebugInfo m_DebugInfo;
- vector<string> m_Parents;
+
ExpressionList::Ptr m_ExpressionList;
+ vector<string> m_Parents;
+ DebugInfo m_DebugInfo;
ConfigObject::WeakPtr m_ConfigObject;
--- /dev/null
+#include "i2-dyn.h"
+
+using namespace icinga;
+
+ConfigItemBuilder::ConfigItemBuilder(void)
+ : m_Local(false), m_Abstract(false),
+ m_ExpressionList(boost::make_shared<ExpressionList>())
+{
+ m_DebugInfo.FirstLine = 0;
+ m_DebugInfo.FirstColumn = 0;
+ m_DebugInfo.LastLine = 0;
+ m_DebugInfo.LastColumn = 0;
+}
+
+ConfigItemBuilder::ConfigItemBuilder(const DebugInfo& debugInfo)
+ : m_Local(false), m_Abstract(false),
+ m_ExpressionList(boost::make_shared<ExpressionList>())
+{
+ m_DebugInfo = debugInfo;
+}
+
+void ConfigItemBuilder::SetType(const string& type)
+{
+ m_Type = type;
+}
+
+void ConfigItemBuilder::SetName(const string& name)
+{
+ m_Name = name;
+}
+
+void ConfigItemBuilder::SetLocal(bool local)
+{
+ m_Local = local;
+}
+
+void ConfigItemBuilder::SetAbstract(bool abstract)
+{
+ m_Abstract = abstract;
+}
+
+void ConfigItemBuilder::AddParent(const string& parent)
+{
+ m_Parents.push_back(parent);
+}
+
+void ConfigItemBuilder::AddExpression(const Expression& expr)
+{
+ m_ExpressionList->AddExpression(expr);
+}
+
+void ConfigItemBuilder::AddExpression(const string& key, ExpressionOperator op, const Variant& value)
+{
+ Expression expr(key, op, value, m_DebugInfo);
+ AddExpression(expr);
+}
+
+void ConfigItemBuilder::AddExpressionList(const ExpressionList::Ptr& exprl)
+{
+ AddExpression("", OperatorExecute, exprl);
+}
+
+ConfigItem::Ptr ConfigItemBuilder::Compile(void)
+{
+ assert(!m_Type.empty());
+ assert(!m_Name.empty());
+
+ ExpressionList::Ptr exprl = boost::make_shared<ExpressionList>();
+
+ Expression execExpr("", OperatorExecute, m_ExpressionList, m_DebugInfo);
+ exprl->AddExpression(execExpr);
+
+ Expression typeExpr("__type", OperatorSet, m_Type, m_DebugInfo);
+ exprl->AddExpression(typeExpr);
+
+ Expression nameExpr("__name", OperatorSet, m_Name, m_DebugInfo);
+ exprl->AddExpression(nameExpr);
+
+ Expression localExpr("__local", OperatorSet, m_Local, m_DebugInfo);
+ exprl->AddExpression(localExpr);
+
+ Expression abstractExpr("__abstract", OperatorSet, m_Abstract, m_DebugInfo);
+ exprl->AddExpression(abstractExpr);
+
+ return boost::make_shared<ConfigItem>(m_Type, m_Name, exprl, m_Parents, m_DebugInfo);
+}
--- /dev/null
+#ifndef CONFIGITEMBUILDER_H
+#define CONFIGITEMBUILDER_H
+
+namespace icinga
+{
+
+class ConfigItemBuilder : public Object
+{
+public:
+ typedef shared_ptr<ConfigItemBuilder> Ptr;
+ typedef weak_ptr<ConfigItemBuilder> WeakPtr;
+
+ ConfigItemBuilder(void);
+ ConfigItemBuilder(const DebugInfo& debugInfo);
+
+ void SetType(const string& type);
+ void SetName(const string& name);
+ void SetLocal(bool local);
+ void SetAbstract(bool abstract);
+
+ void AddParent(const string& parent);
+
+ void AddExpression(const Expression& expr);
+ void AddExpression(const string& key, ExpressionOperator op, const Variant& value);
+ void AddExpressionList(const ExpressionList::Ptr& exprl);
+
+ ConfigItem::Ptr Compile(void);
+
+private:
+ string m_Type;
+ string m_Name;
+ bool m_Local;
+ bool m_Abstract;
+ vector<string> m_Parents;
+ ExpressionList::Ptr m_ExpressionList;
+ DebugInfo m_DebugInfo;
+};
+
+}
+
+#endif /* CONFIGITEMBUILDER */
union
{
- int LastColumn;
- int last_column;
+ int LastLine;
+ int last_line;
};
union
{
- int LastLine;
- int last_line;
+ int LastColumn;
+ int last_column;
};
};
Dictionary::Ptr dict;
switch (m_Operator) {
+ case OperatorExecute:
+ if (!valueExprl)
+ throw invalid_argument("Operand for OperatorExecute must be an ExpressionList.");
+
+ valueExprl->Execute(dictionary);
+
+ return;
+
case OperatorSet:
if (valueExprl) {
dict = boost::make_shared<Dictionary>();
break;
default:
- assert(!"Not yet implemented.");
-
- break;
+ throw runtime_error("Not yet implemented.");
}
dictionary->SetProperty(m_Key, newValue);
enum ExpressionOperator
{
+ OperatorExecute,
OperatorSet,
OperatorPlus,
OperatorMinus,
#include "expression.h"
#include "expressionlist.h"
#include "configitem.h"
+#include "configitembuilder.h"
#include "configcompiler.h"
#endif /* I2DYN_H */
-DI2_ICINGALAUNCHER_BUILD \
$(BOOST_CPPFLAGS) \
-I${top_srcdir}/base \
+ -I${top_srcdir}/dyn \
-I${top_srcdir}/jsonrpc \
-I${top_srcdir}/icinga \
-I${top_srcdir}
$(BOOST_SIGNALS_LIB) \
$(BOOST_THREAD_LIB) \
${top_builddir}/base/libbase.la \
+ ${top_builddir}/dyn/libdyn.la \
${top_builddir}/icinga/libicinga.la \
-dlopen ${top_builddir}/components/checker/checker.la \
-dlopen ${top_builddir}/components/cibsync/cibsync.la \
-DI2_ICINGA_BUILD \
$(BOOST_CPPFLAGS) \
-I${top_srcdir}/base \
+ -I${top_srcdir}/dyn \
-I${top_srcdir}/jsonrpc \
-I${top_srcdir}/cJSON \
-I${top_srcdir}
libicinga_la_LIBADD = \
$(BOOST_THREAD_LIB) \
- ${top_builddir}/jsonrpc/libjsonrpc.la \
- ${top_builddir}/base/libbase.la
+ ${top_builddir}/base/libbase.la \
+ ${top_builddir}/dyn/libdyn.la \
+ ${top_builddir}/jsonrpc/libjsonrpc.la
*/
#include <i2-base.h>
+#include <i2-dyn.h>
+#include <i2-dyn.h>
#include <i2-jsonrpc.h>
#include <set>
componentObjects->Start();
/* load convenience config component */
- ConfigObject::Ptr convenienceComponentConfig = boost::make_shared<ConfigObject>("component", "convenience");
+ ConfigItemBuilder::Ptr convenienceComponentConfig = boost::make_shared<ConfigItemBuilder>();
+ convenienceComponentConfig->SetType("component");
+ convenienceComponentConfig->SetName("convenience");
convenienceComponentConfig->SetLocal(true);
- convenienceComponentConfig->Commit();
+ convenienceComponentConfig->Compile()->Commit();
/* load config file */
- ConfigObject::Ptr fileComponentConfig = boost::make_shared<ConfigObject>("component", "configfile");
+ ConfigItemBuilder::Ptr fileComponentConfig = boost::make_shared<ConfigItemBuilder>();
+ fileComponentConfig->SetType("component");
+ fileComponentConfig->SetName("configfile");
fileComponentConfig->SetLocal(true);
- fileComponentConfig->SetProperty("configFilename", args[1]);
- fileComponentConfig->Commit();
+ fileComponentConfig->AddExpression("configFilename", OperatorSet, args[1]);
+ fileComponentConfig->Compile()->Commit();
ConfigObject::Ptr icingaConfig = ConfigObject::GetObject("application", "icinga");