From 1017f78b0b96eba92b3983ec9f4012b48fc659b7 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 7 Feb 2013 21:08:16 +0100 Subject: [PATCH] Added dummy project files for the notification component. --- components/Makefile.am | 1 + components/notification/Makefile.am | 31 ++++ components/notification/i2-notification.h | 35 ++++ components/notification/notification.vcxproj | 167 ++++++++++++++++++ .../notification/notification.vcxproj.filters | 24 +++ .../notification/notificationcomponent.cpp | 52 ++++++ .../notification/notificationcomponent.h | 43 +++++ configure.ac | 1 + icinga-app/Makefile.am | 3 +- icinga2.sln | 5 + itl/standalone.conf | 1 + 11 files changed, 362 insertions(+), 1 deletion(-) create mode 100644 components/notification/Makefile.am create mode 100644 components/notification/i2-notification.h create mode 100644 components/notification/notification.vcxproj create mode 100644 components/notification/notification.vcxproj.filters create mode 100644 components/notification/notificationcomponent.cpp create mode 100644 components/notification/notificationcomponent.h diff --git a/components/Makefile.am b/components/Makefile.am index c34fc2e0a..f7acd23c3 100644 --- a/components/Makefile.am +++ b/components/Makefile.am @@ -7,4 +7,5 @@ SUBDIRS = \ compatido \ delegation \ demo \ + notification \ replication diff --git a/components/notification/Makefile.am b/components/notification/Makefile.am new file mode 100644 index 000000000..25f1929d3 --- /dev/null +++ b/components/notification/Makefile.am @@ -0,0 +1,31 @@ +## Process this file with automake to produce Makefile.in + +pkglib_LTLIBRARIES = \ + notification.la + +notification_la_SOURCES = \ + notificationcomponent.cpp \ + notificationcomponent.h \ + i2-notification.h + +notification_la_CPPFLAGS = \ + $(BOOST_CPPFLAGS) \ + -I${top_srcdir}/lib/base \ + -I${top_srcdir}/lib/config \ + -I${top_srcdir}/lib/remoting \ + -I${top_srcdir}/lib/icinga + +notification_la_LDFLAGS = \ + $(BOOST_LDFLAGS) \ + -module \ + -no-undefined \ + @RELEASE_INFO@ \ + @VERSION_INFO@ + +notification_la_LIBADD = \ + $(BOOST_SIGNALS_LIB) \ + $(BOOST_THREAD_LIB) \ + ${top_builddir}/lib/base/libbase.la \ + ${top_builddir}/lib/config/libconfig.la \ + ${top_builddir}/lib/remoting/libremoting.la \ + ${top_builddir}/lib/icinga/libicinga.la diff --git a/components/notification/i2-notification.h b/components/notification/i2-notification.h new file mode 100644 index 000000000..12d3b5eff --- /dev/null +++ b/components/notification/i2-notification.h @@ -0,0 +1,35 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#ifndef I2NOTIFICATION_H +#define I2NOTIFICATION_H + +/** + * @defgroup notification Notification component + * + * The notification component is in charge of sending downtime notifications. + */ + +#include +#include +#include + +#include "notificationcomponent.h" + +#endif /* I2NOTIFICATION_H */ diff --git a/components/notification/notification.vcxproj b/components/notification/notification.vcxproj new file mode 100644 index 000000000..825da9cba --- /dev/null +++ b/components/notification/notification.vcxproj @@ -0,0 +1,167 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {ebea7d10-66fb-4760-8aa8-81cd500d899e} + Win32Proj + notification + + + + DynamicLibrary + true + MultiByte + + + DynamicLibrary + true + MultiByte + + + DynamicLibrary + false + true + MultiByte + + + DynamicLibrary + false + true + MultiByte + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\lib\base;$(SolutionDir)\lib\remoting;$(SolutionDir)\lib\icinga;$(SolutionDir)\lib\config;$(IncludePath) + $(SolutionDir)$(Platform)\$(Configuration)\;$(LibraryPath) + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\lib\base;$(SolutionDir)\lib\remoting;$(SolutionDir)\lib\icinga;$(SolutionDir)\lib\config;$(IncludePath) + $(SolutionDir)$(Platform)\$(Configuration)\;$(LibraryPath) + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\lib\base;$(SolutionDir)\lib\remoting;$(SolutionDir)\lib\icinga;$(SolutionDir)\lib\config;$(IncludePath) + $(SolutionDir)$(Platform)\$(Configuration)\;$(LibraryPath) + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\lib\base;$(SolutionDir)\lib\remoting;$(SolutionDir)\lib\icinga;$(SolutionDir)\lib\config;$(IncludePath) + $(SolutionDir)$(Platform)\$(Configuration)\;$(LibraryPath) + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;DEMO_EXPORTS;%(PreprocessorDefinitions) + Level3 + false + true + + + Windows + true + base.lib;remoting.lib;icinga.lib;%(AdditionalDependencies) + + + + + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;DEMO_EXPORTS;%(PreprocessorDefinitions) + Level3 + false + true + + + Windows + true + base.lib;remoting.lib;icinga.lib;%(AdditionalDependencies) + + + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;DEMO_EXPORTS;%(PreprocessorDefinitions) + Level3 + false + true + + + Windows + true + true + true + base.lib;remoting.lib;icinga.lib;%(AdditionalDependencies) + + + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;DEMO_EXPORTS;%(PreprocessorDefinitions) + Level3 + false + true + + + Windows + true + true + true + base.lib;remoting.lib;icinga.lib;%(AdditionalDependencies) + + + + + + + + + + + + + diff --git a/components/notification/notification.vcxproj.filters b/components/notification/notification.vcxproj.filters new file mode 100644 index 000000000..dfa5af3bf --- /dev/null +++ b/components/notification/notification.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + Headerdateien + + + Headerdateien + + + + + {11a495bf-a705-4766-b3d3-9b5db266a6ef} + + + {1fb6337f-a17f-46ea-9316-2d800a94b53d} + + + + + Quelldateien + + + diff --git a/components/notification/notificationcomponent.cpp b/components/notification/notificationcomponent.cpp new file mode 100644 index 000000000..c2eb2542f --- /dev/null +++ b/components/notification/notificationcomponent.cpp @@ -0,0 +1,52 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#include "i2-notification.h" + +using namespace icinga; + +/** + * Starts the component. + */ +void NotificationComponent::Start(void) +{ + m_NotificationTimer = boost::make_shared(); + m_NotificationTimer->SetInterval(5); + m_NotificationTimer->OnTimerExpired.connect(boost::bind(&NotificationComponent::NotificationTimerHandler, this)); + m_NotificationTimer->Start(); +} + +/** + * Stops the component. + */ +void NotificationComponent::Stop(void) +{ +} + +/** + * Periodically sends a notification::HelloWorld message. + * + * @param - Event arguments for the timer. + */ +void NotificationComponent::NotificationTimerHandler(void) +{ + // TODO: implement +} + +EXPORT_COMPONENT(notification, NotificationComponent); diff --git a/components/notification/notificationcomponent.h b/components/notification/notificationcomponent.h new file mode 100644 index 000000000..dbb2d449c --- /dev/null +++ b/components/notification/notificationcomponent.h @@ -0,0 +1,43 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#ifndef NOTIFICATIONCOMPONENT_H +#define NOTIFICATIONCOMPONENT_H + +namespace icinga +{ + +/** + * @ingroup notification + */ +class NotificationComponent : public IComponent +{ +public: + virtual void Start(void); + virtual void Stop(void); + +private: + Timer::Ptr m_NotificationTimer; + + void NotificationTimerHandler(void); +}; + +} + +#endif /* NOTIFICATIONCOMPONENT_H */ diff --git a/configure.ac b/configure.ac index 792af6923..d39cf8a4d 100644 --- a/configure.ac +++ b/configure.ac @@ -100,6 +100,7 @@ components/compat/Makefile components/compatido/Makefile components/delegation/Makefile components/demo/Makefile +components/notification/Makefile components/replication/Makefile docs/Doxyfile docs/Makefile diff --git a/icinga-app/Makefile.am b/icinga-app/Makefile.am index bf8370c2e..cd7308502 100644 --- a/icinga-app/Makefile.am +++ b/icinga-app/Makefile.am @@ -35,7 +35,8 @@ icinga2_LDADD = \ -dlopen ${top_builddir}/components/compat/compat.la \ -dlopen ${top_builddir}/components/compatido/compatido.la \ -dlopen ${top_builddir}/components/delegation/delegation.la \ - -dlopen ${top_builddir}/components/demo/demo.la + -dlopen ${top_builddir}/components/demo/demo.la \ + -dlopen ${top_builddir}/components/notification/notification.la icinga2_DEPENDENCIES = \ ${top_builddir}/components/replication/replication.la diff --git a/icinga2.sln b/icinga2.sln index 5dc4954de..ca9bfa35f 100644 --- a/icinga2.sln +++ b/icinga2.sln @@ -16,6 +16,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo", "components\demo\dem {C1FC77E1-04A4-481B-A78B-2F7AF489C2F8} = {C1FC77E1-04A4-481B-A78B-2F7AF489C2F8} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "notification", "components\notification\notification.vcxproj", "{ebea7d10-66fb-4760-8aa8-81cd500d899e}" + ProjectSection(ProjectDependencies) = postProject + {C1FC77E1-04A4-481B-A78B-2F7AF489C2F8} = {C1FC77E1-04A4-481B-A78B-2F7AF489C2F8} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cJSON", "third-party\cJSON\cJSON.vcxproj", "{66BED474-C33F-48F9-90BA-BBCFEDC006B8}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mmatch", "third-party\mmatch\mmatch.vcxproj", "{19CBCE06-3F5C-479A-BD75-E2AB6215D345}" diff --git a/itl/standalone.conf b/itl/standalone.conf index 95d184f5c..53f88f1eb 100644 --- a/itl/standalone.conf +++ b/itl/standalone.conf @@ -19,3 +19,4 @@ local object Component "checker" {} local object Component "delegation" {} +local object Component "notification" {} -- 2.40.0