updated the storage client to use the server's changed restore backup functions
This commit is contained in:
parent
c1253836d4
commit
e9ce767d07
|
@ -730,6 +730,12 @@ const std::string createBackupFaultStringParamName = "faultString";
|
|||
const std::string restoreBackupOpenMethodName
|
||||
= "locstor.restoreBackupOpen";
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* The name of the 'close put' restore backup method on the storage server
|
||||
*----------------------------------------------------------------------------*/
|
||||
const std::string restoreBackupClosePutMethodName
|
||||
= "locstor.restoreBackupClosePut";
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* The name of the 'check' restore backup method on the storage server
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
@ -752,6 +758,16 @@ const std::string restoreBackupSessionIdParamName = "sessid";
|
|||
*----------------------------------------------------------------------------*/
|
||||
const std::string restoreBackupFileNameParamName = "filename";
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* The name of the URL parameter in the input or output structure
|
||||
*----------------------------------------------------------------------------*/
|
||||
const std::string restoreBackupUrlParamName = "url";
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* The name of the PUT token parameter in the input or output structure
|
||||
*----------------------------------------------------------------------------*/
|
||||
const std::string restoreBackupPutTokenParamName = "token";
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* The name of the token parameter in the input or output structure
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
@ -2515,12 +2531,41 @@ WebStorageClient :: restoreBackupOpen(
|
|||
execute(restoreBackupOpenMethodName, parameters, result);
|
||||
|
||||
checkStruct(restoreBackupOpenMethodName,
|
||||
result,
|
||||
restoreBackupUrlParamName,
|
||||
XmlRpcValue::TypeString);
|
||||
|
||||
checkStruct(restoreBackupOpenMethodName,
|
||||
result,
|
||||
restoreBackupPutTokenParamName,
|
||||
XmlRpcValue::TypeString);
|
||||
|
||||
std::string url = std::string(result[restoreBackupUrlParamName]);
|
||||
std::string putToken = std::string(result[restoreBackupPutTokenParamName]);
|
||||
|
||||
try {
|
||||
FileTools::copyFileToUrl(*path, url);
|
||||
|
||||
} catch (std::runtime_error &e) {
|
||||
throw XmlRpcCommunicationException(e.what());
|
||||
}
|
||||
|
||||
parameters.clear();
|
||||
parameters[restoreBackupSessionIdParamName]
|
||||
= sessionId->getId();
|
||||
parameters[restoreBackupPutTokenParamName]
|
||||
= putToken;
|
||||
|
||||
result.clear();
|
||||
execute(restoreBackupClosePutMethodName, parameters, result);
|
||||
|
||||
checkStruct(restoreBackupClosePutMethodName,
|
||||
result,
|
||||
restoreBackupTokenParamName,
|
||||
XmlRpcValue::TypeString);
|
||||
|
||||
Ptr<Glib::ustring>::Ref token(new Glib::ustring(
|
||||
result[createBackupTokenParamName] ));
|
||||
result[restoreBackupTokenParamName] ));
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue