|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.pluginsimpl.remote.RPObject org.gudy.azureus2.pluginsimpl.remote.download.RPDownloadManager
public class RPDownloadManager
Field Summary | |
---|---|
protected DownloadManager |
delegate
|
Fields inherited from class org.gudy.azureus2.pluginsimpl.remote.RPObject |
---|
__delegate, _dispatcher, _object_id, next_key, object_registry, object_registry_reverse |
Constructor Summary | |
---|---|
protected |
RPDownloadManager(DownloadManager _delegate)
|
Method Summary | |
---|---|
RPReply |
_process(RPRequest request)
|
protected void |
_setDelegate(Object _delegate)
|
Object |
_setLocal()
|
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)
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 torrentLocation,
File dataLocation)
|
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 |
static RPDownloadManager |
create(DownloadManager _delegate)
|
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 bSort)
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)
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 |
Methods inherited from class org.gudy.azureus2.pluginsimpl.remote.RPObject |
---|
_fixupLocal, _getDelegate, _getName, _getOID, _lookupLocal, _lookupLocal, _refresh, _setRemote, getDispatcher, notSupported, notSupported |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient DownloadManager delegate
Constructor Detail |
---|
protected RPDownloadManager(DownloadManager _delegate)
Method Detail |
---|
public static RPDownloadManager create(DownloadManager _delegate)
protected void _setDelegate(Object _delegate)
_setDelegate
in class RPObject
public Object _setLocal() throws RPException
_setLocal
in class RPObject
RPException
public RPReply _process(RPRequest request)
_process
in class RPObject
public void addDownload(File torrent_file) throws DownloadException
DownloadManager
addDownload
in interface DownloadManager
DownloadException
DownloadManager.addDownload(Torrent)
,
DownloadManager.addDownload(Torrent, File, File)
,
TorrentManager.createFromBEncodedFile
public void addDownload(URL url, URL referer)
DownloadManager
addDownload
in interface DownloadManager
public void addDownload(URL url) throws DownloadException
DownloadManager
addDownload
in interface DownloadManager
DownloadException
public void addDownload(URL url, boolean auto_download) throws DownloadException
DownloadManager
addDownload
in interface DownloadManager
DownloadException
public void addDownload(URL url, Map request_properties)
DownloadManager
addDownload
in interface DownloadManager
public Download addDownload(Torrent torrent) throws DownloadException
DownloadManager
addDownload(Torrent, File, File)
method.
addDownload
in interface DownloadManager
DownloadException
DownloadManager.addDownload(Torrent, File, File)
public Download addDownload(Torrent torrent, File torrent_location, File data_location) throws DownloadException
DownloadManager
addDownload
in interface DownloadManager
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
public Download addDownloadStopped(Torrent torrent, File torrent_location, File data_location) throws DownloadException
DownloadManager
addDownloadStopped
in interface DownloadManager
DownloadException
public Download addNonPersistentDownload(Torrent torrent, File torrent_location, File data_location) throws DownloadException
DownloadManager
addNonPersistentDownload
in interface DownloadManager
DownloadException
public Download addNonPersistentDownloadStopped(Torrent torrent, File torrentLocation, File dataLocation) throws DownloadException
addNonPersistentDownloadStopped
in interface DownloadManager
DownloadException
public void clearNonPersistentDownloadState(byte[] hash)
DownloadManager
clearNonPersistentDownloadState
in interface DownloadManager
public Download getDownload(Torrent torrent)
DownloadManager
getDownload
in interface DownloadManager
public Download getDownload(byte[] hash)
DownloadManager
getDownload
in interface DownloadManager
public Download[] getDownloads()
DownloadManager
getDownloads
in interface DownloadManager
public Download[] getDownloads(boolean bSort)
DownloadManager
getDownloads
in interface DownloadManager
bSort
- true - Returned in Download "index" order.public void pauseDownloads()
DownloadManager
pauseDownloads
in interface DownloadManager
public boolean canPauseDownloads()
canPauseDownloads
in interface DownloadManager
public void resumeDownloads()
DownloadManager
resumeDownloads
in interface DownloadManager
public boolean canResumeDownloads()
canResumeDownloads
in interface DownloadManager
public void startAllDownloads()
DownloadManager
startAllDownloads
in interface DownloadManager
public void stopAllDownloads()
DownloadManager
stopAllDownloads
in interface DownloadManager
public DownloadManagerStats getStats()
DownloadManager
getStats
in interface DownloadManager
public boolean isSeedingOnly()
DownloadManager
isSeedingOnly
in interface DownloadManager
public void addListener(DownloadManagerListener l)
DownloadManager
addListener(l, true)
.
addListener
in interface DownloadManager
l
- The listener to add.DownloadManager.addListener(DownloadManagerListener, boolean)
public void addListener(DownloadManagerListener l, boolean notify)
DownloadManager
addListener
in interface DownloadManager
l
- The listener to add.notify
- 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.public void removeListener(DownloadManagerListener l)
DownloadManager
removeListener(l, false)
.
removeListener
in interface DownloadManager
l
- The listener to remove.DownloadManager.removeListener(DownloadManagerListener, boolean)
public void removeListener(DownloadManagerListener l, boolean notify)
DownloadManager
removeListener
in interface DownloadManager
l
- The listener to remove.notify
- true - if you want the listener to
have its downloadRemoved
method invoked immediately with all downloads currently managed by Azureus,
false otherwise.public void addDownloadWillBeAddedListener(DownloadWillBeAddedListener listener)
addDownloadWillBeAddedListener
in interface DownloadManager
public void removeDownloadWillBeAddedListener(DownloadWillBeAddedListener listener)
removeDownloadWillBeAddedListener
in interface DownloadManager
public DownloadEventNotifier getGlobalDownloadEventNotifier()
DownloadManager
DownloadEventNotifier
object which can be used as
an easy way to register listeners against all downloads handled by
Azureus.
getGlobalDownloadEventNotifier
in interface DownloadManager
public void setSaveLocationManager(SaveLocationManager manager)
DownloadManager
By default, Azureus will use its default save location manager which handles on-completion and on-removal events.
setSaveLocationManager
in interface DownloadManager
manager
- The new manager object to use.public SaveLocationManager getSaveLocationManager()
DownloadManager
SaveLocationManager
object which decides
where downloads should be placed.
getSaveLocationManager
in interface DownloadManager
public DefaultSaveLocationManager getDefaultSaveLocationManager()
DownloadManager
SaveLocationManager
object that controls
where downloads should be placed.
getDefaultSaveLocationManager
in interface DownloadManager
public DownloadStub[] getDownloadStubs()
getDownloadStubs
in interface DownloadManager
public int getDownloadStubCount()
getDownloadStubCount
in interface DownloadManager
public DownloadStub lookupDownloadStub(byte[] hash)
lookupDownloadStub
in interface DownloadManager
public void addDownloadStubListener(DownloadStubListener l, boolean inform_of_current)
addDownloadStubListener
in interface DownloadManager
public void removeDownloadStubListener(DownloadStubListener l)
removeDownloadStubListener
in interface DownloadManager
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |