LiveSupport::Scheduler::PostgresqlBackup Class Reference

#include <PostgresqlBackup.h>

Inheritance diagram for LiveSupport::Scheduler::PostgresqlBackup:

[legend]
Collaboration diagram for LiveSupport::Scheduler::PostgresqlBackup:

[legend]
List of all members.

Detailed Description

An object for creating and restoring combined schedule and storage backups.

This an implementation of the BackupInterface type. It stores the token used for the createBackupXxxx() functions in a PostgreSQL database.

This object has to be configured with a simple empty element, as the following:


      <postgresqlBackup/>
  

The DTD for the above element is:


  <!ELEMENT postgresqlBackup EMPTY >
  

Author:
Author
paul
Version:
Revision
2833

Definition at line 89 of file PostgresqlBackup.h.

Public Member Functions

 PostgresqlBackup (Ptr< ConnectionManagerInterface >::Ref connectionManager, Ptr< StorageClientInterface >::Ref storage, Ptr< ScheduleInterface >::Ref schedule) throw ()
 Construct a PostgresqlBackup.
virtual ~PostgresqlBackup (void) throw ()
 A virtual destructor, as this class has virtual functions.
virtual void configure (const xmlpp::Element &element) throw (std::invalid_argument, std::logic_error)
 Configure the object based on the XML element supplied.
virtual Ptr< Glib::ustring
>::Ref 
createBackupOpen (Ptr< SessionId >::Ref sessionId, Ptr< SearchCriteria >::Ref criteria, Ptr< ptime >::Ref fromTime, Ptr< ptime >::Ref toTime) throw (XmlRpcException)
 Start to create a backup by calling the storage, and also adding a backup of the schedule.
virtual AsyncState createBackupCheck (const Glib::ustring &token, Ptr< const Glib::ustring >::Ref &url, Ptr< const Glib::ustring >::Ref &path, Ptr< const Glib::ustring >::Ref &errorMessage) throw (XmlRpcException)
 Check the status of a storage backup.
virtual void createBackupClose (const Glib::ustring &token) throw (XmlRpcException)
 Close the storage backup process.
virtual void restoreBackup (Ptr< SessionId >::Ref sessionId, Ptr< const Glib::ustring >::Ref path) throw (XmlRpcException)
 Restore a schedule backup.

Static Public Member Functions

static const std::string getConfigElementName (void) throw ()
 Return the name of the XML element this object expects to be sent to a call to configure().


Constructor & Destructor Documentation

LiveSupport::Scheduler::PostgresqlBackup::PostgresqlBackup ( Ptr< ConnectionManagerInterface >::Ref  connectionManager,
Ptr< StorageClientInterface >::Ref  storage,
Ptr< ScheduleInterface >::Ref  schedule 
) throw () [inline]

Construct a PostgresqlBackup.

Parameters:
cm the connection manager the PostgresqlBackup will use to connect to the database.

Definition at line 171 of file PostgresqlBackup.h.

virtual LiveSupport::Scheduler::PostgresqlBackup::~PostgresqlBackup ( void   )  throw () [inline, virtual]

A virtual destructor, as this class has virtual functions.

Definition at line 186 of file PostgresqlBackup.h.


Member Function Documentation

void PostgresqlBackup::configure ( const xmlpp::Element &  element  )  throw (std::invalid_argument, std::logic_error) [virtual]

Configure the object based on the XML element supplied.

The supplied element is expected to be of the name returned by configElementName().

Parameters:
element the XML element to configure the object from.
Exceptions:
std::invalid_argument if the supplied XML element contains bad configuraiton information
std::logic_error if the object has already been configured, and can not be reconfigured.

Implements LiveSupport::Core::Configurable.

Definition at line 161 of file PostgresqlBackup.cxx.

AsyncState PostgresqlBackup::createBackupCheck ( const Glib::ustring &  token,
Ptr< const Glib::ustring >::Ref &  url,
Ptr< const Glib::ustring >::Ref &  path,
Ptr< const Glib::ustring >::Ref &  errorMessage 
) throw (XmlRpcException) [virtual]

Check the status of a storage backup.

Parameters:
token the identifier of this backup task.
url return parameter; if the status is “success”, it contains the URL of the created backup file.
path return parameter; if the status is “success”, it contains the local access path of the created backup file.
errorMessage return parameter; if the status is “fault”, it contains the fault string.
Returns:
the state of the backup process: one of pendingState, finishedState, or failedState.
Exceptions:
XmlRpcException if there is a problem with the XML-RPC call.
See also:
createBackupOpen

createBackupClose

Implements LiveSupport::Scheduler::BackupInterface.

Definition at line 230 of file PostgresqlBackup.cxx.

References getBackupStmt, and updateBackupStmt.

void PostgresqlBackup::createBackupClose ( const Glib::ustring &  token  )  throw (XmlRpcException) [virtual]

Close the storage backup process.

Frees up all resources allocated to the backup.

Parameters:
token the identifier of this backup task.
Exceptions:
XmlRpcException if there is a problem with the XML-RPC call.
See also:
createBackupOpen

createBackupCheck

Implements LiveSupport::Scheduler::BackupInterface.

Definition at line 343 of file PostgresqlBackup.cxx.

References deleteBackupStmt.

Ptr< Glib::ustring >::Ref PostgresqlBackup::createBackupOpen ( Ptr< SessionId >::Ref  sessionId,
Ptr< SearchCriteria >::Ref  criteria,
Ptr< ptime >::Ref  fromTime,
Ptr< ptime >::Ref  toTime 
) throw (XmlRpcException) [virtual]

Start to create a backup by calling the storage, and also adding a backup of the schedule.

To check if the backup procedure is still pending, call createBackupCheck() regularly. Make sure to close the backup by calling createBackupClose().

Parameters:
sessionId a valid session ID to use for accessing the storage
criteria the criteria to use for backing up the storage
fromTime entries are included in the schedule export starting from this time.
toTime entries as included in the schedule export up to but not including this time.
Returns:
a token, which can be used to query the backup process.
Exceptions:
XmlRpcException on XML-RPC issues.
See also:
createBackupCheck

createBackupClose

Implements LiveSupport::Scheduler::BackupInterface.

Definition at line 179 of file PostgresqlBackup.cxx.

References storeBackupStmt.

static const std::string LiveSupport::Scheduler::PostgresqlBackup::getConfigElementName ( void   )  throw () [inline, static]

Return the name of the XML element this object expects to be sent to a call to configure().

Returns:
the name of the expected XML configuration element.

Definition at line 197 of file PostgresqlBackup.h.

Referenced by LiveSupport::Scheduler::BackupFactory::configure().

void PostgresqlBackup::restoreBackup ( Ptr< SessionId >::Ref  sessionId,
Ptr< const Glib::ustring >::Ref  path 
) throw (XmlRpcException) [virtual]

Restore a schedule backup.

All playlist IDs contained in the backup should already be in the storage. If this is a combined backup, with both storage and schedule components, then restore this backup to the storage first, and then call this function.

Parameters:
sessionId a valid session ID to identify the user.
path the location of the archive to upload.
Exceptions:
XmlRpcException if there is an error.

Implements LiveSupport::Scheduler::BackupInterface.

Definition at line 401 of file PostgresqlBackup.cxx.

References scheduleExportFileName.


The documentation for this class was generated from the following files:
Generated on Sat Sep 22 02:00:41 2007 for Campcaster by  1.4.7