gnucomo_database::new_notification() retruns the id number of the
authorarjen <arjen>
Wed, 5 Feb 2003 09:33:17 +0000 (09:33 +0000)
committerarjen <arjen>
Wed, 5 Feb 2003 09:33:17 +0000 (09:33 +0000)
newly created notification record.

src/include/database.h
src/lib/database.cpp

index 05cd32e..4391b97 100644 (file)
@@ -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.
 ********************************
 **      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 <libpq++/pgdatabase.h>
 #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);
 };
 
index ce66552..4377025 100644 (file)
@@ -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
 **
 ********************************
 **      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 <AXE/date.h>
 
@@ -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;
 }