FileDocCategorySizeDatePackage
RPTracker.javaAPI DocAzureus 3.0.3.45705Thu Sep 06 21:11:02 BST 2007org.gudy.azureus2.pluginsimpl.remote.tracker

RPTracker

public class RPTracker extends RPObject implements Tracker
author
parg

Fields Summary
protected transient Tracker
delegate
Constructors Summary
protected RPTracker(Tracker _delegate)

		super( _delegate );
	
Methods Summary
public RPReply_process(RPRequest request)

		String		method 	= request.getMethod();
		Object[]	params	= request.getParams();
		
		if ( method.equals( "host[Torrent,boolean]")){
			
			try{
				Torrent	torrent = params[0]==null?null:(Torrent)((RPTorrent)params[0])._setLocal();
				
				if ( torrent == null ){
					
					throw( new RPException( "Invalid torrent" ));
				}
				
				TrackerTorrent tt = delegate.host(torrent,((Boolean)params[1]).booleanValue());
				
				RPTrackerTorrent res = RPTrackerTorrent.create( tt );
			
				return( new RPReply( res ));		
				
			}catch( TrackerException e ){
				
				return( new RPReply( e ));
			}
		}else if ( method.equals( "getTorrents")){
			
			TrackerTorrent[]	torrents = delegate.getTorrents();
						
			RPTrackerTorrent[]	res = new RPTrackerTorrent[torrents.length];
			
			for (int i=0;i<res.length;i++){
				
				res[i] = RPTrackerTorrent.create( torrents[i]);
			}
			
			return( new RPReply( res ));	
		}
		
		throw( new RPException( "Unknown method: " + method ));
	
protected void_setDelegate(java.lang.Object _delegate)

		delegate = (Tracker)_delegate;
	
public java.lang.Object_setLocal()

		return( _fixupLocal());
	
public voidaddAuthenticationListener(TrackerAuthenticationListener l)

		
	
public voidaddListener(TrackerListener listener)

    	
    
public voidaddPageGenerator(TrackerWebPageGenerator generator)

		
	
public static org.gudy.azureus2.pluginsimpl.remote.tracker.RPTrackercreate(Tracker _delegate)

		RPTracker	res =(RPTracker)_lookupLocal( _delegate );
		
		if ( res == null ){
			
			res = new RPTracker( _delegate );
		}
		
		return( res );
	
public TrackerWebContextcreateWebContext(int port, int protocol)

       	notSupported();
		
		return( null );
	
public TrackerWebContextcreateWebContext(java.lang.String name, int port, int protocol)

	
    	notSupported();
		
		return( null );
	
public TrackerWebContextcreateWebContext(java.lang.String name, int port, int protocol, java.net.InetAddress bind_ip)

	
    	notSupported();
		
		return( null );
	
public voiddestroy()

		notSupported();
	
public java.lang.StringgetName()

	
	   	notSupported();
		
		return( null );
	
public TrackerWebPageGenerator[]getPageGenerators()

	   	notSupported();
		
		return( null );		
	
public TrackerTorrentgetTorrent(org.gudy.azureus2.plugins.torrent.Torrent t)

    	notSupported();
    	
    	return( null );
    
public TrackerTorrent[]getTorrents()

		RPTrackerTorrent[]	res = (RPTrackerTorrent[])_dispatcher.dispatch( new RPRequest( this, "getTorrents", null )).getResponse();
		
		for (int i=0;i<res.length;i++){
			
			res[i]._setRemote( _dispatcher );
		}
		
		return( res ); 	
    
public java.net.URL[]getURLs()

	   	notSupported();
		
		return( null );				
	
public TrackerTorrenthost(org.gudy.azureus2.plugins.torrent.Torrent torrent, boolean persistent)

		try{
			RPTrackerTorrent resp = (RPTrackerTorrent)_dispatcher.dispatch( new RPRequest( this, "host[Torrent,boolean]", new Object[]{torrent, new Boolean(persistent)})).getResponse();
			
			resp._setRemote( _dispatcher );
			
			return( resp );
			
		}catch( RPException e ){
			
			if ( e.getCause() instanceof TrackerException ){
				
				throw((TrackerException)e.getCause());
			}
			
			throw( e );
		}		
	
public TrackerTorrenthost(org.gudy.azureus2.plugins.torrent.Torrent torrent, boolean persistent, boolean passive)

		notSupported();
		
		return( null );
	
public TrackerTorrentpublish(org.gudy.azureus2.plugins.torrent.Torrent torrent)

		notSupported();
		
		return( null );
	
public voidremoveAuthenticationListener(TrackerAuthenticationListener l)

		
	
public voidremoveListener(TrackerListener listener)

    	
    
public voidremovePageGenerator(TrackerWebPageGenerator generator)