|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DownloadManager
The DownloadManager gives access to functions used to monitor and manage Azureus's downloads
Method Summary | |
---|---|
void |
addDownload(File torrent_file)
Add a torrent from a file. |
Download |
addDownload(Torrent torrent)
Add a torrent from a "Torrent" object. |
Download |
addDownload(Torrent torrent,
File torrent_location,
File data_location)
Add a torrent from a "Torrent" object and point it at the data location. |
void |
addDownload(URL url)
add a torrent from a URL. |
void |
addDownload(URL url,
boolean auto_download)
Add a torrent from a URL with explicit auto-download option |
void |
addDownload(URL url,
Map request_properties)
add a torrent from a URL and use the supplied request properties |
void |
addDownload(URL url,
URL referer)
add a torrent from a URL. |
Download |
addDownloadStopped(Torrent torrent,
File torrent_location,
File data_location)
Explicit way of adding a download in a stopped state |
void |
addDownloadStubListener(DownloadStubListener l,
boolean inform_of_current)
|
void |
addDownloadWillBeAddedListener(DownloadWillBeAddedListener listener)
|
void |
addListener(DownloadManagerListener l)
Add a listener that will be informed when a download is added to and removed from Azureus. |
void |
addListener(DownloadManagerListener l,
boolean notify_of_current_downloads)
Add a listener that will be informed when a download is added to and removed from Azureus. |
Download |
addNonPersistentDownload(Torrent torrent,
File torrent_location,
File data_location)
Add a non-persistent download. |
Download |
addNonPersistentDownloadStopped(Torrent torrent,
File torrent_location,
File data_location)
|
boolean |
canPauseDownloads()
|
boolean |
canResumeDownloads()
|
void |
clearNonPersistentDownloadState(byte[] hash)
Although non-persistent downloads themselves aren't rememebered across restarts, some internal stats are (for continuity, like total up/down, file allocation state) - this method allows this to be removed |
DefaultSaveLocationManager |
getDefaultSaveLocationManager()
Returns the default SaveLocationManager object that controls
where downloads should be placed. |
Download |
getDownload(byte[] hash)
Gets a download given its hash |
Download |
getDownload(Torrent torrent)
Gets the download for a particular torrent, returns null if not found |
Download[] |
getDownloads()
Gets all the downloads. |
Download[] |
getDownloads(boolean bSorted)
Gets all the downloads. |
int |
getDownloadStubCount()
|
DownloadStub[] |
getDownloadStubs()
|
DownloadEventNotifier |
getGlobalDownloadEventNotifier()
Return a DownloadEventNotifier object which can be used as
an easy way to register listeners against all downloads handled by
Azureus. |
SaveLocationManager |
getSaveLocationManager()
Returns the current SaveLocationManager object which decides
where downloads should be placed. |
DownloadManagerStats |
getStats()
Get the download manager statistics |
boolean |
isSeedingOnly()
indicates whether or not all active downloads are in a seeding (or effective) seeding state |
DownloadStub |
lookupDownloadStub(byte[] hash)
|
void |
pauseDownloads()
pause all running downloads |
void |
removeDownloadStubListener(DownloadStubListener l)
|
void |
removeDownloadWillBeAddedListener(DownloadWillBeAddedListener listener)
|
void |
removeListener(DownloadManagerListener l)
Removes a previously added listener. |
void |
removeListener(DownloadManagerListener l,
boolean notify_of_current_downloads)
Removes a previously added listener. |
void |
resumeDownloads()
resume previously paused downloads |
void |
setSaveLocationManager(SaveLocationManager manager)
Registers an object to be in control of determining the default save location for downloads. |
void |
startAllDownloads()
starts all non-running downloads |
void |
stopAllDownloads()
stops all running downloads |
Method Detail |
---|
void addDownload(File torrent_file) throws DownloadException
torrent_file
-
DownloadException
addDownload(Torrent)
,
addDownload(Torrent, File, File)
,
TorrentManager.createFromBEncodedFile
void addDownload(URL url) throws DownloadException
url
-
DownloadException
void addDownload(URL url, boolean auto_download) throws DownloadException
url
- auto_download
-
DownloadException
void addDownload(URL url, URL referer)
url
- referer
-
DownloadException
void addDownload(URL url, Map request_properties)
url
- request_properties
- Download addDownload(Torrent torrent) throws DownloadException
addDownload(Torrent, File, File)
method.
torrent
-
DownloadException
addDownload(Torrent, File, File)
Download addDownload(Torrent torrent, File torrent_location, File data_location) throws DownloadException
torrent
- The torrent object to create a download with.torrent_location
- The location of the file on disk - if null
,
a file to store the torrent data into will be created automatically.data_location
- null -> user default data save location if defined
DownloadException
Download addDownloadStopped(Torrent torrent, File torrent_location, File data_location) throws DownloadException
torrent
- torrent_location
- data_location
-
DownloadException
Download addNonPersistentDownload(Torrent torrent, File torrent_location, File data_location) throws DownloadException
torrent
- torrent_location
- data_location
-
DownloadException
Download addNonPersistentDownloadStopped(Torrent torrent, File torrent_location, File data_location) throws DownloadException
DownloadException
void clearNonPersistentDownloadState(byte[] hash)
hash
- Download getDownload(Torrent torrent)
torrent
-
Download getDownload(byte[] hash) throws DownloadException
hash
-
DownloadException
Download[] getDownloads()
Download[] getDownloads(boolean bSorted)
bSorted
- true - Returned in Download "index" order.void pauseDownloads()
boolean canPauseDownloads()
void resumeDownloads()
boolean canResumeDownloads()
void startAllDownloads()
void stopAllDownloads()
DownloadManagerStats getStats()
boolean isSeedingOnly()
void addListener(DownloadManagerListener l)
addListener(l, true)
.
l
- The listener to add.addListener(DownloadManagerListener, boolean)
void addListener(DownloadManagerListener l, boolean notify_of_current_downloads)
l
- The listener to add.notify_of_current_downloads
- true - if you want the listener to
have its downloadAdded
method invoked immediately with all downloads currently managed by Azureus.
false - if you only want to be notified about new downloads added after
this method is called.void removeListener(DownloadManagerListener l, boolean notify_of_current_downloads)
l
- The listener to remove.notify_of_current_downloads
- true - if you want the listener to
have its downloadRemoved
method invoked immediately with all downloads currently managed by Azureus,
false otherwise.void removeListener(DownloadManagerListener l)
removeListener(l, false)
.
l
- The listener to remove.removeListener(DownloadManagerListener, boolean)
void addDownloadWillBeAddedListener(DownloadWillBeAddedListener listener)
void removeDownloadWillBeAddedListener(DownloadWillBeAddedListener listener)
DownloadEventNotifier getGlobalDownloadEventNotifier()
DownloadEventNotifier
object which can be used as
an easy way to register listeners against all downloads handled by
Azureus.
void setSaveLocationManager(SaveLocationManager manager)
By default, Azureus will use its default save location manager which handles on-completion and on-removal events.
manager
- The new manager object to use.SaveLocationManager getSaveLocationManager()
SaveLocationManager
object which decides
where downloads should be placed.
DefaultSaveLocationManager getDefaultSaveLocationManager()
SaveLocationManager
object that controls
where downloads should be placed.
DownloadStub[] getDownloadStubs()
DownloadStub lookupDownloadStub(byte[] hash)
int getDownloadStubCount()
void addDownloadStubListener(DownloadStubListener l, boolean inform_of_current)
void removeDownloadStubListener(DownloadStubListener l)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |