org.xnap.plugin.azureus
Class AzureusDownloadContainer

java.lang.Object
  extended by org.xnap.transfer.AbstractTransfer
      extended by org.xnap.transfer.AbstractDownload
          extended by org.xnap.plugin.azureus.AzureusDownloadContainer
All Implemented Interfaces:
org.gudy.azureus2.core3.download.DownloadManagerListener, org.gudy.azureus2.core3.download.DownloadManagerPeerListener, org.gudy.azureus2.core3.download.DownloadManagerTrackerListener, Download, Transfer, TransferContainer

public class AzureusDownloadContainer
extends AbstractDownload
implements org.gudy.azureus2.core3.download.DownloadManagerListener, org.gudy.azureus2.core3.download.DownloadManagerPeerListener, org.gudy.azureus2.core3.download.DownloadManagerTrackerListener

Manages AzureusDownload objects.


Field Summary
 
Fields inherited from class org.xnap.transfer.AbstractTransfer
MIN_RECALC_INTERVAL, RECALC_INTERVAL, SOCKET_TIMEOUT
 
Fields inherited from interface org.xnap.transfer.Transfer
TRANSFER_TIMEOUT
 
Constructor Summary
AzureusDownloadContainer(org.gudy.azureus2.core3.download.DownloadManager manager)
           
 
Method Summary
 void announceResult(org.gudy.azureus2.core3.tracker.client.TRTrackerResponse response)
           
 void completionChanged(org.gudy.azureus2.core3.download.DownloadManager manager, boolean bCompleted)
           
 void downloadComplete(org.gudy.azureus2.core3.download.DownloadManager manager)
           
 javax.swing.Action[] getActions()
          Returns the actions that can performed by the transfer.
 long getBytesTransferred()
          Returns how many bytes have been transferred since the transfer was started.
 java.lang.String getDescription()
          Returns null.
 java.io.File getFile()
          Returns the file the transfer is using.
 java.lang.String getFilename()
          Returns the filename that should be presented to the user.
 long getFilesize()
          Returns the final filesize.
 org.gudy.azureus2.core3.download.DownloadManager getManager()
           
 Peer getPeer()
          Returns the peer.
 Plugin getPlugin()
          Returns the plugin.
 int getQueuePosition()
          Returns -1;
 Segment[] getSegments()
          Returns the segments for segmented downloads.
 java.lang.String getStatus()
          Returns the current status that should be presented to the user.
 long getTotalBytesTransferred()
          Returns how many bytes have been transferred.
 boolean isDone()
          Returns true if the transfer is finished.
 boolean isRunning()
          Returns true if the transfer is running.
 void peerAdded(org.gudy.azureus2.core3.peer.PEPeer peer)
           
 void peerRemoved(org.gudy.azureus2.core3.peer.PEPeer peer)
           
 void pieceAdded(org.gudy.azureus2.core3.peer.PEPiece piece)
           
 void pieceRemoved(org.gudy.azureus2.core3.peer.PEPiece piece)
           
 void scrapeResult(org.gudy.azureus2.core3.tracker.client.TRTrackerScraperResponse response)
           
 void stateChanged(org.gudy.azureus2.core3.download.DownloadManager manager, int state)
           
 void updateAvailability()
           
 
Methods inherited from class org.xnap.transfer.AbstractDownload
add, addListListener, clearDone, getChildCount, getChildren, iterator, remove, removeListListener
 
Methods inherited from class org.xnap.transfer.AbstractTransfer
addStateListener, cleared, getAverageRate, getCurrentRate, getElapsedTime, getIcon, getRemainingTime, removeStateListener, stateChanged, toString, transferStarted, transferStopped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xnap.transfer.Transfer
addStateListener, cleared, getAverageRate, getCurrentRate, getIcon, getRemainingTime, removeStateListener
 

Constructor Detail

AzureusDownloadContainer

public AzureusDownloadContainer(org.gudy.azureus2.core3.download.DownloadManager manager)
Method Detail

getActions

public javax.swing.Action[] getActions()
Description copied from interface: Transfer
Returns the actions that can performed by the transfer.

Specified by:
getActions in interface Transfer

getBytesTransferred

public long getBytesTransferred()
Description copied from class: AbstractTransfer
Returns how many bytes have been transferred since the transfer was started.

Specified by:
getBytesTransferred in class AbstractTransfer
Returns:
number of transferred bytes
See Also:
AbstractTransfer.getCurrentRate()

getDescription

public java.lang.String getDescription()
Description copied from class: AbstractTransfer
Returns null.

Specified by:
getDescription in interface Transfer
Overrides:
getDescription in class AbstractTransfer
Returns:
null, if no meta information is available

getFile

public java.io.File getFile()
Description copied from interface: Transfer
Returns the file the transfer is using.

Specified by:
getFile in interface Transfer
Returns:
null, if file is unknown; the file, otherwise

getFilename

public java.lang.String getFilename()
Description copied from interface: Transfer
Returns the filename that should be presented to the user.

Specified by:
getFilename in interface Transfer
Overrides:
getFilename in class AbstractTransfer

getFilesize

public long getFilesize()
Description copied from interface: Transfer
Returns the final filesize.

