org.xnap.plugin.overnet.net
Class OvernetDownload

java.lang.Object
  extended by org.xnap.transfer.AbstractTransfer
      extended by org.xnap.transfer.AbstractDownload
          extended by org.xnap.plugin.overnet.net.OvernetDownload
All Implemented Interfaces:
MessageListener, Download, Transfer, TransferContainer

public class OvernetDownload
extends AbstractDownload
implements MessageListener


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
OvernetDownload(NewDownloadMessage nm)
           
 
Method Summary
 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.
 long getCurrentRate()
          Returns the current download rate.
 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.
 javax.swing.Icon getIcon()
          Returns null.
 Peer getPeer()
          Returns the peer.
 Plugin getPlugin()
          Returns the plugin.
 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 isFailed()
           
 boolean isRunning()
          Returns true if the transfer is running.
 void messageReceived(OvernetMessage msg)
           
 void transferStopped()
          Sub classes should invoke this method when the transfer has stopped.
 void update(UpdateDownloadMessage um)
           
 void updateGaps(GapsMessage gm)
           
 
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, getElapsedTime, getQueuePosition, getRemainingTime, removeStateListener, stateChanged, toString, transferStarted
 
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, getQueuePosition, getRemainingTime, removeStateListener
 

Constructor Detail

OvernetDownload

public OvernetDownload(NewDownloadMessage nm)
Method Detail

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

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()

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

getFilesize

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

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

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

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

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

getIcon

public javax.swing.Icon getIcon()
Description copied from class: AbstractTransfer
Returns null.

Specified by:
getIcon in interface Transfer
Overrides:
getIcon 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

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

isFailed

public boolean isFailed()

getCurrentRate

public long getCurrentRate()
Description copied from class: AbstractTransfer
Returns the current download rate. Take at least a RECALC_INTERVAL into account to avoid jumping values all the time.

Specified by:
getCurrentRate in interface Transfer
Overrides:
getCurrentRate in class AbstractTransfer
Returns:
byte / s

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

update

public void update(UpdateDownloadMessage um)

transferStopped

public void transferStopped()
Description copied from class: AbstractTransfer
Sub classes should invoke this method when the transfer has stopped.

Overrides:
transferStopped in class AbstractTransfer

messageReceived

public void messageReceived(OvernetMessage msg)
Specified by:
messageReceived in interface MessageListener

updateGaps

public void updateGaps(GapsMessage gm)

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)


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