now the scheduler only authenticates itself, if it is about to start

This commit is contained in:
maroy 2005-03-26 19:29:45 +00:00
parent 26899feffb
commit 75c97ccb8e
2 changed files with 22 additions and 14 deletions

View file

@ -22,7 +22,7 @@
Author : $Author: maroy $ Author : $Author: maroy $
Version : $Revision: 1.22 $ Version : $Revision: 1.23 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/SchedulerDaemon.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/SchedulerDaemon.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -178,8 +178,6 @@ SchedulerDaemon :: configure(const xmlpp::Element & element)
const xmlpp::Attribute * attribute; const xmlpp::Attribute * attribute;
// read in the user data // read in the user data
std::string login;
std::string password;
nodes = element.get_children(userConfigElementName); nodes = element.get_children(userConfigElementName);
if (nodes.size() < 1) { if (nodes.size() < 1) {
@ -263,15 +261,8 @@ SchedulerDaemon :: configure(const xmlpp::Element & element)
// do some initialization, using the configured objects // do some initialization, using the configured objects
authentication = acf->getAuthenticationClient(); authentication = acf->getAuthenticationClient();
try { audioPlayer = apf->getAudioPlayer();
sessionId = authentication->login(login, password); playLog = plf->getPlayLog();
} catch (XmlRpcException &e) {
// TODO: mark error
std::cerr << "authentication problem: " << e.what() << std::endl;
}
audioPlayer = apf->getAudioPlayer();
playLog = plf->getPlayLog();
Ptr<PlaylistEventContainer>::Ref eventContainer; Ptr<PlaylistEventContainer>::Ref eventContainer;
Ptr<time_duration>::Ref granularity; Ptr<time_duration>::Ref granularity;
@ -377,6 +368,13 @@ SchedulerDaemon :: uninstall(void) throw (std::exception)
void void
SchedulerDaemon :: startup (void) throw () SchedulerDaemon :: startup (void) throw ()
{ {
try {
sessionId = authentication->login(login, password);
} catch (XmlRpcException &e) {
// TODO: mark error
std::cerr << "authentication problem: " << e.what() << std::endl;
}
audioPlayer->initialize(); audioPlayer->initialize();
eventScheduler->start(); eventScheduler->start();
XmlRpcDaemon::startup(); XmlRpcDaemon::startup();

View file

@ -22,7 +22,7 @@
Author : $Author: maroy $ Author : $Author: maroy $
Version : $Revision: 1.17 $ Version : $Revision: 1.18 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/SchedulerDaemon.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/SchedulerDaemon.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -162,7 +162,7 @@ using namespace LiveSupport::PlaylistExecutor;
* </code></pre> * </code></pre>
* *
* @author $Author: maroy $ * @author $Author: maroy $
* @version $Revision: 1.17 $ * @version $Revision: 1.18 $
* @see ConnectionManagerFactory * @see ConnectionManagerFactory
* @see AuthenticationClientFactory * @see AuthenticationClientFactory
* @see StorageClientFactory * @see StorageClientFactory
@ -322,6 +322,16 @@ class SchedulerDaemon : public Installable,
*/ */
Ptr<ResetStorageMethod>::Ref resetStorageMethod; Ptr<ResetStorageMethod>::Ref resetStorageMethod;
/**
* The login to the authentication system.
*/
std::string login;
/**
* The password to the authentication system.
*/
std::string password;
/** /**
* Default constructor. * Default constructor.
*/ */