#1530 networking XML-RPC dummy methods added
This commit is contained in:
parent
40fa38627c
commit
c0cffd4953
9 changed files with 974 additions and 885 deletions
|
@ -1623,7 +1623,7 @@ class BasicStor extends Alib{
|
|||
if($filesOnly) $this->deleteFiles();
|
||||
else $this->deleteData();
|
||||
if(!$this->config['isArchive']){
|
||||
$tr =& new Transport($this->dbc, $this, $this->config);
|
||||
$tr =& new Transport($this);
|
||||
$tr->resetData();
|
||||
}
|
||||
$res = array(
|
||||
|
|
|
@ -1133,35 +1133,19 @@ class GreenBox extends BasicStor{
|
|||
*
|
||||
* @param trtok: string - transport token
|
||||
* @return struct/hasharray with fields:
|
||||
* trtype: string - audioclip | playlist | search | file
|
||||
* state: string - transport state
|
||||
* expectedSize: int - file size in bytes
|
||||
* realSize: int - currently transported bytes
|
||||
* expectedChsum: string - orginal file checksum
|
||||
* realChsum: string - transported file checksum
|
||||
* direction: string - up | down
|
||||
* expectedsize: int - file size in bytes
|
||||
* realsize: int - currently transported bytes
|
||||
* expectedchsum: string - orginal file checksum
|
||||
* realchsum: string - transported file checksum
|
||||
* ... ?
|
||||
*/
|
||||
// DUMMY
|
||||
function getTransportInfo($trtok)
|
||||
{
|
||||
switch($trtok){
|
||||
case'123456789abcdeff'; // upload/download
|
||||
return array(
|
||||
'state' => 'finished',
|
||||
'expectedSize' => 1024,
|
||||
'realSize' => 1024,
|
||||
'expectedChsum' => '12dd9137a855cf600881dd6d3ffa7517',
|
||||
'realChsum' => '12dd9137a855cf600881dd6d3ffa7517',
|
||||
);
|
||||
case'123456789abcdefe'; // search
|
||||
return array(
|
||||
'state' => 'finished',
|
||||
);
|
||||
default:
|
||||
return PEAR::raiseError(
|
||||
"GreenBox::getTransportInfo:".
|
||||
" invalid transport token ($trtok)"
|
||||
);
|
||||
}
|
||||
function getTransportInfo($trtok) {
|
||||
require_once"Transport.php";
|
||||
$tr =& new Transport($this);
|
||||
return $tr->getTransportInfo($trtok);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1170,10 +1154,10 @@ class GreenBox extends BasicStor{
|
|||
* @param onOff: boolean optional (if not used, current state is returned)
|
||||
* @return boolean - previous state
|
||||
*/
|
||||
// DUMMY
|
||||
function turnOnOffTransports($onOff)
|
||||
{
|
||||
return TRUE;
|
||||
function turnOnOffTransports($onOff) {
|
||||
require_once"Transport.php";
|
||||
$tr =& new Transport($this);
|
||||
return $tr->turnOnOffTransports($onOff);
|
||||
}
|
||||
|
||||
/* ------------------------ methods for ls-archive-format file transports */
|
||||
|
@ -1184,15 +1168,10 @@ class GreenBox extends BasicStor{
|
|||
* @param filePath string - local path to uploaded file
|
||||
* @return string - transport token
|
||||
*/
|
||||
// DUMMY
|
||||
function uploadFile2Hub($filePath)
|
||||
{
|
||||
if(!file_exists($filePath)){
|
||||
return PEAR::raiseError(
|
||||
"GreenBox::uploadFile2Hub: file not found ($filePath)"
|
||||
);
|
||||
}
|
||||
return '123456789abcdeff';
|
||||
function uploadFile2Hub($filePath) {
|
||||
require_once"Transport.php";
|
||||
$tr =& new Transport($this);
|
||||
return $tr->uploadFile2Hub($filePath);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1202,14 +1181,10 @@ class GreenBox extends BasicStor{
|
|||
* trtok: string transport token
|
||||
* ... ?
|
||||
*/
|
||||
// DUMMY
|
||||
function getHubInitiatedTransfers()
|
||||
{
|
||||
return array(
|
||||
array(
|
||||
'trtok' => '123456789abcdeff',
|
||||
),
|
||||
);
|
||||
function getHubInitiatedTransfers() {
|
||||
require_once"Transport.php";
|
||||
$tr =& new Transport($this);
|
||||
return $tr->getHubInitiatedTransfers();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1219,16 +1194,10 @@ class GreenBox extends BasicStor{
|
|||
* the getHubInitiatedTransfers method
|
||||
* @return string - transport token
|
||||
*/
|
||||
// DUMMY
|
||||
function startHubInitiatedTransfer($trtok)
|
||||
{
|
||||
if($trtok != '123456789abcdeff'){
|
||||
return PEAR::raiseError(
|
||||
"GreenBox::startHubInitiatedTransfer:".
|
||||
" invalid transport token ($trtok)"
|
||||
);
|
||||
}
|
||||
return $trtok;
|
||||
function startHubInitiatedTransfer($trtok) {
|
||||
require_once"Transport.php";
|
||||
$tr =& new Transport($this);
|
||||
return $tr->startHubInitiatedTransfer($trtok);
|
||||
}
|
||||
|
||||
/* ------------- special methods for audioClip/webstream object transport */
|
||||
|
@ -1237,28 +1206,24 @@ class GreenBox extends BasicStor{
|
|||
* Start upload of audioClip/webstream from local storageServer to hub
|
||||
*
|
||||
* @param gunid: string - global unique id of object being transported
|
||||
* @return boolean true - status
|
||||
* @return string - transport token
|
||||
*/
|
||||
// DUMMY
|
||||
function uploadAudioClip2Hub($gunid)
|
||||
{
|
||||
$ac = StoredFile::recallByGunid($this, $gunid);
|
||||
if(PEAR::isError($ac)){ return $ac; }
|
||||
return TRUE;
|
||||
function uploadAudioClip2Hub($gunid) {
|
||||
require_once"Transport.php";
|
||||
$tr =& new Transport($this);
|
||||
return $tr->uploadAudioClip2Hub($gunid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Start download of audioClip/webstream from hub to local storageServer
|
||||
*
|
||||
* @param gunid: string - global unique id of object being transported
|
||||
* @return boolean true - status
|
||||
* @return string - transport token
|
||||
*/
|
||||
// DUMMY
|
||||
function downloadAudioClipFromHub($gunid)
|
||||
{
|
||||
$ac = StoredFile::recallByGunid($this, $gunid);
|
||||
if(PEAR::isError($ac)){ return $ac; }
|
||||
return TRUE;
|
||||
function downloadAudioClipFromHub($gunid) {
|
||||
require_once"Transport.php";
|
||||
$tr =& new Transport($this);
|
||||
return $tr->downloadAudioClipFromHub($gunid);
|
||||
}
|
||||
|
||||
/* ------------------------------- special methods for playlist transport */
|
||||
|
@ -1267,14 +1232,12 @@ class GreenBox extends BasicStor{
|
|||
*
|
||||
* @param plid: string - global unique id of playlist being transported
|
||||
* @param withContent: boolean - if true, transport playlist content too
|
||||
* @return boolean true - status
|
||||
* @return string - transport token
|
||||
*/
|
||||
// DUMMY
|
||||
function uploadPlaylist2Hub($plid, $withContent)
|
||||
{
|
||||
$pl = Playlist::recallByGunid($this, $plid);
|
||||
if(PEAR::isError($pl)){ return $pl; }
|
||||
return TRUE;
|
||||
function uploadPlaylist2Hub($plid, $withContent) {
|
||||
require_once"Transport.php";
|
||||
$tr =& new Transport($this);
|
||||
return $tr->uploadPlaylist2Hub($plid, $withContent);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1282,14 +1245,12 @@ class GreenBox extends BasicStor{
|
|||
*
|
||||
* @param plid: string - global unique id of playlist being transported
|
||||
* @param withContent: boolean - if true, transport playlist content too
|
||||
* @return boolean true - status
|
||||
* @return string - transport token
|
||||
*/
|
||||
// DUMMY
|
||||
function downloadPlaylistFromHub($plid, $withContent)
|
||||
{
|
||||
$pl = Playlist::recallByGunid($this, $plid);
|
||||
if(PEAR::isError($pl)){ return $pl; }
|
||||
return TRUE;
|
||||
function downloadPlaylistFromHub($plid, $withContent) {
|
||||
require_once"Transport.php";
|
||||
$tr =& new Transport($this);
|
||||
return $tr->downloadPlaylistFromHub($plid, $withContent);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------ global-search methods */
|
||||
|
@ -1299,10 +1260,10 @@ class GreenBox extends BasicStor{
|
|||
* @param criteria: LS criteria format (see localSearch)
|
||||
* @return string - transport token
|
||||
*/
|
||||
// DUMMY
|
||||
function globalSearch($criteria)
|
||||
{
|
||||
return '123456789abcdefe';
|
||||
function globalSearch($criteria) {
|
||||
require_once"Transport.php";
|
||||
$tr =& new Transport($this);
|
||||
return $tr->globalSearch($criteria);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1311,29 +1272,12 @@ class GreenBox extends BasicStor{
|
|||
* @param trtok: string - transport token
|
||||
* @return : LS search result format (see localSearch)
|
||||
*/
|
||||
// DUMMY
|
||||
function getSearchResults($trtok)
|
||||
{
|
||||
if($trtok != '123456789abcdefe'){
|
||||
return PEAR::raiseError(
|
||||
"GreenBox::getSearchResults: invalid transport token ($trtok)"
|
||||
);
|
||||
}
|
||||
return array(
|
||||
'results' => array('0000000000010001', '0000000000010002'),
|
||||
'cnt' => 2,
|
||||
);
|
||||
function getSearchResults($trtok) {
|
||||
require_once"Transport.php";
|
||||
$tr =& new Transport($this);
|
||||
return $tr->getSearchResults($trtok);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
function ()
|
||||
{
|
||||
}
|
||||
*/
|
||||
|
||||
/* ========================================================= info methods */
|
||||
/**
|
||||
* List files in folder
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -73,7 +73,7 @@ if(PEAR::isError($dbc)){
|
|||
|
||||
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
$gb =& new GreenBox($dbc, $config);
|
||||
$tr =& new Transport($dbc, $gb, $config);
|
||||
$tr =& new Transport($gb);
|
||||
$pr =& new Prefs($gb);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
|
@ -66,7 +66,7 @@ if(PEAR::isError($dbc)){
|
|||
echo "#StorageServer uninstall:\n";
|
||||
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
$gb = &new GreenBox($dbc, $config);
|
||||
$tr =& new Transport($dbc, $gb, $config);
|
||||
$tr =& new Transport($gb);
|
||||
$pr =& new Prefs($gb);
|
||||
$dbc->setErrorHandling(PEAR_ERROR_RETURN);
|
||||
|
||||
|
|
|
@ -1773,6 +1773,9 @@ class XR_LocStor extends LocStor{
|
|||
{
|
||||
list($ok, $r) = $this->_xr_getPars($input);
|
||||
if(!$ok) return $r;
|
||||
|
||||
# return new XML_RPC_Response(XML_RPC_encode(var_export($this, TRUE)));
|
||||
|
||||
$res = $this->createBackupOpen($r['sessid'], $r['criteria']);
|
||||
if(PEAR::isError($res)){
|
||||
return new XML_RPC_Response(0, 805,
|
||||
|
@ -2210,7 +2213,7 @@ class XR_LocStor extends LocStor{
|
|||
*
|
||||
* @param input XMLRPC struct
|
||||
* @return XMLRPC struct
|
||||
* @see Pref::browseCategory
|
||||
* @see LocStor::browseCategory
|
||||
*/
|
||||
function xr_browseCategory($input)
|
||||
{
|
||||
|
@ -2237,7 +2240,7 @@ class XR_LocStor extends LocStor{
|
|||
return new XML_RPC_Response($xv);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------- methods for preferences */
|
||||
/* ============================================== methods for preferences */
|
||||
/**
|
||||
* Load user preference value
|
||||
*
|
||||
|
@ -2497,8 +2500,586 @@ class XR_LocStor extends LocStor{
|
|||
return new XML_RPC_Response(XML_RPC_encode(array('status'=>$res)));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- remote repository methods */
|
||||
/* =============================== remote repository (networking) methods */
|
||||
/* ------------------------------------------------------- common methods */
|
||||
/**
|
||||
* Common "check" method for transports
|
||||
*
|
||||
* The XML-RPC name of this method is "locstor.getTransportInfo".
|
||||
*
|
||||
* The input parameters are an XML-RPC struct with the following
|
||||
* fields:
|
||||
* <ul>
|
||||
* <li> trtok : string - transport token</li>
|
||||
* </ul>
|
||||
*
|
||||
* On success, returns a XML-RPC struct with the following fields:
|
||||
* <ul>
|
||||
* <li>trtype: string - audioclip | playlist | search | file</li>
|
||||
* <li>direction: string - up | down</li>
|
||||
* <li>state: string - transport state</li>
|
||||
* <li>expectedsize: int - expected size</li>
|
||||
* <li>realsize: int - size of transported file</li>
|
||||
* <li>expectedchsum: string - expected checksum</li>
|
||||
* <li>realchsum: string - checksum of transported file</li>
|
||||
* <li>title: string - file title</li>
|
||||
* <li>errmsg: string - error message from failed transports</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_getTransportInfo:
|
||||
* <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::getTransportInfo
|
||||
*/
|
||||
function xr_getTransportInfo($input)
|
||||
{
|
||||
list($ok, $r) = $this->_xr_getPars($input);
|
||||
if(!$ok) return $r;
|
||||
require_once '../Transport.php';
|
||||
$tr =& new Transport($this);
|
||||
$res = $tr->getTransportInfo($r['trtok']);
|
||||
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_getTransportInfo: ".$res->getMessage()." ".$res->getUserInfo()
|
||||
);
|
||||
}
|
||||
return new XML_RPC_Response(XML_RPC_encode($res));
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn transports on/off, optionaly return current state.
|
||||
*
|
||||
* The XML-RPC name of this method is "locstor.turnOnOffTransports".
|
||||
*
|
||||
* The input parameters are an XML-RPC struct with the following
|
||||
* fields:
|
||||
* <ul>
|
||||
* <li> sessid : string - session id </li>
|
||||
* <li> onOff: boolean optional
|
||||
* (if not used, current state is returned)</li>
|
||||
* </ul>
|
||||
*
|
||||
* On success, returns a XML-RPC struct with the following fields:
|
||||
* <ul>
|
||||
* <li> state : boolean - previous 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_turnOnOffTransports:
|
||||
* <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::turnOnOffTransports
|
||||
*/
|
||||
function xr_turnOnOffTransports($input) {
|
||||
list($ok, $r) = $this->_xr_getPars($input);
|
||||
if(!$ok) return $r;
|
||||
require_once '../Transport.php';
|
||||
$tr =& new Transport($this);
|
||||
$res = $tr->turnOnOffTransports($r['onOff']);
|
||||
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_turnOnOffTransports: ".$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,
|
||||
* file should be ls-archive-format file.
|
||||
*
|
||||
* The XML-RPC name of this method is "locstor.uploadFile2Hub".
|
||||
*
|
||||
* The input parameters are an XML-RPC struct with the following
|
||||
* fields:
|
||||
* <ul>
|
||||
* <li> sessid : string - session id </li>
|
||||
* <li> filePath string - local path to uploaded file</li>
|
||||
* </ul>
|
||||
*
|
||||
* On success, returns a XML-RPC struct with the following fields:
|
||||
* <ul>
|
||||
* <li> trtok : string - transport token</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_uploadFile2Hub:
|
||||
* <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::uploadFile2Hub
|
||||
*/
|
||||
function xr_uploadFile2Hub($input) {
|
||||
list($ok, $r) = $this->_xr_getPars($input);
|
||||
if(!$ok) return $r;
|
||||
require_once '../Transport.php';
|
||||
$tr =& new Transport($this);
|
||||
$res = $tr->uploadFile2Hub($r['filePath']); // local files on XML-RPC :(
|
||||
// there should be something as uploadFile2storageServer
|
||||
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_uploadFile2Hub: ".$res->getMessage()." ".$res->getUserInfo()
|
||||
);
|
||||
}
|
||||
return new XML_RPC_Response(XML_RPC_encode(array('trtok'=>$res)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of prepared transfers initiated by hub
|
||||
*
|
||||
* The XML-RPC name of this method is "locstor.getHubInitiatedTransfers".
|
||||
*
|
||||
* The input parameters are an XML-RPC struct with the following
|
||||
* fields:
|
||||
* <ul>
|
||||
* <li> sessid : string - session id </li>
|
||||
* </ul>
|
||||
*
|
||||
* On success, returns a XML-RPC struct with the following fields:
|
||||
* <ul>
|
||||
* <li> results : array of structs with fields:
|
||||
* <ul>
|
||||
* <li> trtok : string - transport token</li>
|
||||
* <li> ... ? </li>
|
||||
* </ul>
|
||||
* </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_getHubInitiatedTransfers:
|
||||
* <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::getHubInitiatedTransfers
|
||||
*/
|
||||
function xr_getHubInitiatedTransfers($input) {
|
||||
list($ok, $r) = $this->_xr_getPars($input);
|
||||
if(!$ok) return $r;
|
||||
require_once '../Transport.php';
|
||||
$tr =& new Transport($this);
|
||||
$res = $tr->getHubInitiatedTransfers();
|
||||
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_getHubInitiatedTransfers: ".$res->getMessage()." ".$res->getUserInfo()
|
||||
);
|
||||
}
|
||||
return new XML_RPC_Response(XML_RPC_encode($res));
|
||||
}
|
||||
|
||||
/**
|
||||
* Start of download initiated by hub
|
||||
*
|
||||
* The XML-RPC name of this method is "locstor.startHubInitiatedTransfer".
|
||||
*
|
||||
* The input parameters are an XML-RPC struct with the following
|
||||
* fields:
|
||||
* <ul>
|
||||
* <li> trtok : string - transport token obtained from
|
||||
* the getHubInitiatedTransfers method</li>
|
||||
* </ul>
|
||||
*
|
||||
* On success, returns a XML-RPC struct with the following fields:
|
||||
* <ul>
|
||||
* <li> trtok : string - transport token</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_startHubInitiatedTransfer:
|
||||
* <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::startHubInitiatedTransfer
|
||||
*/
|
||||
function xr_startHubInitiatedTransfer($input) {
|
||||
list($ok, $r) = $this->_xr_getPars($input);
|
||||
if(!$ok) return $r;
|
||||
require_once '../Transport.php';
|
||||
$tr =& new Transport($this);
|
||||
$res = $tr->startHubInitiatedTransfer($r['trtok']);
|
||||
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_startHubInitiatedTransfer: ".$res->getMessage()." ".$res->getUserInfo()
|
||||
);
|
||||
}
|
||||
return new XML_RPC_Response(XML_RPC_encode(array('trtok'=>$res)));
|
||||
}
|
||||
|
||||
/* ------------- special methods for audioClip/webstream object transport */
|
||||
|
||||
/**
|
||||
* Common "check" method for transports
|
||||
*
|
||||
* The XML-RPC name of this method is "locstor.uploadAudioClip2Hub".
|
||||
*
|
||||
* The input parameters are an XML-RPC struct with the following
|
||||
* fields:
|
||||
* <ul>
|
||||
* <li> sessid : string - session id </li>
|
||||
* <li> gunid: string - global unique id of object being transported
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* On success, returns a XML-RPC struct with the following fields:
|
||||
* <ul>
|
||||
* <li> trtok : string - transport token</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_uploadAudioClip2Hub:
|
||||
* <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::uploadAudioClip2Hub
|
||||
*/
|
||||
function xr_uploadAudioClip2Hub($input) {
|
||||
list($ok, $r) = $this->_xr_getPars($input);
|
||||
if(!$ok) return $r;
|
||||
require_once '../Transport.php';
|
||||
$tr =& new Transport($this);
|
||||
$res = $tr->uploadAudioClip2Hub($r['gunid']);
|
||||
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_uploadAudioClip2Hub: ".$res->getMessage()." ".$res->getUserInfo()
|
||||
);
|
||||
}
|
||||
return new XML_RPC_Response(XML_RPC_encode(array('trtok'=>$res)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Start download of audioClip/webstream from hub to local storageServer
|
||||
*
|
||||
* The XML-RPC name of this method is "locstor.downloadAudioClipFromHub".
|
||||
*
|
||||
* The input parameters are an XML-RPC struct with the following
|
||||
* fields:
|
||||
* <ul>
|
||||
* <li> sessid : string - session id </li>
|
||||
* <li> gunid: string - global unique id of object being transported
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* On success, returns a XML-RPC struct with the following fields:
|
||||
* <ul>
|
||||
* <li> trtok : string - transport token</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_downloadAudioClipFromHub:
|
||||
* <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::downloadAudioClipFromHub
|
||||
*/
|
||||
function xr_downloadAudioClipFromHub($input) {
|
||||
list($ok, $r) = $this->_xr_getPars($input);
|
||||
if(!$ok) return $r;
|
||||
require_once '../Transport.php';
|
||||
$tr =& new Transport($this);
|
||||
$res = $tr->downloadAudioClipFromHub($r['gunid']);
|
||||
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_downloadAudioClipFromHub: ".$res->getMessage()." ".$res->getUserInfo()
|
||||
);
|
||||
}
|
||||
return new XML_RPC_Response(XML_RPC_encode(array('trtok'=>$res)));
|
||||
}
|
||||
|
||||
/* ------------------------------- special methods for playlist transport */
|
||||
/**
|
||||
* Start upload of playlist from local storageServer to hub
|
||||
*
|
||||
* The XML-RPC name of this method is "locstor.uploadPlaylist2Hub".
|
||||
*
|
||||
* The input parameters are an XML-RPC struct with the following
|
||||
* fields:
|
||||
* <ul>
|
||||
* <li> sessid : string - session id </li>
|
||||
* <li> plid: string - global unique id of playlist being transported
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* On success, returns a XML-RPC struct with the following fields:
|
||||
* <ul>
|
||||
* <li> trtok : string - transport token</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_uploadPlaylist2Hub:
|
||||
* <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::uploadPlaylist2Hub
|
||||
*/
|
||||
function xr_uploadPlaylist2Hub($input) {
|
||||
list($ok, $r) = $this->_xr_getPars($input);
|
||||
if(!$ok) return $r;
|
||||
require_once '../Transport.php';
|
||||
$tr =& new Transport($this);
|
||||
$res = $tr->uploadPlaylist2Hub($r['plid'], $r['withContent']);
|
||||
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_uploadPlaylist2Hub: ".$res->getMessage()." ".$res->getUserInfo()
|
||||
);
|
||||
}
|
||||
return new XML_RPC_Response(XML_RPC_encode(array('trtok'=>$res)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Start download of playlist from hub to local storageServer
|
||||
*
|
||||
* The XML-RPC name of this method is "locstor.downloadPlaylistFromHub".
|
||||
*
|
||||
* The input parameters are an XML-RPC struct with the following
|
||||
* fields:
|
||||
* <ul>
|
||||
* <li> sessid : string - session id </li>
|
||||
* <li> plid: string - global unique id of playlist being transported
|
||||
* </li>
|
||||
* <li> withContent: boolean - if true, transport playlist content too
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* On success, returns a XML-RPC struct with the following fields:
|
||||
* <ul>
|
||||
* <li> trtok : string - transport token</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_downloadPlaylistFromHub:
|
||||
* <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::downloadPlaylistFromHub
|
||||
*/
|
||||
function xr_downloadPlaylistFromHub($input) {
|
||||
list($ok, $r) = $this->_xr_getPars($input);
|
||||
if(!$ok) return $r;
|
||||
require_once '../Transport.php';
|
||||
$tr =& new Transport($this);
|
||||
$res = $tr->downloadPlaylistFromHub($r['plid'], $r['withContent']);
|
||||
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_downloadPlaylistFromHub: ".$res->getMessage()." ".$res->getUserInfo()
|
||||
);
|
||||
}
|
||||
return new XML_RPC_Response(XML_RPC_encode(array('trtok'=>$res)));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------ global-search methods */
|
||||
/**
|
||||
* Start search job on network hub
|
||||
*
|
||||
* The XML-RPC name of this method is "locstor.globalSearch".
|
||||
*
|
||||
* The input parameters are an XML-RPC struct with the following
|
||||
* fields:
|
||||
* <ul>
|
||||
* <li> sessid : string - session id </li>
|
||||
* <li> criteria: LS criteria format (see localSearch)</li>
|
||||
* </ul>
|
||||
*
|
||||
* On success, returns a XML-RPC struct with the following fields:
|
||||
* <ul>
|
||||
* <li> trtok : string - transport token</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_globalSearch:
|
||||
* <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::globalSearch
|
||||
*/
|
||||
function xr_globalSearch($input) {
|
||||
list($ok, $r) = $this->_xr_getPars($input);
|
||||
if(!$ok) return $r;
|
||||
require_once '../Transport.php';
|
||||
$tr =& new Transport($this);
|
||||
$res = $tr->globalSearch($r['criteria']);
|
||||
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_globalSearch: ".$res->getMessage()." ".$res->getUserInfo()
|
||||
);
|
||||
}
|
||||
return new XML_RPC_Response(XML_RPC_encode(array('trtok'=>$res)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get results from search job on network hub
|
||||
*
|
||||
* The XML-RPC name of this method is "locstor.getSearchResults".
|
||||
*
|
||||
* The input parameters are an XML-RPC struct with the following
|
||||
* fields:
|
||||
* <ul>
|
||||
* <li> trtok : string - transport token</li>
|
||||
* </ul>
|
||||
*
|
||||
* On success, returns a XML-RPC struct with the following fields:
|
||||
* <ul>
|
||||
* <li>audioClipResults : array with gunid strings
|
||||
* of audioClips have been found</li>
|
||||
* <li>audioClipCnt : int - number of audioClips matching
|
||||
* the criteria</li>
|
||||
* <li>webstreamResults : array with gunid strings
|
||||
* of webstreams have been found</li>
|
||||
* <li>webstreamCnt : int - number of webstreams matching
|
||||
* the criteria</li>
|
||||
* <li>playlistResults : array with gunid strings
|
||||
* of playlists have been found</li>
|
||||
* <li>playlistCnt : int - number of playlists matching
|
||||
* the criteria</li>
|
||||
* </ul>
|
||||
* (cnt values may be greater than size of arrays - see limit param)
|
||||
*
|
||||
* 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_getSearchResults:
|
||||
* <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::getSearchResults
|
||||
*/
|
||||
function xr_getSearchResults($input) {
|
||||
list($ok, $r) = $this->_xr_getPars($input);
|
||||
if(!$ok) return $r;
|
||||
require_once '../Transport.php';
|
||||
$tr =& new Transport($this);
|
||||
$res = $tr->getSearchResults($r['trtok']); // *** search results format differs between GB and XML_RPC ifaces
|
||||
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_getSearchResults: ".$res->getMessage()." ".$res->getUserInfo()
|
||||
);
|
||||
}
|
||||
return new XML_RPC_Response(XML_RPC_encode($res));
|
||||
}
|
||||
|
||||
/**
|
||||
* OBSOLETE
|
||||
* Starts upload audioclip to remote archive
|
||||
*
|
||||
* The XML-RPC name of this method is "locstor.uploadToArchive".
|
||||
|
@ -2528,14 +3109,14 @@ class XR_LocStor extends LocStor{
|
|||
*
|
||||
* @param input XMLRPC struct
|
||||
* @return XMLRPC struct
|
||||
* @see Pref::uploadToArchive
|
||||
* @see Transport::uploadToArchive
|
||||
*/
|
||||
function xr_uploadToArchive($input)
|
||||
{
|
||||
list($ok, $r) = $this->_xr_getPars($input);
|
||||
if(!$ok) return $r;
|
||||
require_once dirname(__FILE__).'/../Transport.php';
|
||||
$tr =& new Transport($this->dbc, $this, $this->config);
|
||||
$tr =& new Transport($this);
|
||||
$res = $tr->uploadToArchive($r['gunid'], $r['sessid']);
|
||||
if(PEAR::isError($res)){
|
||||
$ec0 = intval($res->getCode());
|
||||
|
@ -2548,6 +3129,7 @@ class XR_LocStor extends LocStor{
|
|||
}
|
||||
|
||||
/**
|
||||
* OBSOLETE
|
||||
* Starts download audioclip from remote archive
|
||||
*
|
||||
* The XML-RPC name of this method is "locstor.downloadFromArchive".
|
||||
|
@ -2577,14 +3159,14 @@ class XR_LocStor extends LocStor{
|
|||
*
|
||||
* @param input XMLRPC struct
|
||||
* @return XMLRPC struct
|
||||
* @see Pref::downloadFromArchive
|
||||
* @see Transport::downloadFromArchive
|
||||
*/
|
||||
function xr_downloadFromArchive($input)
|
||||
{
|
||||
list($ok, $r) = $this->_xr_getPars($input);
|
||||
if(!$ok) return $r;
|
||||
require_once dirname(__FILE__).'/../Transport.php';
|
||||
$tr =& new Transport($this->dbc, $this, $this->config);
|
||||
$tr =& new Transport($this);
|
||||
$res = $tr->downloadFromArchive($r['gunid'], $r['sessid']);
|
||||
if(PEAR::isError($res)){
|
||||
$ec0 = intval($res->getCode());
|
||||
|
@ -2596,64 +3178,7 @@ class XR_LocStor extends LocStor{
|
|||
return new XML_RPC_Response(XML_RPC_encode(array('trtok'=>$res)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checking status of transported file
|
||||
*
|
||||
* The XML-RPC name of this method is "locstor.getTransportInfo".
|
||||
*
|
||||
* 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>
|
||||
* </ul>
|
||||
*
|
||||
* On success, returns a XML-RPC struct with the following fields:
|
||||
* <ul>
|
||||
* <li>trtype: string - audioclip | playlist</li>
|
||||
* <li>direction: string - up | down</li>
|
||||
* <li>status: boolean - true if file have been
|
||||
* succesfully transported</li>
|
||||
* <li>expectedsize: int - expected size</li>
|
||||
* <li>realsize: int - size of transported file</li>
|
||||
* <li>expectedsum: string - expected checksum</li>
|
||||
* <li>realsum: string - checksum of transported file</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_getTransportInfo:
|
||||
* <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 Pref::getTransportInfo
|
||||
*/
|
||||
function xr_getTransportInfo($input)
|
||||
{
|
||||
list($ok, $r) = $this->_xr_getPars($input);
|
||||
if(!$ok) return $r;
|
||||
require_once dirname(__FILE__).'/../Transport.php';
|
||||
$tr =& new Transport($this->dbc, $this, $this->config);
|
||||
$res = $tr->getTransportInfo($r['trtok'], $r['sessid']);
|
||||
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_getAudioClip: ".$res->getMessage()." ".$res->getUserInfo()
|
||||
);
|
||||
}
|
||||
return new XML_RPC_Response(XML_RPC_encode($res));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------ methods for debugging */
|
||||
/* ================================================ methods for debugging */
|
||||
/**
|
||||
* Reset storageServer for debugging.
|
||||
*
|
||||
|
@ -2768,7 +3293,7 @@ class XR_LocStor extends LocStor{
|
|||
)));
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------- "private" methods */
|
||||
/* ==================================================== "private" methods */
|
||||
/**
|
||||
* Check and convert struct of parameters
|
||||
*
|
||||
|
|
|
@ -301,18 +301,23 @@ importPlaylist() {
|
|||
$XR_CLI deleteAudioClip $SESSID 0000000000010002 1
|
||||
$XR_CLI deleteAudioClip $SESSID 0000000000010003 1
|
||||
CHSUM=`md5sum $ARCHIVE | cut -d ' ' -f 1 `
|
||||
RES=`$XR_CLI importPlaylistOpen $SESSID $CHSUM` || \
|
||||
RES=`$XR_CLI importPlaylistOpen $SESSID $CHSUM` || \
|
||||
{ ERN=$?; echo $RES; exit $ERN; }
|
||||
unset URL
|
||||
for i in $RES; do if [ -z $URL ] ; then URL=$i; else TOKEN=$i; fi; done
|
||||
echo $TOKEN
|
||||
echo -n "# curl (PUT): "
|
||||
echo -n "# curl (PUT $URL): "
|
||||
curl -C 0 -T $ARCHIVE $URL || { ERN=$?; echo "curl error"; exit $ERN; }
|
||||
echo "status: $?"
|
||||
echo -n "# importPlaylistClose (${TOKEN}): "
|
||||
RES=`$XR_CLI importPlaylistClose $TOKEN` || \
|
||||
{ ERN=$?; echo $RES; exit $ERN; }
|
||||
echo $RES
|
||||
GUNID=0000000000010001; existsAudioClip;
|
||||
GUNID=0000000000010002; existsAudioClip;
|
||||
GUNID=0000000000010003; existsAudioClip;
|
||||
PLID=0000000000000001; existsPlaylist;
|
||||
PLID=0000000000000003; existsPlaylist;
|
||||
}
|
||||
|
||||
prefTest() {
|
||||
|
|
|
@ -157,9 +157,21 @@ $methods = array(
|
|||
'loadGroupPref' => 'Read group preference record.',
|
||||
'saveGroupPref' => 'Delete user preference record.',
|
||||
|
||||
'uploadToArchive' => 'Starts upload audioclip to remote archive.',
|
||||
'downloadFromArchive' => 'Starts download audioclip from remote archive.',
|
||||
'getTransportInfo' => 'Checking status of transported file.',
|
||||
'getTransportInfo' => 'Common "check" method for transports',
|
||||
'turnOnOffTransports' => 'Turn transports on/off, optionaly return current state',
|
||||
'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',
|
||||
'uploadAudioClip2Hub' => 'Common "check" method for transports',
|
||||
'downloadAudioClipFromHub' => 'Start download of audioClip/webstream from hub to local storageServer',
|
||||
'uploadPlaylist2Hub' => 'Start upload of playlist from local storageServer to hub',
|
||||
'downloadPlaylistFromHub' => 'Start download of playlist from hub to local storageServer',
|
||||
'globalSearch' => 'Start search job on network hub',
|
||||
'getSearchResults' => 'Get results from search job on network hub',
|
||||
|
||||
# 'uploadToArchive' => 'Starts upload audioclip to remote archive.',
|
||||
# 'downloadFromArchive' => 'Starts download audioclip from remote archive.',
|
||||
# 'getTransportInfo' => 'Checking status of transported file.',
|
||||
);
|
||||
|
||||
$defs = array();
|
||||
|
|
|
@ -182,13 +182,36 @@ $infos = array(
|
|||
"saveGroupPref" => array('m'=>"locstor.saveGroupPref",
|
||||
'p'=>array('sessid', 'group', 'key', 'value'), 'r'=>'status'),
|
||||
|
||||
"getTransportInfo" => array('m'=>"locstor.getTransportInfo",
|
||||
'p'=>array('trtok'),
|
||||
'r'=>array('state', 'realsize', 'expectedsize', 'realchsum', 'expectedchsum')),
|
||||
"turnOnOffTransports" => array('m'=>"locstor.turnOnOffTransports",
|
||||
'p'=>array('sessid', 'onOff'), 'r'=>array('state')),
|
||||
"uploadFile2Hub" => array('m'=>"locstor.uploadFile2Hub",
|
||||
'p'=>array('sessid', 'filePath'), 'r'=>array('trtok')),
|
||||
"getHubInitiatedTransfers" => array('m'=>"locstor.getHubInitiatedTransfers",
|
||||
'p'=>array('sessid'), 'r'=>array()),
|
||||
"startHubInitiatedTransfer" => array('m'=>"locstor.startHubInitiatedTransfer",
|
||||
'p'=>array('trtok'), 'r'=>array()),
|
||||
"uploadAudioClip2Hub" => array('m'=>"locstor.uploadAudioClip2Hub",
|
||||
'p'=>array('sessid', 'gunid'), 'r'=>array('trtok')),
|
||||
"downloadAudioClipFromHub" => array('m'=>"locstor.downloadAudioClipFromHub",
|
||||
'p'=>array('sessid', 'gunid'), 'r'=>array('trtok')),
|
||||
"uploadPlaylist2Hub" => array('m'=>"locstor.uploadPlaylist2Hub",
|
||||
'p'=>array('sessid', 'plid', 'withContent'), 'r'=>array('trtok')),
|
||||
"downloadPlaylistFromHub" => array('m'=>"locstor.downloadPlaylistFromHub",
|
||||
'p'=>array('plid', 'withContent'), 'r'=>array('trtok')),
|
||||
"globalSearch" => array('m'=>"locstor.globalSearch",
|
||||
'p'=>array('sessid', 'criteria'), 'r'=>array('trtok')),
|
||||
"getSearchResults" => array('m'=>"locstor.getSearchResults",
|
||||
'p'=>array('trtok'), 'r'=>array()),
|
||||
|
||||
/*
|
||||
"uploadToArchive" => array('m'=>"locstor.uploadToArchive",
|
||||
'p'=>array('sessid', 'gunid'), 'r'=>'trtok'),
|
||||
"downloadFromArchive" => array('m'=>"locstor.downloadFromArchive",
|
||||
'p'=>array('sessid', 'gunid'), 'r'=>'trtok'),
|
||||
"getTransportInfo" => array('m'=>"locstor.getTransportInfo",
|
||||
'p'=>array('sessid', 'trtok'),
|
||||
'r'=>array('state', 'realsize', 'realsum', 'expectedsize', 'expectedsum')),
|
||||
*/
|
||||
|
||||
"openPut" => array('m'=>"locstor.openPut", 'p'=>array()),
|
||||
"closePut" => array('m'=>"locstor.closePut", 'p'=>array()),
|
||||
|
@ -197,6 +220,7 @@ $infos = array(
|
|||
|
||||
switch($method){
|
||||
case"searchMetadata":
|
||||
case"createBackupOpen":
|
||||
$parr = array(
|
||||
'sessid'=>$pars[0],
|
||||
'criteria'=>array(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue