added scheduler client module
This commit is contained in:
parent
97a0c86134
commit
885b2cc212
23 changed files with 3094 additions and 4 deletions
|
@ -0,0 +1,193 @@
|
|||
/*------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2004 Media Development Loan Fund
|
||||
|
||||
This file is part of the LiveSupport project.
|
||||
http://livesupport.campware.org/
|
||||
To report bugs, send an e-mail to bugs@campware.org
|
||||
|
||||
LiveSupport is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
LiveSupport is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LiveSupport; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Author : $Author: maroy $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/schedulerClient/include/LiveSupport/SchedulerClient/SchedulerClientFactory.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifndef LiveSupport_SchedulerClient_SchedulerClientFactory_h
|
||||
#define LiveSupport_SchedulerClient_SchedulerClientFactory_h
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error This is a C++ include file
|
||||
#endif
|
||||
|
||||
|
||||
/* ============================================================ include files */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "configure.h"
|
||||
#endif
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include "LiveSupport/Core/Configurable.h"
|
||||
#include "LiveSupport/SchedulerClient/SchedulerClientInterface.h"
|
||||
|
||||
|
||||
namespace LiveSupport {
|
||||
namespace SchedulerClient {
|
||||
|
||||
using namespace LiveSupport;
|
||||
using namespace LiveSupport::Core;
|
||||
|
||||
/* ================================================================ constants */
|
||||
|
||||
|
||||
/* =================================================================== macros */
|
||||
|
||||
|
||||
/* =============================================================== data types */
|
||||
|
||||
/**
|
||||
* The factory to create SchedulerClientInterface objects.
|
||||
*
|
||||
* This object has to be configured with an XML configuration element
|
||||
* called authenticationClientFactory. This element contains a child element
|
||||
* specifying and configuring the kind of AuthenticationClient that the
|
||||
* factory builds. This client is either a TestAuthenticationClient or
|
||||
* a WebAuthenticationClient, and the child element name is either
|
||||
* testAuthentication or webAuthentication, correspondingly.
|
||||
*
|
||||
* An authenticationClientFactory configuration element may look like
|
||||
* the following:
|
||||
*
|
||||
* <pre><code>
|
||||
* <authenticationClientFactory>
|
||||
* <webAuthentication>
|
||||
* ...
|
||||
* </webAuthentication>
|
||||
* </authenticationClientFactory>
|
||||
* </code></pre>
|
||||
*
|
||||
* For detais of the testAuthentication and webAuthentication elements, see the
|
||||
* documentation for the TestAuthenticationClient and WebAuthenticationClient
|
||||
* classes.
|
||||
*
|
||||
* The DTD for the above element is:
|
||||
*
|
||||
* <pre><code>
|
||||
* <!ELEMENT authenticationClientFactory (testAuthentication|
|
||||
* webAuthentication) >
|
||||
* </code></pre>
|
||||
*
|
||||
* @author $Author: maroy $
|
||||
* @version $Revision: 1.1 $
|
||||
* @see TestAuthenticationClient
|
||||
* @see WebAuthenticationClient
|
||||
*/
|
||||
class SchedulerClientFactory : virtual public Configurable
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The name of the configuration XML elmenent used by this object.
|
||||
*/
|
||||
static const std::string configElementNameStr;
|
||||
|
||||
/**
|
||||
* The singleton instance of this object.
|
||||
*/
|
||||
static Ptr<SchedulerClientFactory>::Ref singleton;
|
||||
|
||||
/**
|
||||
* The authentication client created by this factory.
|
||||
*/
|
||||
Ptr<SchedulerClientInterface>::Ref schedulerClient;
|
||||
|
||||
/**
|
||||
* The default constructor.
|
||||
*/
|
||||
SchedulerClientFactory(void) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
/**
|
||||
* A virtual destructor, as this class has virtual functions.
|
||||
*/
|
||||
virtual
|
||||
~SchedulerClientFactory(void) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the XML element this object expects
|
||||
* to be sent to a call to configure().
|
||||
*
|
||||
* @return the name of the expected XML configuration element.
|
||||
*/
|
||||
static const std::string
|
||||
getConfigElementName(void) throw ()
|
||||
{
|
||||
return configElementNameStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the singleton instance of this object.
|
||||
*
|
||||
* @return the singleton instance of this object.
|
||||
*/
|
||||
static Ptr<SchedulerClientFactory>::Ref
|
||||
getInstance() throw ();
|
||||
|
||||
/**
|
||||
* Configure the object based on the XML element supplied.
|
||||
*
|
||||
* @param element the XML element to configure the object from.
|
||||
* @exception std::invalid_argument if the supplied XML element
|
||||
* contains bad configuraiton information
|
||||
* @exception std::logic_error if the object has already
|
||||
* been configured, and can not be reconfigured.
|
||||
*/
|
||||
virtual void
|
||||
configure(const xmlpp::Element & element)
|
||||
throw (std::invalid_argument,
|
||||
std::logic_error);
|
||||
|
||||
/**
|
||||
* Return a scheduler client.
|
||||
*
|
||||
* @return the appropriate scheduler client, according to the
|
||||
* configuration of this factory.
|
||||
*/
|
||||
Ptr<SchedulerClientInterface>::Ref
|
||||
getSchedulerClient(void) throw ()
|
||||
{
|
||||
return schedulerClient;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/* ================================================= external data structures */
|
||||
|
||||
|
||||
/* ====================================================== function prototypes */
|
||||
|
||||
|
||||
} // namespace SchedulerClient
|
||||
} // namespace LiveSupport
|
||||
|
||||
#endif // LiveSupport_SchedulerClient_SchedulerClientFactory_h
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
/*------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2004 Media Development Loan Fund
|
||||
|
||||
This file is part of the LiveSupport project.
|
||||
http://livesupport.campware.org/
|
||||
To report bugs, send an e-mail to bugs@campware.org
|
||||
|
||||
LiveSupport is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
LiveSupport is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LiveSupport; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Author : $Author: maroy $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/schedulerClient/include/LiveSupport/SchedulerClient/SchedulerClientInterface.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifndef LiveSupport_SchedulerClient_SchedulerClientInterface_h
|
||||
#define LiveSupport_SchedulerClient_SchedulerClientInterface_h
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error This is a C++ include file
|
||||
#endif
|
||||
|
||||
|
||||
/* ============================================================ include files */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "configure.h"
|
||||
#endif
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include "LiveSupport/Core/Ptr.h"
|
||||
|
||||
namespace LiveSupport {
|
||||
namespace SchedulerClient {
|
||||
|
||||
using namespace LiveSupport::Core;
|
||||
|
||||
|
||||
/* ================================================================ constants */
|
||||
|
||||
|
||||
/* =================================================================== macros */
|
||||
|
||||
|
||||
/* =============================================================== data types */
|
||||
|
||||
/**
|
||||
* An interface to access the scheduler daemon as a client.
|
||||
*
|
||||
* @author $Author: maroy $
|
||||
* @version $Revision: 1.1 $
|
||||
*/
|
||||
class SchedulerClientInterface
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Return the version string for the scheduler this client
|
||||
* is connected to.
|
||||
*
|
||||
* @return the version string of the scheduler daemon.
|
||||
*/
|
||||
virtual Ptr<const std::string>::Ref
|
||||
getVersion(void) throw ()
|
||||
= 0;
|
||||
};
|
||||
|
||||
|
||||
/* ================================================= external data structures */
|
||||
|
||||
|
||||
/* ====================================================== function prototypes */
|
||||
|
||||
|
||||
} // namespace SchedulerClient
|
||||
} // namespace LiveSupport
|
||||
|
||||
#endif // LiveSupport_SchedulerClient_SchedulerClientInterface_h
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue