added scheduled event update / reread functionality

This commit is contained in:
maroy 2005-01-10 11:03:25 +00:00
parent 67910f4fcf
commit 9adcedb8a4
3 changed files with 31 additions and 5 deletions

View File

@ -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();
}

View File

@ -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;
* </code></pre>
*
* @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);
};

View File

@ -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 <string>
#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<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
scheduler->update();
XmlRpcTools::scheduleEntryIdToXmlRpcValue(scheduleEntryId, returnValue);
}