#1530 dummy method for pause,resume and cancel transport added
This commit is contained in:
parent
41fbc53944
commit
90647d059d
4 changed files with 74 additions and 0 deletions
|
@ -1160,6 +1160,23 @@ class GreenBox extends BasicStor{
|
|||
return $tr->turnOnOffTransports($onOff);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pause, resume or cancel transport
|
||||
*
|
||||
* @param trtok: string - transport token
|
||||
* @param action: string - pause | resume | cancel
|
||||
* @return string - resulting transport state
|
||||
*/
|
||||
function doTransportAction($trtok, $action) {
|
||||
// DUMMY
|
||||
return 'pending';
|
||||
/*
|
||||
require_once"Transport.php";
|
||||
$tr =& new Transport($this);
|
||||
return $tr->setTransportRState($action);
|
||||
*/
|
||||
}
|
||||
|
||||
/* ------------------------ methods for ls-archive-format file transports */
|
||||
/**
|
||||
* Open async file transfer from local storageServer to network hub,
|
||||
|
|
|
@ -2609,6 +2609,60 @@ class XR_LocStor extends LocStor{
|
|||
return new XML_RPC_Response(XML_RPC_encode(array('state'=>$res)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Pause, resume or cancel transport
|
||||
*
|
||||
* The XML-RPC name of this method is "locstor.doTransportAction".
|
||||
*
|
||||
* The input parameters are an XML-RPC struct with the following
|
||||
* fields:
|
||||
* <ul>
|
||||
* <li> sessid : string - session id </li>
|
||||
* <li> trtok : string - transport token</li>
|
||||
* <li> action: string - pause | resume | cancel
|
||||
* </ul>
|
||||
*
|
||||
* On success, returns a XML-RPC struct with the following fields:
|
||||
* <ul>
|
||||
* <li> state : string - resulting transport state</li>
|
||||
* </ul>
|
||||
*
|
||||
* On errors, returns an XML-RPC error response.
|
||||
* The possible error codes and error message are:
|
||||
* <ul>
|
||||
* <li> 3 - Incorrect parameters passed to method:
|
||||
* Wanted ... , got ... at param </li>
|
||||
* <li> 801 - wrong 1st parameter, struct expected.</li>
|
||||
* <li> 805 - xr_doTransportAction:
|
||||
* <message from lower layer> </li>
|
||||
* <li> 848 - invalid session id.</li>
|
||||
* <li> 872 - invalid tranport token.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param input XMLRPC struct
|
||||
* @return XMLRPC struct
|
||||
* @see Transport::doTransportAction
|
||||
*/
|
||||
function xr_doTransportAction($input) {
|
||||
list($ok, $r) = $this->_xr_getPars($input);
|
||||
if(!$ok) return $r;
|
||||
// DUMMY
|
||||
$res = 'pending';
|
||||
/*
|
||||
require_once '../Transport.php';
|
||||
$tr =& new Transport($this);
|
||||
$res = $tr->doTransportAction($r['trtok'], $r['action']);
|
||||
*/
|
||||
if(PEAR::isError($res)){
|
||||
$ec0 = intval($res->getCode());
|
||||
$ec = ($ec0 == GBERR_SESS || $ec0 == TRERR_TOK ? 800+$ec0 : 805 );
|
||||
return new XML_RPC_Response(0, $ec,
|
||||
"xr_doTransportAction: ".$res->getMessage()." ".$res->getUserInfo()
|
||||
);
|
||||
}
|
||||
return new XML_RPC_Response(XML_RPC_encode(array('state'=>$res)));
|
||||
}
|
||||
|
||||
/* ------------------------ methods for ls-archive-format file transports */
|
||||
/**
|
||||
* Open async file transfer from local storageServer to network hub,
|
||||
|
|
|
@ -159,6 +159,7 @@ $methods = array(
|
|||
|
||||
'getTransportInfo' => 'Common "check" method for transports',
|
||||
'turnOnOffTransports' => 'Turn transports on/off, optionaly return current state',
|
||||
'doTransportAction' => 'Pause, resume or cancel transport',
|
||||
'uploadFile2Hub' => 'Open async file transfer from local storageServer to network hub',
|
||||
'getHubInitiatedTransfers' => 'Get list of prepared transfers initiated by hub',
|
||||
'startHubInitiatedTransfer' => 'Start of download initiated by hub',
|
||||
|
|
|
@ -187,6 +187,8 @@ $infos = array(
|
|||
'r'=>array('state', 'realsize', 'expectedsize', 'realchsum', 'expectedchsum')),
|
||||
"turnOnOffTransports" => array('m'=>"locstor.turnOnOffTransports",
|
||||
'p'=>array('sessid', 'onOff'), 'r'=>array('state')),
|
||||
"doTransportAction" => array('m'=>"locstor.doTransportAction",
|
||||
'p'=>array('sessid', 'trtok', 'action'), 'r'=>array('state')),
|
||||
"uploadFile2Hub" => array('m'=>"locstor.uploadFile2Hub",
|
||||
'p'=>array('sessid', 'filePath'), 'r'=>array('trtok')),
|
||||
"getHubInitiatedTransfers" => array('m'=>"locstor.getHubInitiatedTransfers",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue