Package com.biglybt.core.global.impl
Class GlobalManagerImpl
java.lang.Object
com.biglybt.core.download.impl.DownloadManagerAdapter
com.biglybt.core.global.impl.GlobalManagerImpl
- All Implemented Interfaces:
CoreComponent
,DownloadManagerListener
,GlobalManager
,TaggableResolver
,AEDiagnosticsEvidenceGenerator
,DataSourceResolver.DataSourceImporter
public class GlobalManagerImpl
extends DownloadManagerAdapter
implements GlobalManager, AEDiagnosticsEvidenceGenerator
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
private class
Nested classes/interfaces inherited from interface com.biglybt.core.tag.TaggableResolver
TaggableResolver.LifecycleControlListener
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Object
private final AllTrackersManager.AllTrackers
private long
private boolean
private boolean
private TimerEvent
private final FrequencyLimitedDispatcher
private final GlobalManagerImpl.Checker
private Object
private final boolean
private boolean
(package private) static boolean
private final CopyOnWriteList
<DownloadManagerInitialisationAdapter> private Object
(package private) static boolean
private final GlobalManagerFileMerger
private boolean
private GlobalManagerHostSupport
private boolean
private long
private long
private long
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private final ListenerManager
<Object> (package private) boolean
Whether loading of existing torrents is done(package private) final AESemaphore
Monitor to block adding torrents while loading existing torrent list(package private) DelayedEvent
delay loading of torrents(package private) static final LogIDs
(package private) final Map
<HashWrapper, DownloadManager> (package private) final Map
<DownloadManager, DownloadManager> private DownloadManager[]
private Object
(package private) static int
(package private) static final Object
private static final Object
private String
private String
private int
private long
private boolean
(package private) long
private int
(package private) static long
(package private) static int
private final Map
<HashWrapper, Boolean> private final Map
<HashWrapper, Boolean> private final AEMonitor
private boolean
private final GlobalMangerProgressListener
private MainlineDHTProvider
private final ListenerManager
<GlobalManagerDownloadWillBeRemovedListener> private final Map
<HashWrapper, Map> private boolean
private final GlobalManagerStatsImpl
private GlobalManagerStatsWriter
private final TaggableLifecycleHandler
private final TorrentFolderWatcher
private final TRTrackerScraper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DownloadManager
addDownloadManager
(DownloadManager download_manager, boolean notifyListeners, DownloadManagerInitialisationAdapter adapter, boolean for_seeding, boolean[] is_existing, boolean initial_load) addDownloadManager
(String fileName, byte[] optionalHash, String savePath, int initialState, boolean persistent) Create and add a Download Manager to the global listaddDownloadManager
(String torrent_file_name, byte[] optionalHash, String savePath, int initialState, boolean persistent, boolean for_seeding, DownloadManagerInitialisationAdapter _adapter) Create and add a Download Manager to the global listaddDownloadManager
(String torrent_file_name, byte[] optionalHash, String savePath, String saveFile, int initialState, boolean persistent, boolean for_seeding, DownloadManagerInitialisationAdapter _adapter) Create and add a Download Manager to the global listaddDownloadManager
(String fileName, String savePath) Create and add a Download Manager to the global listvoid
Any adapters added will get a chance to see/set the initial state of downloads as they are addedvoid
Add a listener triggered when Download is about to be removedvoid
addEventListener
(GlobalManagerEventListener listener) void
void
addListener
(GlobalManagerListener listener) Add a Global Manager listener and triggers itvoid
addListener
(GlobalManagerListener listener, boolean trigger) void
canDownloadManagerBeRemoved
(DownloadManager manager, boolean remove_torrent, boolean remove_data) Determines whether a DownloadManager can be removedboolean
canPauseDownload
(DownloadManager manager) boolean
canPauseDownloads
(boolean pause_force_start) boolean
Indicates whether or not there are any paused downloads to resume.protected void
checkForceStart
(boolean known_to_exist) protected void
protected void
void
clearNonPersistentDownloadState
(byte[] hash) protected void
boolean
contains
(DownloadManager manager) private DownloadManager
createAndAddNewDownloadManager
(byte[] torrent_hash, String torrentFileName, String savePath, String saveFile, int initialState, boolean persistent, boolean for_seeding, List file_priorities, DownloadManagerInitialisationAdapter adapter, boolean thisIsMagnet, boolean[] is_existing) private DownloadManager
createNewDownloadManager
(byte[] torrent_hash, String torrentFileName, String savePath, String saveFile, int initialState, boolean persistent, boolean for_seeding, List file_priorities, boolean thisIsMagnet, boolean[] is_existing) int
downloadManagerCount
(boolean bCompleted) Retrieve the number of download managers the global manager is managing.static Long[]
enlargeLongArray
(Long[] array, int expandTo) private Map
exportDownloadStateToMapSupport
(DownloadManager dm, boolean internal_export, boolean interim) void
fireGlobalManagerEvent
(int type, DownloadManager dm, Object data) (package private) void
fixLongFileName
(DownloadManager manager) void
Verifies the positions of the DownloadManagers, filling in gaps and shifting duplicate IDs down if necessary.void
generate
(IndentWriter writer) getDisplayName
(Taggable taggable) protected DownloadManagerInitialisationAdapter
getDownloadManager
(TOTorrent torrent) Retrieve the DownloadManager associated with a TOTorrent objectRetrieve the DownloadManager associated with a hashRetrieve a list ofDownloadManager
s that GlobalManager is handlingObject[]
See plugin ConnectionManager.NAT_ constants for return valuesint
seconds remaining, 0 if not activelong
getStats()
Retrieve the Global Manager Statistics classlong
getTotalSwarmsPeerRate
(boolean downloading, boolean seeding) Retrieve the Tracker Scraper management classimportDataSource
(Map map) protected void
private void
boolean
isMoveableDown
(DownloadManager manager) Retrieve whether a DownloadManager can move down in the GlobalManager listboolean
isMoveableUp
(DownloadManager manager) Retrieve whether a DownloadManager can move up in the GlobalManager listboolean
isPaused
(DownloadManager manager) Retrieve whether a DownloadManager is in a paused stateboolean
As for isSeedingOnly but includes queued seedsboolean
Determines whether we are only seeding, and not currently downloading anything.boolean
boolean
loadDownload
(Map mDownload, int currentDownload, int nbDownloads, GlobalMangerProgressListener progress_listener, boolean debug) (package private) void
static void
void
moveDown
(DownloadManager manager) Move one DownloadManager down in the GlobalManager's listvoid
moveEnd
(DownloadManager[] manager) Move a list of DownloadManagers to the end of the GlobalManager listvoid
moveTo
(DownloadManager manager, int newPosition) Move a Downloadmanager to a new position.void
moveTo
(List<DownloadManager> managers, List<Integer> newPositions) void
moveTop
(DownloadManager[] manager) Move a list of DownloadManagers to the top of the GlobalManager listvoid
moveUp
(DownloadManager manager) Move one DownloadManager up in the GlobalManager's listboolean
pauseDownload
(DownloadManager manager, boolean only_if_active) Pause one DownloadManagervoid
pauseDownloads
(boolean pause_force_start) void
pauseDownloadsForPeriod
(int seconds) pause any non-paused downloads and auto-resume all downloads after n secondsprivate void
pauseDownloadsInternal
(boolean tag_only, boolean pause_force_start) void
removeDownloadManager
(DownloadManager manager) Removes a DownloadManager from the global list, providing it can be removed (seeinvalid reference
#canDownloadManagerBeRemoved(DownloadManager)
void
removeDownloadManager
(DownloadManager manager, boolean remove_torrent, boolean remove_data) void
void
Remove a listener triggered when Download is about to be removedvoid
void
void
removeListener
(GlobalManagerListener listener) Removes a Global Manager listenervoid
void
resumeDownload
(DownloadManager manager) Resume a previously paused DownloadManagervoid
Resumes (starts) all downloads paused by the previous pauseDownloads call.boolean
resumeDownloads
(boolean is_auto_resume) Attempt to automatically resume downloads - request may be denied if manual override in effectboolean
resumingDownload
(DownloadManager manager) This reports that a download is being resumed in order to remove it from the paused set Don't use this to actually resume a download, use resumeDownload !protected void
saveDownloads
(boolean interim, GlobalMangerProgressListener listener_maybe_null) void
protected void
protected boolean
seedPieceRecheck
(DownloadManager manager) void
setMainlineDHTProvider
(MainlineDHTProvider provider) Calling this method doesn't prepare the client to be DHT-ready, it is only used to store, or remove, a DHT provider - so that it can be globally accessible.protected void
setSeedingOnlyState
(boolean seeding, boolean potentially_seeding) private List
<DownloadManager> void
Starts all downloadsvoid
stateChanged
(DownloadManager manager, int new_state) void
statsRequest
(Map request, Map reply) void
Stops all downloads without removing themprotected void
stopAllDownloads
(boolean for_close, GlobalMangerProgressListener listener) void
Puts GlobalManager in a stopped state.
Used when closing down the client.boolean
Don't use me, use dm.stopPausedDownload()private void
triggerAddListener
(List downloadsToAdd) Methods inherited from class com.biglybt.core.download.impl.DownloadManagerAdapter
completionChanged, downloadComplete, filePriorityChanged, positionChanged
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.core.download.DownloadManagerListener
fileLocationChanged
Methods inherited from interface com.biglybt.core.global.GlobalManager
canPauseDownloads, pauseDownloads
-
Field Details
-
LOGID
-
LDT_MANAGER_ADDED
private static final int LDT_MANAGER_ADDED- See Also:
-
LDT_MANAGER_REMOVED
private static final int LDT_MANAGER_REMOVED- See Also:
-
LDT_DESTROY_INITIATED
private static final int LDT_DESTROY_INITIATED- See Also:
-
LDT_DESTROYED
private static final int LDT_DESTROYED- See Also:
-
LDT_SEEDING_ONLY
private static final int LDT_SEEDING_ONLY- See Also:
-
LDT_EVENT
private static final int LDT_EVENT- See Also:
-
listeners_and_event_listeners
-
LDT_MANAGER_WBR
private static final int LDT_MANAGER_WBR- See Also:
-
removal_listeners
-
enable_stopped_scrapes
static boolean enable_stopped_scrapes -
disable_never_started_scrapes
static boolean disable_never_started_scrapes -
no_space_dl_restart_check_period_millis
static int no_space_dl_restart_check_period_millis -
no_space_dl_pause_min_bytes
static long no_space_dl_pause_min_bytes -
missing_file_dl_restart_check_period_millis
static int missing_file_dl_restart_check_period_millis -
missing_file_dl_restart_key
-
ACTIVE_KEY
-
create_dm_lock
-
managers_lock
-
managers_list_cow
-
manager_hash_map
-
manager_id_set
-
progress_listener
-
lastListenerUpdate
private long lastListenerUpdate -
checker
-
stats
-
last_swarm_stats_calc_time
private long last_swarm_stats_calc_time -
last_swarm_stats
private long last_swarm_stats -
cripple_downloads_config
private final boolean cripple_downloads_config -
trackerScraper
-
stats_writer
-
host_support
-
download_history_manager
-
saved_download_manager_state
-
paused_list_initial
-
lcl_map
-
next_seed_piece_recheck_index
private int next_seed_piece_recheck_index -
torrent_folder_watcher
-
paused_list
-
paused_list_mon
-
file_merger
-
isStopping
private volatile boolean isStopping -
destroyed
private volatile boolean destroyed -
needsSavingCozStateChanged
volatile long needsSavingCozStateChanged -
seeding_only_mode
private boolean seeding_only_mode -
potentially_seeding_only_mode
private boolean potentially_seeding_only_mode -
all_trackers
-
all_trackers_options_mut
private long all_trackers_options_mut -
check_seeding_only_state_dispatcher
-
force_start_non_seed_exists
private boolean force_start_non_seed_exists -
nat_status
private int nat_status -
nat_info_prefix
-
nat_info
-
nat_status_last_good
private long nat_status_last_good -
nat_status_probably_ok
private boolean nat_status_probably_ok -
dm_adapters
-
loadTorrentsDelay
DelayedEvent loadTorrentsDelaydelay loading of torrents -
loadingComplete
boolean loadingCompleteWhether loading of existing torrents is done -
loadingSem
Monitor to block adding torrents while loading existing torrent list -
provider
-
auto_resume_on_start
private boolean auto_resume_on_start -
auto_resume_timer
-
auto_resume_disabled
private boolean auto_resume_disabled -
taggable_life_manager
-
ds_tagger
-
MOVE_POS_KEY
-
-
Constructor Details
-
GlobalManagerImpl
-
-
Method Details
-
addDownloadManager
Description copied from interface:GlobalManager
Create and add a Download Manager to the global list- Specified by:
addDownloadManager
in interfaceGlobalManager
- Parameters:
fileName
- location and name of torrent filesavePath
- path to write the data to- Returns:
- The Downloadmanger based on the supplied information.
May return an existing DownloadManager if torrent was already in GlobalManager.
-
addDownloadManager
public DownloadManager addDownloadManager(String fileName, byte[] optionalHash, String savePath, int initialState, boolean persistent) Description copied from interface:GlobalManager
Create and add a Download Manager to the global list- Specified by:
addDownloadManager
in interfaceGlobalManager
- Parameters:
fileName
- location and name of torrent filesavePath
- path to write the data toinitialState
- Initial state of download. See DownloadManager.STATE_*persistent
- Whether the download should be treated as persistent download- Returns:
- The Downloadmanger based on the supplied information.
May return an existing DownloadManager if torrent was already in GlobalManager.
-
addDownloadManager
public DownloadManager addDownloadManager(String torrent_file_name, byte[] optionalHash, String savePath, int initialState, boolean persistent, boolean for_seeding, DownloadManagerInitialisationAdapter _adapter) Description copied from interface:GlobalManager
Create and add a Download Manager to the global list- Specified by:
addDownloadManager
in interfaceGlobalManager
- Parameters:
torrent_file_name
- location and name of torrent filesavePath
- path to write the data toinitialState
- Initial state of download. See DownloadManager.STATE_*persistent
- Whether the download should be treated as persistent downloadfor_seeding
- Whether the manager should assume the torrent is already complete and ready for seeding.- Returns:
- The Downloadmanger based on the supplied information.
May return an existing DownloadManager if torrent was already in GlobalManager.
-
addDownloadManager
public DownloadManager addDownloadManager(String torrent_file_name, byte[] optionalHash, String savePath, String saveFile, int initialState, boolean persistent, boolean for_seeding, DownloadManagerInitialisationAdapter _adapter) Description copied from interface:GlobalManager
Create and add a Download Manager to the global list- Specified by:
addDownloadManager
in interfaceGlobalManager
- Parameters:
torrent_file_name
- location and name of torrent filesavePath
- path to write the data toinitialState
- Initial state of download. See DownloadManager.STATE_*persistent
- Whether the download should be treated as persistent downloadfor_seeding
- Whether the manager should assume the torrent is already complete and ready for seeding.- Returns:
- true, if the download was added
-
createAndAddNewDownloadManager
private DownloadManager createAndAddNewDownloadManager(byte[] torrent_hash, String torrentFileName, String savePath, String saveFile, int initialState, boolean persistent, boolean for_seeding, List file_priorities, DownloadManagerInitialisationAdapter adapter, boolean thisIsMagnet, boolean[] is_existing) -
createNewDownloadManager
private DownloadManager createNewDownloadManager(byte[] torrent_hash, String torrentFileName, String savePath, String saveFile, int initialState, boolean persistent, boolean for_seeding, List file_priorities, boolean thisIsMagnet, boolean[] is_existing) -
addDownloadManager
protected DownloadManager addDownloadManager(DownloadManager download_manager, boolean notifyListeners, DownloadManagerInitialisationAdapter adapter, boolean for_seeding, boolean[] is_existing, boolean initial_load) -
clearNonPersistentDownloadState
public void clearNonPersistentDownloadState(byte[] hash) - Specified by:
clearNonPersistentDownloadState
in interfaceGlobalManager
-
getDownloadManagers
Description copied from interface:GlobalManager
Retrieve a list ofDownloadManager
s that GlobalManager is handling- Specified by:
getDownloadManagers
in interfaceGlobalManager
- Returns:
- a list of
DownloadManager
s
-
getDownloadManager
Description copied from interface:GlobalManager
Retrieve the DownloadManager associated with a TOTorrent object- Specified by:
getDownloadManager
in interfaceGlobalManager
- Parameters:
torrent
- Torrent to search for- Returns:
- The DownloadManager associated with the TOTOrrent, or null if none found
-
getDownloadManager
Description copied from interface:GlobalManager
Retrieve the DownloadManager associated with a hash- Specified by:
getDownloadManager
in interfaceGlobalManager
- Parameters:
hw
- Hash to search for- Returns:
- The DownloadManager associated with the hash, or null if none found
-
canDownloadManagerBeRemoved
public void canDownloadManagerBeRemoved(DownloadManager manager, boolean remove_torrent, boolean remove_data) throws GlobalManagerDownloadRemovalVetoException Description copied from interface:GlobalManager
Determines whether a DownloadManager can be removed- Specified by:
canDownloadManagerBeRemoved
in interfaceGlobalManager
- Parameters:
manager
- DownloadManager to check- Throws:
GlobalManagerDownloadRemovalVetoException
-
removeDownloadManager
public void removeDownloadManager(DownloadManager manager) throws GlobalManagerDownloadRemovalVetoException Description copied from interface:GlobalManager
Removes a DownloadManager from the global list, providing it can be removed (seeinvalid reference
#canDownloadManagerBeRemoved(DownloadManager)
The DownloadManager will not be stopped if it is running. Scraping, however, will be turned off.
- Specified by:
removeDownloadManager
in interfaceGlobalManager
- Parameters:
manager
- DownloadManager to remove- Throws:
GlobalManagerDownloadRemovalVetoException
-
removeDownloadManager
public void removeDownloadManager(DownloadManager manager, boolean remove_torrent, boolean remove_data) throws GlobalManagerDownloadRemovalVetoException - Specified by:
removeDownloadManager
in interfaceGlobalManager
- Parameters:
manager
-remove_torrent
-remove_data
-- Throws:
GlobalManagerDownloadRemovalVetoException
-
isStopping
public boolean isStopping()- Specified by:
isStopping
in interfaceGlobalManager
-
stopGlobalManager
Description copied from interface:GlobalManager
Puts GlobalManager in a stopped state.
Used when closing down the client.- Specified by:
stopGlobalManager
in interfaceGlobalManager
-
stopAllDownloads
public void stopAllDownloads()Description copied from interface:GlobalManager
Stops all downloads without removing them- Specified by:
stopAllDownloads
in interfaceGlobalManager
-
stopAllDownloads
-
startAllDownloads
public void startAllDownloads()Starts all downloads- Specified by:
startAllDownloads
in interfaceGlobalManager
-
pauseDownload
Description copied from interface:GlobalManager
Pause one DownloadManager- Specified by:
pauseDownload
in interfaceGlobalManager
- Parameters:
manager
- DownloadManager to pause- Returns:
- False if DownloadManager was invalid, stopped, or pause failed
-
stopPausedDownload
Description copied from interface:GlobalManager
Don't use me, use dm.stopPausedDownload()- Specified by:
stopPausedDownload
in interfaceGlobalManager
- Parameters:
dm
-- Returns:
-
pauseDownloadsForPeriod
public void pauseDownloadsForPeriod(int seconds) Description copied from interface:GlobalManager
pause any non-paused downloads and auto-resume all downloads after n seconds- Specified by:
pauseDownloadsForPeriod
in interfaceGlobalManager
- Parameters:
seconds
-
-
getPauseDownloadPeriodRemaining
public int getPauseDownloadPeriodRemaining()Description copied from interface:GlobalManager
seconds remaining, 0 if not active- Specified by:
getPauseDownloadPeriodRemaining
in interfaceGlobalManager
- Returns:
-
pauseDownloads
public void pauseDownloads(boolean pause_force_start) - Specified by:
pauseDownloads
in interfaceGlobalManager
-
pauseDownloadsInternal
private void pauseDownloadsInternal(boolean tag_only, boolean pause_force_start) -
canPauseDownload
-
isPaused
Description copied from interface:GlobalManager
Retrieve whether a DownloadManager is in a paused state- Specified by:
isPaused
in interfaceGlobalManager
- Parameters:
manager
- DownloadManager to query- Returns:
- the pause state
-
canPauseDownloads
public boolean canPauseDownloads(boolean pause_force_start) - Specified by:
canPauseDownloads
in interfaceGlobalManager
-
resumeDownload
Description copied from interface:GlobalManager
Resume a previously paused DownloadManager- Specified by:
resumeDownload
in interfaceGlobalManager
- Parameters:
manager
- DownloadManager to resume
-
resumingDownload
Description copied from interface:GlobalManager
This reports that a download is being resumed in order to remove it from the paused set Don't use this to actually resume a download, use resumeDownload !- Specified by:
resumingDownload
in interfaceGlobalManager
- Parameters:
manager
-- Returns:
- true if download was paused AND was force started
-
resumeDownloads
public void resumeDownloads()Description copied from interface:GlobalManager
Resumes (starts) all downloads paused by the previous pauseDownloads call.- Specified by:
resumeDownloads
in interfaceGlobalManager
-
resumeDownloads
public boolean resumeDownloads(boolean is_auto_resume) Description copied from interface:GlobalManager
Attempt to automatically resume downloads - request may be denied if manual override in effect- Specified by:
resumeDownloads
in interfaceGlobalManager
- Parameters:
is_auto_resume
-- Returns:
- whether operation was accepted
-
canResumeDownloads
public boolean canResumeDownloads()Description copied from interface:GlobalManager
Indicates whether or not there are any paused downloads to resume.- Specified by:
canResumeDownloads
in interfaceGlobalManager
- Returns:
- true if there is at least one download to resume, false if none.
-
isSwarmMerging
- Specified by:
isSwarmMerging
in interfaceGlobalManager
-
getSwarmMergingInfo
- Specified by:
getSwarmMergingInfo
in interfaceGlobalManager
-
sortForStop
-
loadDownloads
void loadDownloads() -
triggerAddListener
-
saveState
public void saveState()- Specified by:
saveState
in interfaceGlobalManager
-
saveDownloads
-
loadDownload
public DownloadManager loadDownload(Map mDownload, int currentDownload, int nbDownloads, GlobalMangerProgressListener progress_listener, boolean debug) -
enlargeLongArray
-
exportDownloadStateToMap
- Specified by:
exportDownloadStateToMap
in interfaceGlobalManager
-
importDownloadStateFromMap
- Specified by:
importDownloadStateFromMap
in interfaceGlobalManager
-
exportDownloadStateToMapSupport
private Map exportDownloadStateToMapSupport(DownloadManager dm, boolean internal_export, boolean interim) -
getTrackerScraper
Description copied from interface:GlobalManager
Retrieve the Tracker Scraper management class- Specified by:
getTrackerScraper
in interfaceGlobalManager
- Returns:
-
getStats
Description copied from interface:GlobalManager
Retrieve the Global Manager Statistics class- Specified by:
getStats
in interfaceGlobalManager
- Returns:
- the Global Manager Statistics class
-
contains
- Specified by:
contains
in interfaceGlobalManager
- Parameters:
manager
-- Returns:
-
isMoveableUp
Description copied from interface:GlobalManager
Retrieve whether a DownloadManager can move up in the GlobalManager list- Specified by:
isMoveableUp
in interfaceGlobalManager
- Parameters:
manager
- DownloadManager to check- Returns:
- True - Can move up
-
downloadManagerCount
public int downloadManagerCount(boolean bCompleted) Description copied from interface:GlobalManager
Retrieve the number of download managers the global manager is managing.- Specified by:
downloadManagerCount
in interfaceGlobalManager
- Parameters:
bCompleted
- True: Return count of completed downloads
False: Return count of incomplete downloads- Returns:
- count
-
isMoveableDown
Description copied from interface:GlobalManager
Retrieve whether a DownloadManager can move down in the GlobalManager list- Specified by:
isMoveableDown
in interfaceGlobalManager
- Parameters:
manager
- DownloadManager to check- Returns:
- True - Can move down
-
moveUp
Description copied from interface:GlobalManager
Move one DownloadManager up in the GlobalManager's list- Specified by:
moveUp
in interfaceGlobalManager
- Parameters:
manager
- DownloadManager to move up
-
moveDown
Description copied from interface:GlobalManager
Move one DownloadManager down in the GlobalManager's list- Specified by:
moveDown
in interfaceGlobalManager
- Parameters:
manager
- DownloadManager to move down
-
moveTop
Description copied from interface:GlobalManager
Move a list of DownloadManagers to the top of the GlobalManager list- Specified by:
moveTop
in interfaceGlobalManager
- Parameters:
manager
- array list of DownloadManager objects to move
-
moveEnd
Description copied from interface:GlobalManager
Move a list of DownloadManagers to the end of the GlobalManager list- Specified by:
moveEnd
in interfaceGlobalManager
- Parameters:
manager
- array list of DownloadManager objects to move
-
moveTo
Description copied from interface:GlobalManager
Move a Downloadmanager to a new position.- Specified by:
moveTo
in interfaceGlobalManager
- Parameters:
manager
- DownloadManager to movenewPosition
- position to place
-
moveTo
- Specified by:
moveTo
in interfaceGlobalManager
-
fixUpDownloadManagerPositions
public void fixUpDownloadManagerPositions()Description copied from interface:GlobalManager
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.
- Specified by:
fixUpDownloadManagerPositions
in interfaceGlobalManager
-
getResolverTaggableType
public long getResolverTaggableType()- Specified by:
getResolverTaggableType
in interfaceTaggableResolver
-
resolveTaggable
- Specified by:
resolveTaggable
in interfaceTaggableResolver
-
getResolvedTaggables
- Specified by:
getResolvedTaggables
in interfaceTaggableResolver
-
importDataSource
- Specified by:
importDataSource
in interfaceDataSourceResolver.DataSourceImporter
-
getDisplayName
- Specified by:
getDisplayName
in interfaceTaggableResolver
-
requestAttention
- Specified by:
requestAttention
in interfaceTaggableResolver
-
addLifecycleControlListener
- Specified by:
addLifecycleControlListener
in interfaceTaggableResolver
-
removeLifecycleControlListener
- Specified by:
removeLifecycleControlListener
in interfaceTaggableResolver
-
informDestroyed
protected void informDestroyed() -
informDestroyInitiated
-
addListener
Description copied from interface:GlobalManager
Add a Global Manager listener and triggers it- Specified by:
addListener
in interfaceGlobalManager
- Parameters:
listener
- Listener to add
-
addListener
- Specified by:
addListener
in interfaceGlobalManager
- Parameters:
listener
-trigger
-
-
removeListener
Description copied from interface:GlobalManager
Removes a Global Manager listener- Specified by:
removeListener
in interfaceGlobalManager
- Parameters:
listener
- Listener to remove
-
addEventListener
- Specified by:
addEventListener
in interfaceGlobalManager
-
removeEventListener
- Specified by:
removeEventListener
in interfaceGlobalManager
-
fireGlobalManagerEvent
- Specified by:
fireGlobalManagerEvent
in interfaceGlobalManager
-
addDownloadWillBeRemovedListener
Description copied from interface:GlobalManager
Add a listener triggered when Download is about to be removed- Specified by:
addDownloadWillBeRemovedListener
in interfaceGlobalManager
- Parameters:
l
- Listener to add
-
removeDownloadWillBeRemovedListener
Description copied from interface:GlobalManager
Remove a listener triggered when Download is about to be removed- Specified by:
removeDownloadWillBeRemovedListener
in interfaceGlobalManager
- Parameters:
l
- Listener to remove
-
stateChanged
- Specified by:
stateChanged
in interfaceDownloadManagerListener
- Overrides:
stateChanged
in classDownloadManagerAdapter
-
checkForceStart
protected void checkForceStart(boolean known_to_exist) -
checkSeedingOnlyState
protected void checkSeedingOnlyState() -
checkSeedingOnlyStateSupport
protected void checkSeedingOnlyStateSupport() -
setSeedingOnlyState
protected void setSeedingOnlyState(boolean seeding, boolean potentially_seeding) -
isSeedingOnly
public boolean isSeedingOnly()Description copied from interface:GlobalManager
Determines whether we are only seeding, and not currently downloading anything.- Specified by:
isSeedingOnly
in interfaceGlobalManager
- Returns:
- Seeding Only State
-
isPotentiallySeedingOnly
public boolean isPotentiallySeedingOnly()Description copied from interface:GlobalManager
As for isSeedingOnly but includes queued seeds- Specified by:
isPotentiallySeedingOnly
in interfaceGlobalManager
- Returns:
-
getTotalSwarmsPeerRate
public long getTotalSwarmsPeerRate(boolean downloading, boolean seeding) -
computeNATStatus
protected void computeNATStatus() -
getNATStatus
Description copied from interface:GlobalManager
See plugin ConnectionManager.NAT_ constants for return values- Specified by:
getNATStatus
in interfaceGlobalManager
- Returns:
- ConnectionManager.NAT_*
-
seedPieceRecheck
protected void seedPieceRecheck() -
seedPieceRecheck
-
getDMAdapter
protected DownloadManagerInitialisationAdapter getDMAdapter(DownloadManagerInitialisationAdapter adapter) -
fixLongFileName
-
addDownloadManagerInitialisationAdapter
Description copied from interface:GlobalManager
Any adapters added will get a chance to see/set the initial state of downloads as they are added- Specified by:
addDownloadManagerInitialisationAdapter
in interfaceGlobalManager
- Parameters:
adapter
-
-
removeDownloadManagerInitialisationAdapter
public void removeDownloadManagerInitialisationAdapter(DownloadManagerInitialisationAdapter adapter) - Specified by:
removeDownloadManagerInitialisationAdapter
in interfaceGlobalManager
-
getDownloadHistoryManager
- Specified by:
getDownloadHistoryManager
in interfaceGlobalManager
-
generate
- Specified by:
generate
in interfaceAEDiagnosticsEvidenceGenerator
-
main
-
setMainlineDHTProvider
Description copied from interface:GlobalManager
Calling this method doesn't prepare the client to be DHT-ready, it is only used to store, or remove, a DHT provider - so that it can be globally accessible. See the DHT manager classes in the plugin API for a better way to register a provider.- Specified by:
setMainlineDHTProvider
in interfaceGlobalManager
-
getMainlineDHTProvider
- Specified by:
getMainlineDHTProvider
in interfaceGlobalManager
-
statsRequest
- Specified by:
statsRequest
in interfaceGlobalManager
-