diff --git a/livesupport/src/modules/storageServer/var/GreenBox.php b/livesupport/src/modules/storageServer/var/GreenBox.php index c137ae733..58e11743c 100644 --- a/livesupport/src/modules/storageServer/var/GreenBox.php +++ b/livesupport/src/modules/storageServer/var/GreenBox.php @@ -1047,7 +1047,7 @@ class GreenBox extends BasicStor{ /* ===================================================== restore funcitons*/ /** - * Restore a beckup file + * Restore a backup file * * @param sessid : string - session id * @param filename : string - backup file path @@ -1081,9 +1081,7 @@ class GreenBox extends BasicStor{ * Close a restore procedure * * @param token : string - restore token - * @return status : hasharray - fields: - * token: string - restore token - * status: string - working | fault | success + * @return status : bool - is success */ function backupRestoreClose($token) { require_once 'Restore.php'; @@ -1091,6 +1089,97 @@ class GreenBox extends BasicStor{ if (PEAR::isError($rs)) return $rs; return $rs->closeRestore($token); } + /*===================================================== scheduler methods */ + + /** + * Open schedule import + * + * @param filename : string - import file + * @return status : hasharray - fields: + * token: string - schedule import token + */ + function scheduleImportOpen($sessid,$filename) { + require_once 'Schedule.php'; + $sc = new Schedule($this); + if (PEAR::isError($sc)) return $sc; + return $sc->openImport($sessid,$filename); + } + + /** + * Check status of schedule import + * + * @param token : string - schedule import token + * @return status : hasharray - fields: + * token: string - schedule import token + * status: string - working | fault | success + */ + function scheduleImportCheck($token) { + require_once 'Schedule.php'; + $sc = new Schedule($this); + if (PEAR::isError($sc)) return $sc; + return $sc->checkImport($token); + } + + /** + * Close schedule import + * + * @param token : string - schedule import token + * @return status : hasharray - fields: + * token: string - schedule import token + */ + function scheduleImportClose($token) { + require_once 'Schedule.php'; + $sc = new Schedule($this); + if (PEAR::isError($sc)) return $sc; + return $sc->closeImport($token); + } + + /** + * Open schedule export + * + * @param sessid : string - schedule import token + * @param criteria : struct - see search criteria + * @param fromTime : time - begining time of schedule export + * @param toTime : time - ending time of schedule export + * @return status : hasharray - fields: + * token: string - schedule export token + */ + function scheduleExportOpen($sessid,$criteria,$fromTime,$toTime) { + require_once 'Schedule.php'; + $sc = new Schedule($this); + if (PEAR::isError($sc)) return $sc; + return $sc->openExport($sessid,$criteria,$fromTime,$toTime); + } + + /** + * Check status of schedule export + * + * @param token : string - schedule export token + * @return status : hasharray - fields: + * token: string - schedule export token + * status: string - working | fault | success + * file : string - exported file location (available if status is success) + */ + function scheduleExportCheck($token) { + require_once 'Schedule.php'; + $sc = new Schedule($this); + if (PEAR::isError($sc)) return $sc; + return $sc->checkExport($token); + } + + /** + * Close schedule export + * + * @param token : string - schedule export token + * @return status : hasharray - fields: + * token: string - schedule export token + */ + function scheduleExportClose($token) { + require_once 'Schedule.php'; + $sc = new Schedule($this); + if (PEAR::isError($sc)) return $sc; + return $sc->closeExport($token); + } /* ============================================== methods for preferences */ diff --git a/livesupport/src/modules/storageServer/var/LocStor.php b/livesupport/src/modules/storageServer/var/LocStor.php index 02eb2d9b8..635c728be 100644 --- a/livesupport/src/modules/storageServer/var/LocStor.php +++ b/livesupport/src/modules/storageServer/var/LocStor.php @@ -1054,6 +1054,97 @@ class LocStor extends BasicStor{ return $rs->closeRestore($token); } + /*===================================================== scheduler methods */ + + /** + * Open schedule import + * + * @param filename : string - import file + * @return status : hasharray - fields: + * token: string - schedule import token + */ + function scheduleImportOpen($sessid,$filename) { + require_once 'Schedule.php'; + $sc = new Schedule($this); + if (PEAR::isError($sc)) return $sc; + return $sc->openImport($sessid,$filename); + } + + /** + * Check status of schedule import + * + * @param token : string - schedule import token + * @return status : hasharray - fields: + * token: string - schedule import token + * status: string - working | fault | success + */ + function scheduleImportCheck($token) { + require_once 'Schedule.php'; + $sc = new Schedule($this); + if (PEAR::isError($sc)) return $sc; + return $sc->checkImport($token); + } + + /** + * Close schedule import + * + * @param token : string - schedule import token + * @return hasharray - fields: + * token: string - schedule import token + */ + function scheduleImportClose($token) { + require_once 'Schedule.php'; + $sc = new Schedule($this); + if (PEAR::isError($sc)) return $sc; + return $sc->closeImport($token); + } + + /** + * Open schedule export + * + * @param sessid : string - schedule import token + * @param criteria : struct - see search criteria + * @param fromTime : time - begining time of schedule export + * @param toTime : time - ending time of schedule export + * @return status : hasharray - fields: + * token: string - schedule export token + */ + function scheduleExportOpen($sessid,$criteria,$fromTime,$toTime) { + require_once 'Schedule.php'; + $sc = new Schedule($this); + if (PEAR::isError($sc)) return $sc; + return $sc->openExport($sessid,$criteria,$fromTime,$toTime); + } + + /** + * Check status of schedule export + * + * @param token : string - schedule export token + * @return status : hasharray - fields: + * token: string - schedule export token + * status: string - working | fault | success + */ + function scheduleExportCheck($token) { + require_once 'Schedule.php'; + $sc = new Schedule($this); + if (PEAR::isError($sc)) return $sc; + return $sc->checkExport($token); + } + + /** + * Close schedule export + * + * @param token : string - schedule export token + * @return status : hasharray - fields: + * token: string - schedule export token + */ + function scheduleExportClose($token) { + require_once 'Schedule.php'; + $sc = new Schedule($this); + if (PEAR::isError($sc)) return $sc; + return $sc->closeExport($token); + } + /*===================================================== auxiliary methods */ /** * Dummy method - only returns livesupport version diff --git a/livesupport/src/modules/storageServer/var/Schedule.php b/livesupport/src/modules/storageServer/var/Schedule.php new file mode 100644 index 000000000..bfcdb3228 --- /dev/null +++ b/livesupport/src/modules/storageServer/var/Schedule.php @@ -0,0 +1,104 @@ + 'abcdef0123456789'); + } + + /** + * Check status of schedule import + * + * @param token : string - schedule import token + * @return status : hasharray - fields: + * token: string - schedule import token + * status: string - working | fault | success + */ + function checkImport($token) { + if ($token == 'abcdef0123456789') { + return array( + 'token' => $token, + 'status' => 'working' + ); + } else { + return PEAR::raiseError('Schedule::checkImport: invalid token'); + } + } + + /** + * Close schedule import + * + * @param token : string - schedule import token + * @return status : hasharray - fields: + * token: string - schedule import token + */ + function closeImport($token) { + if ($token == 'abcdef0123456789') { + return array( + 'token' => $token + ); + } else { + return PEAR::raiseError('Schedule::closeImport: invalid token'); + } + } + + /** + * Open schedule export + * + * @param sessid : string - schedule import token + * @param criteria : struct - see search criteria + * @param fromTime : time - begining time of schedule export + * @param toTime : time - ending time of schedule export + * @return status : hasharray - fields: + * token: string - schedule export token + */ + function openExport($sessid,$criteria,$fromTime,$toTime) { + return array ('token' => '123456789abcdef0'); + } + + /** + * Check status of schedule export + * + * @param token : string - schedule export token + * @return status : hasharray - fields: + * token: string - schedule export token + * status: string - working | fault | success + * file : string - exported file location (available if status is success) + */ + function checkExport($token) { + if ($token == '123456789abcdef0') { + return array( + 'token' => $token, + 'status' => 'working' + ); + } else { + PEAR::raiseError('Schedule::checkExport: invalid token'); + } + } + + /** + * Close schedule export + * + * @param token : string - schedule export token + * @return status : hasharray - fields: + * token: string - schedule export token + */ + function closeExport($token) { + if ($token == '123456789abcdef0') { + return array( + 'token' => $token + ); + } else { + PEAR::raiseError('Schedule::closeExport: invalid token'); + } + } +} +?> diff --git a/livesupport/src/modules/storageServer/var/xmlrpc/XR_LocStor.php b/livesupport/src/modules/storageServer/var/xmlrpc/XR_LocStor.php index bb2fe2c92..0b2defaa9 100644 --- a/livesupport/src/modules/storageServer/var/xmlrpc/XR_LocStor.php +++ b/livesupport/src/modules/storageServer/var/xmlrpc/XR_LocStor.php @@ -1937,7 +1937,7 @@ class XR_LocStor extends LocStor{ } /* ------------------------------------------------------ restore methods */ /** - * Open writable URL for restore a backup file + * Open restore a backup file * * The XML-RPC name of this method is "locstor.restoreBackupOpen". * @@ -1950,7 +1950,6 @@ class XR_LocStor extends LocStor{ * * On success, returns a XML-RPC struct with following fields: *