|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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 AbstractTransferAbstractTransfer.getCurrentRate()public javax.swing.Action[] getActions()
Transfer
getActions in interface Transferpublic java.io.File getFile()
Transfer
getFile in interface Transferpublic long getFilesize()
Transfer
getFilesize in interface TransfergetFilesize in class AbstractTransferpublic Peer getPeer()
Transfer
getPeer in interface Transferpublic Plugin getPlugin()
Transfer
getPlugin in interface Transferpublic OpenNapSearchResult getResult()
public OpenNapSegment getSegment()
public Segment[] getSegments()
Transfer
getSegments in interface TransfergetSegments in class AbstractTransferpublic java.lang.String getStatus()
Transfer
getStatus in interface Transferpublic long getTotalBytesTransferred()
Transfer
getTotalBytesTransferred in interface Transferpublic boolean isDone()
Transfer
isDone in interface Transferpublic boolean isRestartable()
public boolean isRunning()
Transfer
isRunning in interface Transferpublic boolean isQueued()
public boolean socketReceived(IncomingSocket s)
SocketListener
socketReceived in interface SocketListenerpublic int getQueuePosition()
AbstractTransfer
getQueuePosition in interface TransfergetQueuePosition in class AbstractTransferpublic void stateChanged(StateEvent e)
stateChanged in interface StateListenerpublic void exceptionThrown(java.lang.Exception e)
exceptionThrown in interface ExceptionListenerpublic void messageReceived(ServerMessage m)
messageReceived in interface MessageListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||