From 9adcedb8a4a93468c3aa0d58258405eaa0e5ca79 Mon Sep 17 00:00:00 2001 From: maroy Date: Mon, 10 Jan 2005 11:03:25 +0000 Subject: [PATCH] added scheduled event update / reread functionality --- .../products/scheduler/src/SchedulerDaemon.cxx | 12 +++++++++++- .../products/scheduler/src/SchedulerDaemon.h | 15 +++++++++++++-- .../scheduler/src/UploadPlaylistMethod.cxx | 9 +++++++-- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/livesupport/products/scheduler/src/SchedulerDaemon.cxx b/livesupport/products/scheduler/src/SchedulerDaemon.cxx index fe67c4d23..a33b1ae86 100644 --- a/livesupport/products/scheduler/src/SchedulerDaemon.cxx +++ b/livesupport/products/scheduler/src/SchedulerDaemon.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.15 $ + Version : $Revision: 1.16 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/SchedulerDaemon.cxx,v $ ------------------------------------------------------------------------------*/ @@ -383,3 +383,13 @@ SchedulerDaemon :: shutdown(void) throw (std::logic_error) } +/*------------------------------------------------------------------------------ + * Re-read the events from the event container. + *----------------------------------------------------------------------------*/ +void +SchedulerDaemon :: update (void) throw (std::logic_error) +{ + // TODO: check if we've been configured + eventScheduler->update(); +} + diff --git a/livesupport/products/scheduler/src/SchedulerDaemon.h b/livesupport/products/scheduler/src/SchedulerDaemon.h index b67821712..3fcdcb824 100644 --- a/livesupport/products/scheduler/src/SchedulerDaemon.h +++ b/livesupport/products/scheduler/src/SchedulerDaemon.h @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.13 $ + Version : $Revision: 1.14 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/SchedulerDaemon.h,v $ ------------------------------------------------------------------------------*/ @@ -158,7 +158,7 @@ using namespace LiveSupport::PlaylistExecutor; * * * @author $Author: maroy $ - * @version $Revision: 1.13 $ + * @version $Revision: 1.14 $ * @see ConnectionManagerFactory * @see AuthenticationClientFactory * @see StorageClientFactory @@ -385,6 +385,17 @@ class SchedulerDaemon : public Installable, */ virtual void shutdown (void) throw (std::logic_error); + + /** + * Re-read the scheduled events. + * Call this when the events in the schedule under the event container + * have changed. + * + * @exception std::logic_error if the daemon has not + * yet been configured. + */ + virtual void + update(void) throw (std::logic_error); }; diff --git a/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx b/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx index 19cb8386e..767c0e9f8 100644 --- a/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.12 $ + Version : $Revision: 1.13 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -42,11 +42,12 @@ #include +#include "LiveSupport/Core/XmlRpcTools.h" #include "LiveSupport/Storage/StorageClientInterface.h" #include "LiveSupport/Storage/StorageClientFactory.h" #include "ScheduleInterface.h" #include "ScheduleFactory.h" -#include "LiveSupport/Core/XmlRpcTools.h" +#include "SchedulerDaemon.h" #include "UploadPlaylistMethod.h" @@ -175,5 +176,9 @@ UploadPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, return; } + // tell the scheduler daemon to reload the scheduled events + Ptr::Ref scheduler = SchedulerDaemon::getInstance(); + scheduler->update(); + XmlRpcTools::scheduleEntryIdToXmlRpcValue(scheduleEntryId, returnValue); }