Methods Summary |
---|
public RPReply | _process(RPRequest request)
String method = request.getMethod();
Object[] params = request.getParams();
if ( method.equals( "getDownload[byte[]]")){
try{
return( new RPReply( RPDownload.create( delegate.getDownload((byte[])params[0]))));
}catch( DownloadException e ){
return( new RPReply(e));
}
}else if ( method.equals( "getDownloadStats[byte[]]")){
try{
return( new RPReply( RPDownloadStats.create( delegate.getDownloadStats((byte[])params[0]))));
}catch( DownloadException e ){
return( new RPReply(e));
}
}else if ( method.equals( "restartDownload[byte[]]")){
try{
delegate.restartDownload((byte[])params[0]);
}catch( DownloadException e ){
return( new RPReply(e));
}
return( null );
}else if ( method.equals( "stopDownload[byte[]]")){
try{
delegate.stopDownload((byte[])params[0]);
}catch( DownloadException e ){
return( new RPReply(e));
}
return( null );
}else if ( method.equals( "removeDownload[byte[]]")){
try{
delegate.removeDownload((byte[])params[0]);
}catch( Throwable e ){
return( new RPReply(e));
}
return( null );
}
throw( new RPException( "Unknown method: " + method ));
|
protected void | _setDelegate(java.lang.Object _delegate)
delegate = (ShortCuts)_delegate;
|
public java.lang.Object | _setLocal()
Object res = _fixupLocal();
return( res );
|
public void | _setRemote(RPRequestDispatcher _dispatcher)
super._setRemote( _dispatcher );
|
public static org.gudy.azureus2.pluginsimpl.remote.utils.RPShortCuts | create(ShortCuts _delegate)
RPShortCuts res =(RPShortCuts)_lookupLocal( _delegate );
if ( res == null ){
res = new RPShortCuts( _delegate );
}
return( res );
|
public Download | getDownload(byte[] hash)
try{
RPDownload res = (RPDownload)_dispatcher.dispatch( new RPRequest( this, "getDownload[byte[]]", new Object[]{hash})).getResponse();
res._setRemote( _dispatcher );
return( res );
}catch( RPException e ){
if ( e.getCause() instanceof DownloadException ){
throw((DownloadException)e.getCause());
}
throw( e );
}
|
public DownloadStats | getDownloadStats(byte[] hash)
try{
RPDownloadStats res = (RPDownloadStats)_dispatcher.dispatch( new RPRequest( this, "getDownloadStats[byte[]]", new Object[]{hash})).getResponse();
res._setRemote( _dispatcher );
return( res );
}catch( RPException e ){
if ( e.getCause() instanceof DownloadException ){
throw((DownloadException)e.getCause());
}
throw( e );
}
|
public void | removeDownload(byte[] hash)
try{
_dispatcher.dispatch( new RPRequest( this, "removeDownload[byte[]]", new Object[]{hash})).getResponse();
}catch( RPException e ){
if ( e.getCause() instanceof DownloadException ){
throw((DownloadException)e.getCause());
}
throw( e );
}
|
public void | restartDownload(byte[] hash)
try{
_dispatcher.dispatch( new RPRequest( this, "restartDownload[byte[]]", new Object[]{hash})).getResponse();
}catch( RPException e ){
if ( e.getCause() instanceof DownloadException ){
throw((DownloadException)e.getCause());
}
throw( e );
}
|
public void | stopDownload(byte[] hash)
try{
_dispatcher.dispatch( new RPRequest( this, "stopDownload[byte[]]", new Object[]{hash})).getResponse();
}catch( RPException e ){
if ( e.getCause() instanceof DownloadException ){
throw((DownloadException)e.getCause());
}
throw( e );
}
|