From: arjen Date: Wed, 5 Feb 2003 09:33:17 +0000 (+0000) Subject: gnucomo_database::new_notification() retruns the id number of the X-Git-Tag: V0_0_4~11 X-Git-Url: http://www.andromeda.nl/gitweb/?p=gnucomo.git;a=commitdiff_plain;h=67758fd813d8af156d2f61a76fba7e37b81f177f gnucomo_database::new_notification() retruns the id number of the newly created notification record. --- diff --git a/src/include/database.h b/src/include/database.h index 05cd32e..4391b97 100644 --- a/src/include/database.h +++ b/src/include/database.h @@ -8,7 +8,7 @@ *********************** ** FILE NAME : database.h ** SYSTEM NAME : -** VERSION NUMBER : $Revision: 1.4 $ +** VERSION NUMBER : $Revision: 1.5 $ ** ** DESCRIPTION : Classes to provide an abstract layer on the Gnucomo ** database. @@ -21,13 +21,17 @@ ******************************** ** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl ** CREATION DATE : Sep 10, 2002 -** LAST UPDATE : Jan 17, 2003 +** LAST UPDATE : Jan 31, 2003 ** MODIFICATIONS : **************************************************************************/ /***************************** $Log: database.h,v $ - Revision 1.4 2003-01-18 08:52:18 arjen + Revision 1.5 2003-02-05 09:33:17 arjen + gnucomo_database::new_notification() retruns the id number of the + newly created notification record. + + Revision 1.4 2003/01/18 08:52:18 arjen New C++ function: gnucomo_database::new_notification() Revision 1.3 2002/11/09 08:04:27 arjen @@ -41,7 +45,7 @@ *****************************/ -/* static const char *RCSID = "$Id: database.h,v 1.4 2003-01-18 08:52:18 arjen Exp $"; */ +/* static const char *RCSID = "$Id: database.h,v 1.5 2003-02-05 09:33:17 arjen Exp $"; */ #include #include "gnucomo_config.h" @@ -106,6 +110,6 @@ public: // Create a new notification. - void new_notification(String objectid, String issue, String remark); + String new_notification(String objectid, String issue, String remark); }; diff --git a/src/lib/database.cpp b/src/lib/database.cpp index ce66552..4377025 100644 --- a/src/lib/database.cpp +++ b/src/lib/database.cpp @@ -8,7 +8,7 @@ *********************** ** FILE NAME : database.cpp ** SYSTEM NAME : Gnucomo - Gnu Computer Monitoring -** VERSION NUMBER : $Revision: 1.5 $ +** VERSION NUMBER : $Revision: 1.6 $ ** ** DESCRIPTION : Implementation of the gnucomo database classes ** @@ -20,13 +20,17 @@ ******************************** ** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl ** CREATION DATE : Sep 10, 2002 -** LAST UPDATE : Jan 17, 2003 +** LAST UPDATE : Jan 31, 2003 ** MODIFICATIONS : **************************************************************************/ /***************************** $Log: database.cpp,v $ - Revision 1.5 2003-01-20 07:31:42 arjen + Revision 1.6 2003-02-05 09:33:42 arjen + gnucomo_database::new_notification() retruns the id number of the + newly created notification record. + + Revision 1.5 2003/01/20 07:31:42 arjen Removed some debug output. Revision 1.4 2003/01/18 08:52:32 arjen @@ -43,7 +47,7 @@ *****************************/ -static const char *RCSID = "$Id: database.cpp,v 1.5 2003-01-20 07:31:42 arjen Exp $"; +static const char *RCSID = "$Id: database.cpp,v 1.6 2003-02-05 09:33:42 arjen Exp $"; #include @@ -121,13 +125,17 @@ String gnucomo_database::find_host(const String hostname) return objectid; } -void gnucomo_database::new_notification(String objectid, String issue, String remark) +/* + * Create a new notification with an action_user and return the notification id + */ + +String gnucomo_database::new_notification(String objectid, String issue, String remark) { String qry; UTC now = Now(); String insertion; - String notif_id; + String notif_id(""); String issueid(""); @@ -165,8 +173,9 @@ void gnucomo_database::new_notification(String objectid, String issue, String re else { std::cerr << "Error inserting notification.\n"; - exit(1); } } + + return notif_id; }