Specified by:
getFilesize in interface Transfer
Overrides:
getFilesize in class AbstractTransfer

getPeer

public Peer getPeer()
Description copied from interface: Transfer
Returns the peer.

Specified by:
getPeer in interface Transfer

getPlugin

public Plugin getPlugin()
Description copied from interface: Transfer
Returns the plugin.

Specified by:
getPlugin in interface Transfer

getSegments

public Segment[] getSegments()
Description copied from interface: Transfer
Returns the segments for segmented downloads.

Specified by:
getSegments in interface Transfer
Overrides:
getSegments in class AbstractTransfer
Returns:
null, if segments are not supported (which means that there is only one segment that represents the whole file)

getStatus

public java.lang.String getStatus()
Description copied from interface: Transfer
Returns the current status that should be presented to the user.

Specified by:
getStatus in interface Transfer

getTotalBytesTransferred

public long getTotalBytesTransferred()
Description copied from interface: Transfer
Returns how many bytes have been transferred.

Specified by:
getTotalBytesTransferred in interface Transfer
Returns:
number of transferred bytes

isDone

public boolean isDone()
Description copied from interface: Transfer
Returns true if the transfer is finished.

Specified by:
isDone in interface Transfer
Returns:
true, if thread has ended and the transfer can be cleared; false if, not yet started or still running

isRunning

public boolean isRunning()
Description copied from interface: Transfer
Returns true if the transfer is running.

Specified by:
isRunning in interface Transfer
Returns:
true, if data is transferred or a connect is in progress; false, if queued, not yet started or done

getQueuePosition

public int getQueuePosition()
Returns -1;

Specified by:
getQueuePosition in interface Transfer
Overrides:
getQueuePosition in class AbstractTransfer
Returns:
-1, if the transfer is not queued, the position otherwise.

stateChanged

public void stateChanged(org.gudy.azureus2.core3.download.DownloadManager manager,
                         int state)
Specified by:
stateChanged in interface org.gudy.azureus2.core3.download.DownloadManagerListener
See Also:
DownloadManagerListener.stateChanged(org.gudy.azureus2.core3.download.DownloadManager, int)

updateAvailability

public void updateAvailability()

downloadComplete

public void downloadComplete(org.gudy.azureus2.core3.download.DownloadManager manager)
Specified by:
downloadComplete in interface org.gudy.azureus2.core3.download.DownloadManagerListener
See Also:
DownloadManagerListener.downloadComplete(org.gudy.azureus2.core3.download.DownloadManager)

completionChanged

public void completionChanged(org.gudy.azureus2.core3.download.DownloadManager manager,
                              boolean bCompleted)
Specified by:
completionChanged in interface org.gudy.azureus2.core3.download.DownloadManagerListener
See Also:
DownloadManagerListener.completionChanged(org.gudy.azureus2.core3.download.DownloadManager, boolean)

peerAdded

public void peerAdded(org.gudy.azureus2.core3.peer.PEPeer peer)
Specified by:
peerAdded in interface org.gudy.azureus2.core3.download.DownloadManagerPeerListener
See Also:
DownloadManagerPeerListener.peerAdded(org.gudy.azureus2.core3.peer.PEPeer)

peerRemoved

public void peerRemoved(org.gudy.azureus2.core3.peer.PEPeer peer)
Specified by:
peerRemoved in interface org.gudy.azureus2.core3.download.DownloadManagerPeerListener
See Also:
DownloadManagerPeerListener.peerRemoved(org.gudy.azureus2.core3.peer.PEPeer)

pieceAdded

public void pieceAdded(org.gudy.azureus2.core3.peer.PEPiece piece)
Specified by:
pieceAdded in interface org.gudy.azureus2.core3.download.DownloadManagerPeerListener
See Also:
DownloadManagerPeerListener.pieceAdded(org.gudy.azureus2.core3.peer.PEPiece)

pieceRemoved

public void pieceRemoved(org.gudy.azureus2.core3.peer.PEPiece piece)
Specified by:
pieceRemoved in interface org.gudy.azureus2.core3.download.DownloadManagerPeerListener
See Also:
DownloadManagerPeerListener.pieceRemoved(org.gudy.azureus2.core3.peer.PEPiece)

scrapeResult

public void scrapeResult(org.gudy.azureus2.core3.tracker.client.TRTrackerScraperResponse response)
Specified by:
scrapeResult in interface org.gudy.azureus2.core3.download.DownloadManagerTrackerListener
See Also:
DownloadManagerTrackerListener.scrapeResult(org.gudy.azureus2.core3.tracker.client.TRTrackerScraperResponse)

announceResult

public void announceResult(org.gudy.azureus2.core3.tracker.client.TRTrackerResponse response)
Specified by:
announceResult in interface org.gudy.azureus2.core3.download.DownloadManagerTrackerListener
See Also:
DownloadManagerTrackerListener.announceResult(org.gudy.azureus2.core3.tracker.client.TRTrackerResponse)

getManager

public org.gudy.azureus2.core3.download.DownloadManager getManager()
Returns:


Copyright © 2001-2005 XNap Team. All Rights Reserved.