|
||||||||||
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.transfer.AbstractDownload org.xnap.plugin.opennap.net.OpenNapDownloadContainer
public class OpenNapDownloadContainer
Field Summary | |
---|---|
static int |
INITIAL_SEARCH_INTERVAL
The initial auto search interval. |
static int |
MAX_SEARCH_COUNT
Maximum number of auto searches. |
static int |
MAX_SEARCH_INTERVAL
The upper bound for the search interval. |
Fields inherited from class org.xnap.transfer.AbstractTransfer |
---|
logger, MIN_RECALC_INTERVAL, RECALC_INTERVAL, SOCKET_TIMEOUT |
Fields inherited from interface org.xnap.transfer.Transfer |
---|
TRANSFER_TIMEOUT |
Constructor Summary | |
---|---|
OpenNapDownloadContainer(OpenNapDownloadContainerData data)
Invoked by OpenNapResumeRepository when restoring download from
resume data. |
|
OpenNapDownloadContainer(OpenNapSearchResult[] results)
|
Method Summary | |
---|---|
boolean |
add(OpenNapSearchResult result,
boolean matchFilter)
Creates a new download for result and adds it as a child. |
void |
cleared()
Notifies the OpenNapTransferManager that the download
was removed. |
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 |
getEnqueueTime()
Returns the time when the queueable was enqueued in milli seconds. |
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. |
int |
getPriority()
Returns 1. |
int |
getQueuePosition()
Returns the position in the DownloadManager queue. |
SearchFilter |
getSearchFilter()
|
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 |
isAutoSearchingEnabled()
|
boolean |
isDone()
Returns true if the transfer is finished. |
boolean |
isRunning()
Returns true if the transfer is running. |
void |
resultReceived(SearchResult result)
Invoked when result is received. |
void |
setAutoSearchingEnabled(boolean autoSearchingEnabled)
|
void |
setFilename(java.lang.String filename)
|
void |
setQueuePosition(int position)
Invoked by the queue to update the position. |
void |
setSearchFilter(SearchFilter filter)
|
boolean |
startTransfer()
Invoked when the user manually starts the download or if it reaches to the top of the queue. |
void |
stateChanged(Search search)
Invoked when the state of search changes. |
void |
stop()
|
protected void |
transferStarted()
Invoked by OpenNapDownload children when DOWNLOADING
state is entered. |
protected void |
transferStopped()
Invoked by OpenNapDownload children when DOWNLOADING
state is left. |
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, getAverageRate, getCurrentRate, getDescription, getElapsedTime, getRemainingTime, removeStateListener, stateChanged, toString |
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, getAverageRate, getCurrentRate, getDescription, getRemainingTime, removeStateListener |
Field Detail |
---|
public static final int INITIAL_SEARCH_INTERVAL
public static final int MAX_SEARCH_INTERVAL
public static final int MAX_SEARCH_COUNT
Constructor Detail |
---|
public OpenNapDownloadContainer(OpenNapSearchResult[] results)
public OpenNapDownloadContainer(OpenNapDownloadContainerData data)
OpenNapResumeRepository
when restoring download from
resume data.
Method Detail |
---|
public boolean add(OpenNapSearchResult result, boolean matchFilter)
public void cleared()
OpenNapTransferManager
that the download
was removed. Invoked by DownloadManager
when the
download is done and clear finished is executed by user.
cleared
in interface Transfer
cleared
in class AbstractTransfer
public long getEnqueueTime()
Queueable
getEnqueueTime
in interface Queueable
public java.lang.String getFilename()
Transfer
getFilename
in interface Queueable
getFilename
in interface Transfer
getFilename
in class AbstractTransfer
Transfer.getFilename()
public long getFilesize()
Transfer
getFilesize
in interface Queueable
getFilesize
in interface Transfer
getFilesize
in class AbstractTransfer
Transfer.getFilesize()
public Plugin getPlugin()
Transfer
getPlugin
in interface Transfer
public javax.swing.Action[] getActions()
Transfer
getActions
in interface Transfer
xnap.transfer.Transfer#getActions()
public long getBytesTransferred()
AbstractTransfer
getBytesTransferred
in class AbstractTransfer
AbstractTransfer.getCurrentRate()
public java.io.File getFile()
Transfer
getFile
in interface Transfer
xnap.transfer.Transfer#getFile()
public javax.swing.Icon getIcon()
AbstractTransfer
getIcon
in interface Transfer
getIcon
in class AbstractTransfer
public int getPriority()
getPriority
in interface Queueable
public int getQueuePosition()
DownloadManager
queue.
getQueuePosition
in interface Queueable
getQueuePosition
in interface Transfer
getQueuePosition
in class AbstractTransfer
public Peer getPeer()
Transfer
getPeer
in interface Queueable
getPeer
in interface Transfer
xnap.transfer.Transfer#getPeer()
public SearchFilter getSearchFilter()
public Segment[] getSegments()
Transfer
getSegments
in interface Transfer
getSegments
in class AbstractTransfer
public java.lang.String getStatus()
Transfer
getStatus
in interface Transfer
xnap.transfer.Transfer#getStatus()
public long getTotalBytesTransferred()
Transfer
getTotalBytesTransferred
in interface Transfer
xnap.transfer.Transfer#getTotalBytesTransferred()
public boolean isAutoSearchingEnabled()
public boolean isDone()
Transfer
isDone
in interface Transfer
public boolean isRunning()
Transfer
isRunning
in interface Transfer
public void resultReceived(SearchResult result)
SearchHandler
result
is received.
resultReceived
in interface SearchHandler
public void setAutoSearchingEnabled(boolean autoSearchingEnabled)
public void setFilename(java.lang.String filename)
public void setSearchFilter(SearchFilter filter)
filter
- the search filterpublic void stateChanged(Search search)
search
changes.
stateChanged
in interface SearchHandler
public void setQueuePosition(int position)
Queueable
setQueuePosition
in interface Queueable
position
- if 0, the item has been dequeued from the
queue and startQueued() has been called.public boolean startTransfer()
startTransfer
in interface Queueable
public void stop()
protected void transferStarted()
OpenNapDownload
children when DOWNLOADING
state is entered.
transferStarted
in class AbstractTransfer
protected void transferStopped()
OpenNapDownload
children when DOWNLOADING
state is left.
transferStopped
in class AbstractTransfer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |