|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.downloader.ManagedDownloader
com.limegroup.gnutella.downloader.RequeryDownloader
A wishlist ManagedDownloader. This is initially with only a list of search keywords (e.g., from the user)--with no RemoteFileDesc's. It will requery the network with the given keywords. When it gets a result that matches the query, it will start downloading from that location. Subsequently this will behave like a standard ManagedDownloader, only accepting RemoteFileDesc's matching the current set of RemoteFileDesc's.
Field Summary | |
protected AutoDownloadDetails |
_add
Contains the specifics of the search that spawned me. |
Fields inherited from class com.limegroup.gnutella.downloader.ManagedDownloader |
UNKNOWN_FILENAME |
Fields inherited from interface com.limegroup.gnutella.Downloader |
ABORTED, COMPLETE, CONNECTING, CORRUPT_FILE, COULDNT_MOVE_TO_LIBRARY, DOWNLOADING, GAVE_UP, HASHING, QUEUED, REMOTE_QUEUED, SAVING, WAITING_FOR_CONNECTIONS, WAITING_FOR_RESULTS, WAITING_FOR_RETRY, WAITING_FOR_USER |
Constructor Summary | |
RequeryDownloader(IncompleteFileManager incompleteFileManager,
AutoDownloadDetails add)
Creates a new RequeryDownloader - a RequeryDownloader has no files initially associated with it, but it may have them later (via calls to addDownload(). |
Method Summary | |
protected boolean |
allowAddition(RemoteFileDesc other)
Overrides ManagedDownloader to allow any RemoteFileDesc that matches this' keywords. |
boolean |
conflicts(AutoDownloadDetails add)
Returns true if the parameters of the add are sufficiently similar such that spawning a new RequeryDownloader would be redundant. |
int |
getContentLength()
Need to override this until ManagedDownloader has a allFiles of non-zero length. |
protected long[] |
getFailedState(boolean deserialized,
long timeSpentWaiting)
This method is called when 1) all downloads sources failed 2) there are no busy hosts 3) there is no room for a requery Subclasses should override this method if they want to enforce special behavior before going to the GAVE_UP state. |
java.lang.String |
getFileName()
Need to override this until ManagedDownloader has a allFiles of non-zero length. |
protected int |
getQueryCount(boolean deserializedFromDisk)
We need to offer this to subclasses to override because they might have specific behavior when deserialized from disk. |
protected QueryRequest |
newRequery(int numRequeries)
Overrides ManagedDownloader to use the original search keywords. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected AutoDownloadDetails _add
Constructor Detail |
public RequeryDownloader(IncompleteFileManager incompleteFileManager, AutoDownloadDetails add)
incompleteFileManager
- the repository of incomplete files for
resumingadd
- the keywords to requery withMethod Detail |
public boolean conflicts(AutoDownloadDetails add)
protected long[] getFailedState(boolean deserialized, long timeSpentWaiting)
ManagedDownloader
getFailedState
in class ManagedDownloader
deserialized
- true if this downloader was initialized from disk,
false if it is brand new.timeSpentWaiting
- the millisecond time that the downloader has
spent in the failed state.
protected int getQueryCount(boolean deserializedFromDisk)
ManagedDownloader
getQueryCount
in class ManagedDownloader
protected QueryRequest newRequery(int numRequeries) throws CantResumeException
newRequery
in class ManagedDownloader
numRequeries
- the number of requeries that have already happened
CantResumeException
- if this doesn't know what to search forprotected boolean allowAddition(RemoteFileDesc other)
allowAddition
in class ManagedDownloader
public java.lang.String getFileName()
getFileName
in interface Downloader
getFileName
in class ManagedDownloader
public int getContentLength()
getContentLength
in interface Downloader
getContentLength
in class ManagedDownloader
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |