|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xnap.transfer.AbstractTransfer org.xnap.plugin.opennap.net.OpenNapDownload
public class OpenNapDownload
Downloads a file.
Field Summary | |
---|---|
static State |
AQUIRING_SLOT
Operation has been aborted. |
static int |
MAX_RESPONSE_LAG
If no reponse is received within MAX_RESPONSE_LAG milli seconds the peer is considered to be offline and the download is stopped. |
static int |
MAX_WANT_QUEUE
Do not send //WantQueue more times than this. |
static int |
QUEUED_REQUEST_FACTOR
Requests are sent in REQUEST_INTERVAL * QUEUED_REQUEST_FACTOR if the download is remotely queued. |
static int |
REQUEST_INTERVAL
Requests are sent in this interval if this download could not be remotely queued. |
static int |
WAITING_TIMEOUT
The maximum time to wait for a connect from the other peer in case of a firewalled download. |
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 | |
---|---|
OpenNapDownload(OpenNapDownloadContainer parent,
OpenNapSearchResult result)
|
Method Summary | |
---|---|
void |
exceptionThrown(java.lang.Exception e)
|
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.io.File |
getFile()
Returns the file the transfer is using. |
long |
getFilesize()
Returns the final filesize. |
Peer |
getPeer()
Returns the peer. |
Plugin |
getPlugin()
Returns the plugin. |
int |
getQueuePosition()
Returns -1. |
OpenNapSearchResult |
getResult()
|
OpenNapSegment |
getSegment()
|
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 |
isQueued()
|
boolean |
isRestartable()
|
boolean |
isRunning()
Returns true if the transfer is running. |
void |
messageReceived(ServerMessage m)
Handles messages received from the server as response to the download request. |
boolean |
socketReceived(IncomingSocket s)
Invoked when an incoming connect is recognized. |
void |
stateChanged(StateEvent e)
Invoked when the user download slot state changes. |
Methods inherited from class org.xnap.transfer.AbstractTransfer |
---|
addStateListener, cleared, getAverageRate, getCurrentRate, getDescription, getElapsedTime, getFilename, 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, getDescription, getFilename, getIcon, getRemainingTime, removeStateListener |
Field Detail |
---|
public static final int MAX_WANT_QUEUE
public static final int REQUEST_INTERVAL
public static final int QUEUED_REQUEST_FACTOR
public static final int MAX_RESPONSE_LAG
This should be greater than REQUEST_INTERVAL * QUEUED_REQUEST_FACTOR.
public static final int WAITING_TIMEOUT
public static final State AQUIRING_SLOT
Constructor Detail |
---|
public OpenNapDownload(OpenNapDownloadContainer parent, OpenNapSearchResult result)
Method Detail |
---|
public long getBytesTransferred()
AbstractTransfer
getBytesTransferred
in class AbstractTransfer
AbstractTransfer.getCurrentRate()
public javax.swing.Action[] getActions()
Transfer
getActions
in interface Transfer
public java.io.File getFile()
Transfer
getFile
in interface Transfer
public long getFilesize()
Transfer
getFilesize
in interface Transfer
getFilesize
in class AbstractTransfer
public Peer getPeer()
Transfer
getPeer
in interface Transfer
public Plugin getPlugin()
Transfer
getPlugin
in interface Transfer
public OpenNapSearchResult getResult()
public OpenNapSegment getSegment()
public Segment[] getSegments()
Transfer
getSegments
in interface Transfer
getSegments
in class AbstractTransfer
public java.lang.String getStatus()
Transfer
getStatus
in interface Transfer
public long getTotalBytesTransferred()
Transfer
getTotalBytesTransferred
in interface Transfer
public boolean isDone()
Transfer
isDone
in interface Transfer
public boolean isRestartable()
public boolean isRunning()
Transfer
isRunning
in interface Transfer
public boolean isQueued()
public boolean socketReceived(IncomingSocket s)
SocketListener
socketReceived
in interface SocketListener
public int getQueuePosition()
AbstractTransfer
getQueuePosition
in interface Transfer
getQueuePosition
in class AbstractTransfer
public void stateChanged(StateEvent e)
stateChanged
in interface StateListener
public void exceptionThrown(java.lang.Exception e)
exceptionThrown
in interface ExceptionListener
public void messageReceived(ServerMessage m)
messageReceived
in interface MessageListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |