FileDocCategorySizeDatePackage
GlobalManager.javaAPI DocAzureus 3.0.3.410827Thu Aug 09 14:55:12 BST 2007org.gudy.azureus2.core3.global

GlobalManager

public interface GlobalManager implements com.aelitis.azureus.core.AzureusCoreComponent
The GlobalManager contains a list of all the downloads (DownloadManager objects) that Azureus controls.

Fields Summary
Constructors Summary
Methods Summary
public DownloadManageraddDownloadManager(java.lang.String file_name, java.lang.String save_path)
Create and add a Download Manager to the global list

param
file_name location and name of torrent file
param
save_path path to write the data to
return
The Downloadmanger based on the supplied information.
May return an existing DownloadManager if torrent was already in GlobalManager.

public DownloadManageraddDownloadManager(java.lang.String fileName, byte[] optionalHash, java.lang.String savePath, int initialState, boolean persistent)
Create and add a Download Manager to the global list

param
fileName location and name of torrent file
param
savePath path to write the data to
param
initialState Initial state of download. See DownloadManager.STATE_*
param
persistent Whether the download should be treated as persistent download
return
The Downloadmanger based on the supplied information.
May return an existing DownloadManager if torrent was already in GlobalManager.

public DownloadManageraddDownloadManager(java.lang.String fileName, byte[] optionalHash, java.lang.String savePath, int initialState, boolean persistent, boolean for_seeding, DownloadManagerInitialisationAdapter adapter)
Create and add a Download Manager to the global list

param
fileName location and name of torrent file
param
savePath path to write the data to
param
initialState Initial state of download. See DownloadManager.STATE_*
param
persistent Whether the download should be treated as persistent download
param
for_seeding Whether the manager should assume the torrent is already complete and ready for seeding.
return
The Downloadmanger based on the supplied information.
May return an existing DownloadManager if torrent was already in GlobalManager.

public voidaddDownloadManagerInitialisationAdapter(DownloadManagerInitialisationAdapter adapter)
Any adapters added will get a chance to see/set the initial state of downloads as they are added

param
adapter

public voidaddDownloadWillBeRemovedListener(GlobalManagerDownloadWillBeRemovedListener l)
Add a listener triggered when Download is about to be removed

param
l Listener to add

public voidaddListener(GlobalManagerListener l)
Add a Global Manager listener

param
l Listener to add

public voidaddListener(GlobalManagerListener listener, boolean trigger)

param
listener
param
trigger

public voidcanDownloadManagerBeRemoved(DownloadManager dm, boolean remove_torrent, boolean remove_data)
Determines whether a DownloadManager can be removed

param
dm DownloadManager to check
throws
GlobalManagerDownloadRemovalVetoException

public booleancanPauseDownloads()
Indicates whether or not there are any downloads that can be paused.

return
true if there is at least one download to pause, false if none

public booleancanResumeDownloads()
Indicates whether or not there are any paused downloads to resume.

return
true if there is at least one download to resume, false if none.

public intdownloadManagerCount(boolean bCompleted)
Retrieve the number of download managers the global manager is managing.

param
bCompleted True: Return count of completed downloads
False: Return count of incomplete downloads
return
count

public voidfixUpDownloadManagerPositions()
Verifies the positions of the DownloadManagers, filling in gaps and shifting duplicate IDs down if necessary.

This does not need to be called after MoveXXX, addDownloadManager, or removeDownloadManager functions.

public DownloadManagergetDownloadManager(org.gudy.azureus2.core3.torrent.TOTorrent torrent)
Retrieve the DownloadManager associated with a TOTorrent object

param
torrent Torrent to search for
return
The DownloadManager associted with the TOTOrrent, or null if none found

public DownloadManagergetDownloadManager(org.gudy.azureus2.core3.util.HashWrapper hash)
Retrieve the DownloadManager associated with a hash

param
hash Hash to search for
return
The DownloadManager associted with the hash, or null if none found

public java.util.ListgetDownloadManagers()
Retrieve a list of {@link DownloadManager}s that GlobalManager is handling

return
a list of {@link DownloadManager}s

public intgetIndexOf(DownloadManager dm)
Retrieve the index of a DownloadManager within the GlobalManager list retrieved via {@link #getDownloadManagers()}.

This is NOT the DownloadManager's position

param
dm DownloadManger to find the index of
return
index, -1 if not in list
deprecated
Should not be used, as indexes may be different than when getDownloadManagers() was called.

public intgetNATStatus()
See plugin ConnectionManager.NAT_ constants for return values

return
ConnectionManager.NAT_*

public GlobalManagerStatsgetStats()
Retrieve the Global Manager Statistics class

return
the Global Manager Statistics class

public TRTrackerScrapergetTrackerScraper()
Retrieve the Tracker Scraper management class

return
Tracker Scraper management class

public booleanisMoveableDown(DownloadManager dm)
Retrieve whether a DownloadManager can move down in the GlobalManager list

param
dm DownloadManager to check
return
True - Can move down

public booleanisMoveableUp(DownloadManager dm)
Retrieve whether a DownloadManager can move up in the GlobalManager list

param
dm DownloadManager to check
return
True - Can move up

public booleanisPaused(DownloadManager dm)
Retrieve whether a DownloadManager is in a paused state

param
dm DownloadManager to query
return
the pause state

public booleanisSeedingOnly()
Determines whether we are only seeding, and not currently downloading anything.

return
Seeding Only State

public voidloadExistingTorrentsNow(boolean async)

param
listener

public voidmoveDown(DownloadManager dm)
Move one DownloadManager down in the GlobalManager's list

param
dm DownloadManager to move down

public voidmoveEnd(DownloadManager[] dm)
Move a list of DownloadManagers to the end of the GlobalManager list

param
dm array list of DownloadManager objects to move

public voidmoveTo(DownloadManager manager, int newPosition)
Move a Downloadmanager to a new position.

param
manager DownloadManager to move
param
newPosition position to place

public voidmoveTop(DownloadManager[] dm)
Move a list of DownloadManagers to the top of the GlobalManager list

param
dm array list of DownloadManager objects to move

public voidmoveUp(DownloadManager dm)
Move one DownloadManager up in the GlobalManager's list

param
dm DownloadManager to move up

public booleanpauseDownload(DownloadManager dm)
Pause one DownloadManager

param
dm DownloadManager to pause
return
False if DownloadManager was invalid, stopped, or pause failed

public voidpauseDownloads()
Pauses (stops) all running downloads/seedings.

public voidremoveDownloadManager(DownloadManager dm)
Removes a DownloadManager from the global list, providing it can be removed (see {@link #canDownloadManagerBeRemoved(DownloadManager)})

The DownloadManager will not be stopped if it is running. Scraping, however, will be turned off.

param
dm DownloadManager to remove
throws
GlobalManagerDownloadRemovalVetoException

public voidremoveDownloadManager(DownloadManager manager, boolean remove_torrent, boolean remove_data)

param
manager
param
remove_torrent
param
remove_data
throws
GlobalManagerDownloadRemovalVetoException
since
3.0.1.7

public voidremoveDownloadManagerInitialisationAdapter(DownloadManagerInitialisationAdapter adapter)

public voidremoveDownloadWillBeRemovedListener(GlobalManagerDownloadWillBeRemovedListener l)
Remove a listener triggered when Download is about to be removed

param
l Listener to remove

public voidremoveListener(GlobalManagerListener l)
Removes a Global Manager listener

param
l Listener to remove

public voidresumeDownload(DownloadManager dm)
Resume a previously paused DownloadManager

param
dm DownloadManager to resume

public voidresumeDownloads()
Resumes (starts) all downloads paused by the previous pauseDownloads call.

public voidstartAllDownloads()
Starts all downloads

public voidstopAllDownloads()
Stops all downloads without removing them

author
Rene Leonhardt

public voidstopGlobalManager()
Puts GlobalManager in a stopped state.
Used when closing down Azureus.