FileDocCategorySizeDatePackage
DownloadAnnounceResultImpl.javaAPI DocAzureus 3.0.3.43203Thu Nov 30 16:44:58 GMT 2006org.gudy.azureus2.pluginsimpl.local.download

DownloadAnnounceResultImpl

public class DownloadAnnounceResultImpl extends Object implements org.gudy.azureus2.plugins.download.DownloadAnnounceResult
author
parg

Fields Summary
protected org.gudy.azureus2.plugins.download.Download
download
protected TRTrackerAnnouncerResponse
response
Constructors Summary
public DownloadAnnounceResultImpl(org.gudy.azureus2.plugins.download.Download _download, TRTrackerAnnouncerResponse _response)

		download	= _download;
		response	= _response;
	
Methods Summary
public org.gudy.azureus2.plugins.download.DownloadgetDownload()

		return( download );
	
public java.lang.StringgetError()

		return( response==null?"No Response":response.getAdditionalInfo());
	
public java.util.MapgetExtensions()

		if ( response == null ){
			
			return( null );
		}
		
		return( response.getExtensions());
	
public intgetNonSeedCount()

		PeerManager	pm = download.getPeerManager();
		
		if ( pm != null ){
			
			return( pm.getStats().getConnectedLeechers());
		}
		
		return( 0 );
	
public org.gudy.azureus2.plugins.download.DownloadAnnounceResultPeer[]getPeers()

		if ( response == null ){
			
			return( new DownloadAnnounceResultPeer[0]);
		}
		
		return( response.getPeers());
	
public intgetReportedPeerCount()

		return( response==null||response.getPeers()==null?0:response.getPeers().length );
	
public intgetResponseType()

		if ( response == null ){
			
			return( RT_ERROR );
		}
		
		int status = response.getStatus();
		
		if ( status == TRTrackerAnnouncerResponse.ST_ONLINE ){
			
			return( RT_SUCCESS );
		}else{
			
			return( RT_ERROR );
		}	
	
public intgetSeedCount()

		PeerManager	pm = download.getPeerManager();
				
		if ( pm != null ){
			
			return( pm.getStats().getConnectedSeeds());
		}
		
		return( 0 );
	
public longgetTimeToWait()

		if ( response == null ){
			
			return( -1 );
		}
		
		return( response.getTimeToWait());
	
public java.net.URLgetURL()

		return( response==null?null:response.getURL());
	
public voidsetContent(TRTrackerAnnouncerResponse _response)

		response = _response;