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 TypeClassDescriptionclassprivate classprivate static classNested classes/interfaces inherited from interface TaggableResolver
TaggableResolver.LifecycleControlListener -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Objectprivate final AllTrackersManager.AllTrackersprivate longprivate booleanprivate booleanprivate TimerEventprivate final FrequencyLimitedDispatcherprivate final GlobalManagerImpl.Checkerprivate Objectprivate final booleanprivate boolean(package private) static booleanprivate final CopyOnWriteList<DownloadManagerInitialisationAdapter> private Object(package private) static booleanprivate final GlobalManagerFileMergerprivate booleanprivate GlobalManagerHostSupportprivate booleanprivate longprivate longprivate longprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate final ListenerManager<Object> (package private) booleanWhether loading of existing torrents is done(package private) final AESemaphoreMonitor to block adding torrents while loading existing torrent list(package private) DelayedEventdelay 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 Objectprivate static final Objectprivate Stringprivate Stringprivate intprivate longprivate boolean(package private) longprivate int(package private) static long(package private) static intprivate final Map<HashWrapper, GlobalManagerImpl.PauseState> private final Map<HashWrapper, GlobalManagerImpl.PauseState> private final AEMonitorprivate booleanprivate final GlobalMangerProgressListenerprivate MainlineDHTProviderprivate final ListenerManager<GlobalManagerDownloadWillBeRemovedListener> private final Map<HashWrapper, Map> private booleanprivate final GlobalManagerStatsImplprivate GlobalManagerStatsWriterprivate final TaggableLifecycleHandlerprivate final TorrentFolderWatcherprivate final TRTrackerScraperFields inherited from interface GlobalManager
PS_ANY, PS_GENERAL, PS_SPEED_LIMIT_HANDLER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DownloadManageraddDownloadManager(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 listvoidAny adapters added will get a chance to see/set the initial state of downloads as they are addedvoidAdd a listener triggered when Download is about to be removedvoidaddEventListener(GlobalManagerEventListener listener) voidvoidaddListener(GlobalManagerListener listener) Add a Global Manager listener and triggers itvoidaddListener(GlobalManagerListener listener, boolean trigger) voidcanDownloadManagerBeRemoved(DownloadManager manager, boolean remove_torrent, boolean remove_data) Determines whether a DownloadManager can be removedbooleancanPauseDownload(DownloadManager manager) booleancanPauseDownloads(boolean pause_force_start) booleanIndicates whether or not there are any paused downloads to resume.protected voidcheckForceStart(boolean known_to_exist) protected voidprotected voidvoidclearNonPersistentDownloadState(byte[] hash) protected voidbooleancontains(DownloadManager manager) private DownloadManagercreateAndAddNewDownloadManager(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 DownloadManagercreateNewDownloadManager(byte[] torrent_hash, String torrentFileName, String savePath, String saveFile, int initialState, boolean persistent, boolean for_seeding, List file_priorities, boolean thisIsMagnet, boolean[] is_existing) intdownloadManagerCount(boolean bCompleted) Retrieve the number of download managers the global manager is managing.static Long[]enlargeLongArray(Long[] array, int expandTo) private MapexportDownloadStateToMapSupport(DownloadManager dm, boolean internal_export, boolean interim) voidfireGlobalManagerEvent(int type, DownloadManager dm, Object data) (package private) voidfixLongFileName(DownloadManager manager) voidVerifies the positions of the DownloadManagers, filling in gaps and shifting duplicate IDs down if necessary.voidgenerate(IndentWriter writer) getDisplayName(Taggable taggable) protected DownloadManagerInitialisationAdaptergetDownloadManager(TOTorrent torrent) Retrieve the DownloadManager associated with a TOTorrent objectRetrieve the DownloadManager associated with a hashRetrieve a list ofDownloadManagers that GlobalManager is handlingObject[]See plugin ConnectionManager.NAT_ constants for return valuesintseconds remaining, 0 if not activelonggetStats()Retrieve the Global Manager Statistics classlonggetTotalSwarmsPeerRate(boolean downloading, boolean seeding) Retrieve the Tracker Scraper management classimportDataSource(Map map) protected voidprivate voidbooleanisMoveableDown(DownloadManager manager) Retrieve whether a DownloadManager can move down in the GlobalManager listbooleanisMoveableUp(DownloadManager manager) Retrieve whether a DownloadManager can move up in the GlobalManager listbooleanisPaused(DownloadManager manager) Retrieve whether a DownloadManager is in a paused statebooleanAs for isSeedingOnly but includes queued seedsbooleanDetermines whether we are only seeding, and not currently downloading anything.booleanbooleanloadDownload(Map mDownload, int currentDownload, int nbDownloads, GlobalMangerProgressListener progress_listener, boolean debug) (package private) voidstatic voidvoidmoveDown(DownloadManager manager) Move one DownloadManager down in the GlobalManager's listvoidmoveEnd(DownloadManager[] manager) Move a list of DownloadManagers to the end of the GlobalManager listvoidmoveTo(DownloadManager manager, int newPosition) Move a Downloadmanager to a new position.voidmoveTo(List<DownloadManager> managers, List<Integer> newPositions) voidmoveTop(DownloadManager[] manager) Move a list of DownloadManagers to the top of the GlobalManager listvoidmoveUp(DownloadManager manager) Move one DownloadManager up in the GlobalManager's listbooleanpauseDownload(DownloadManager manager, boolean only_if_active) Pause one DownloadManagervoidpauseDownloads(boolean pause_force_start, int owner) voidpauseDownloadsForPeriod(int seconds) pause any non-paused downloads and auto-resume all downloads after n secondsprivate voidpauseDownloadsInternal(boolean tag_only, boolean pause_force_start, int owner) voidremoveDownloadManager(DownloadManager manager) Removes a DownloadManager from the global list, providing it can be removed (see)invalid reference
#canDownloadManagerBeRemoved(DownloadManager)voidremoveDownloadManager(DownloadManager manager, boolean remove_torrent, boolean remove_data) voidvoidRemove a listener triggered when Download is about to be removedvoidvoidvoidremoveListener(GlobalManagerListener listener) Removes a Global Manager listenervoidvoidresumeDownload(DownloadManager manager) Resume a previously paused DownloadManagerbooleanresumeDownloads(boolean is_auto_resume, int owner) booleanresumingDownload(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 voidsaveDownloads(boolean interim, GlobalMangerProgressListener listener_maybe_null) voidprotected voidprotected booleanseedPieceRecheck(DownloadManager manager) voidsetMainlineDHTProvider(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 voidsetSeedingOnlyState(boolean seeding, boolean potentially_seeding) private List<DownloadManager> voidStarts all downloadsvoidstateChanged(DownloadManager manager, int new_state) voidstatsRequest(Map request, Map reply) voidStops all downloads without removing themprotected voidstopAllDownloads(boolean for_close, GlobalMangerProgressListener listener) voidPuts GlobalManager in a stopped state.
Used when closing down the client.booleanDon't use me, use dm.stopPausedDownload()private voidtriggerAddListener(List downloadsToAdd) Methods inherited from class DownloadManagerAdapter
completionChanged, downloadComplete, filePriorityChanged, positionChangedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DownloadManagerListener
fileLocationChangedMethods inherited from interface GlobalManager
canPauseDownloads, pauseDownloads, pauseDownloads, resumeDownloads, resumeDownloads
-
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_state_initial
-
lcl_map
-
next_seed_piece_recheck_index
private int next_seed_piece_recheck_index -
torrent_folder_watcher
-
paused_state
-
paused_state_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:GlobalManagerCreate and add a Download Manager to the global list- Specified by:
addDownloadManagerin 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:GlobalManagerCreate and add a Download Manager to the global list- Specified by:
addDownloadManagerin 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:GlobalManagerCreate and add a Download Manager to the global list- Specified by:
addDownloadManagerin 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:GlobalManagerCreate and add a Download Manager to the global list- Specified by:
addDownloadManagerin 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:
clearNonPersistentDownloadStatein interfaceGlobalManager
-
getDownloadManagers
Description copied from interface:GlobalManagerRetrieve a list ofDownloadManagers that GlobalManager is handling- Specified by:
getDownloadManagersin interfaceGlobalManager- Returns:
- a list of
DownloadManagers
-
getDownloadManager
Description copied from interface:GlobalManagerRetrieve the DownloadManager associated with a TOTorrent object- Specified by:
getDownloadManagerin interfaceGlobalManager- Parameters:
torrent- Torrent to search for- Returns:
- The DownloadManager associated with the TOTOrrent, or null if none found
-
getDownloadManager
Description copied from interface:GlobalManagerRetrieve the DownloadManager associated with a hash- Specified by:
getDownloadManagerin 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:GlobalManagerDetermines whether a DownloadManager can be removed- Specified by:
canDownloadManagerBeRemovedin interfaceGlobalManager- Parameters:
manager- DownloadManager to check- Throws:
GlobalManagerDownloadRemovalVetoException
-
removeDownloadManager
public void removeDownloadManager(DownloadManager manager) throws GlobalManagerDownloadRemovalVetoException Description copied from interface:GlobalManagerRemoves a DownloadManager from the global list, providing it can be removed (see)invalid reference
#canDownloadManagerBeRemoved(DownloadManager)The DownloadManager will not be stopped if it is running. Scraping, however, will be turned off.
- Specified by:
removeDownloadManagerin interfaceGlobalManager- Parameters:
manager- DownloadManager to remove- Throws:
GlobalManagerDownloadRemovalVetoException
-
removeDownloadManager
public void removeDownloadManager(DownloadManager manager, boolean remove_torrent, boolean remove_data) throws GlobalManagerDownloadRemovalVetoException - Specified by:
removeDownloadManagerin interfaceGlobalManager- Parameters:
manager-remove_torrent-remove_data-- Throws:
GlobalManagerDownloadRemovalVetoException
-
isStopping
public boolean isStopping()- Specified by:
isStoppingin interfaceGlobalManager
-
stopGlobalManager
Description copied from interface:GlobalManagerPuts GlobalManager in a stopped state.
Used when closing down the client.- Specified by:
stopGlobalManagerin interfaceGlobalManager
-
stopAllDownloads
public void stopAllDownloads()Description copied from interface:GlobalManagerStops all downloads without removing them- Specified by:
stopAllDownloadsin interfaceGlobalManager
-
stopAllDownloads
-
startAllDownloads
public void startAllDownloads()Starts all downloads- Specified by:
startAllDownloadsin interfaceGlobalManager
-
pauseDownload
Description copied from interface:GlobalManagerPause one DownloadManager- Specified by:
pauseDownloadin interfaceGlobalManager- Parameters:
manager- DownloadManager to pause- Returns:
- False if DownloadManager was invalid, stopped, or pause failed
-
stopPausedDownload
Description copied from interface:GlobalManagerDon't use me, use dm.stopPausedDownload()- Specified by:
stopPausedDownloadin interfaceGlobalManager- Parameters:
dm-- Returns:
-
pauseDownloadsForPeriod
public void pauseDownloadsForPeriod(int seconds) Description copied from interface:GlobalManagerpause any non-paused downloads and auto-resume all downloads after n seconds- Specified by:
pauseDownloadsForPeriodin interfaceGlobalManager- Parameters:
seconds-
-
getPauseDownloadPeriodRemaining
public int getPauseDownloadPeriodRemaining()Description copied from interface:GlobalManagerseconds remaining, 0 if not active- Specified by:
getPauseDownloadPeriodRemainingin interfaceGlobalManager- Returns:
-
pauseDownloads
public void pauseDownloads(boolean pause_force_start, int owner) - Specified by:
pauseDownloadsin interfaceGlobalManager
-
pauseDownloadsInternal
private void pauseDownloadsInternal(boolean tag_only, boolean pause_force_start, int owner) -
canPauseDownload
-
isPaused
Description copied from interface:GlobalManagerRetrieve whether a DownloadManager is in a paused state- Specified by:
isPausedin interfaceGlobalManager- Parameters:
manager- DownloadManager to query- Returns:
- the pause state
-
canPauseDownloads
public boolean canPauseDownloads(boolean pause_force_start) - Specified by:
canPauseDownloadsin interfaceGlobalManager
-
resumeDownload
Description copied from interface:GlobalManagerResume a previously paused DownloadManager- Specified by:
resumeDownloadin interfaceGlobalManager- Parameters:
manager- DownloadManager to resume
-
resumingDownload
Description copied from interface:GlobalManagerThis 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:
resumingDownloadin interfaceGlobalManager- Parameters:
manager-- Returns:
- true if download was paused AND was force started
-
resumeDownloads
public boolean resumeDownloads(boolean is_auto_resume, int owner) - Specified by:
resumeDownloadsin interfaceGlobalManager
-
canResumeDownloads
public boolean canResumeDownloads()Description copied from interface:GlobalManagerIndicates whether or not there are any paused downloads to resume.- Specified by:
canResumeDownloadsin interfaceGlobalManager- Returns:
- true if there is at least one download to resume, false if none.
-
isSwarmMerging
- Specified by:
isSwarmMergingin interfaceGlobalManager
-
getSwarmMergingInfo
- Specified by:
getSwarmMergingInfoin interfaceGlobalManager
-
sortForStop
-
loadDownloads
void loadDownloads() -
triggerAddListener
-
saveState
public void saveState()- Specified by:
saveStatein interfaceGlobalManager
-
saveDownloads
-
loadDownload
public DownloadManager loadDownload(Map mDownload, int currentDownload, int nbDownloads, GlobalMangerProgressListener progress_listener, boolean debug) -
enlargeLongArray
-
exportDownloadStateToMap
- Specified by:
exportDownloadStateToMapin interfaceGlobalManager
-
importDownloadStateFromMap
- Specified by:
importDownloadStateFromMapin interfaceGlobalManager
-
exportDownloadStateToMapSupport
private Map exportDownloadStateToMapSupport(DownloadManager dm, boolean internal_export, boolean interim) -
getTrackerScraper
Description copied from interface:GlobalManagerRetrieve the Tracker Scraper management class- Specified by:
getTrackerScraperin interfaceGlobalManager- Returns:
-
getStats
Description copied from interface:GlobalManagerRetrieve the Global Manager Statistics class- Specified by:
getStatsin interfaceGlobalManager- Returns:
- the Global Manager Statistics class
-
contains
- Specified by:
containsin interfaceGlobalManager- Parameters:
manager-- Returns:
-
isMoveableUp
Description copied from interface:GlobalManagerRetrieve whether a DownloadManager can move up in the GlobalManager list- Specified by:
isMoveableUpin interfaceGlobalManager- Parameters:
manager- DownloadManager to check- Returns:
- True - Can move up
-
downloadManagerCount
public int downloadManagerCount(boolean bCompleted) Description copied from interface:GlobalManagerRetrieve the number of download managers the global manager is managing.- Specified by:
downloadManagerCountin interfaceGlobalManager- Parameters:
bCompleted- True: Return count of completed downloads
False: Return count of incomplete downloads- Returns:
- count
-
isMoveableDown
Description copied from interface:GlobalManagerRetrieve whether a DownloadManager can move down in the GlobalManager list- Specified by:
isMoveableDownin interfaceGlobalManager- Parameters:
manager- DownloadManager to check- Returns:
- True - Can move down
-
moveUp
Description copied from interface:GlobalManagerMove one DownloadManager up in the GlobalManager's list- Specified by:
moveUpin interfaceGlobalManager- Parameters:
manager- DownloadManager to move up
-
moveDown
Description copied from interface:GlobalManagerMove one DownloadManager down in the GlobalManager's list- Specified by:
moveDownin interfaceGlobalManager- Parameters:
manager- DownloadManager to move down
-
moveTop
Description copied from interface:GlobalManagerMove a list of DownloadManagers to the top of the GlobalManager list- Specified by:
moveTopin interfaceGlobalManager- Parameters:
manager- array list of DownloadManager objects to move
-
moveEnd
Description copied from interface:GlobalManagerMove a list of DownloadManagers to the end of the GlobalManager list- Specified by:
moveEndin interfaceGlobalManager- Parameters:
manager- array list of DownloadManager objects to move
-
moveTo
Description copied from interface:GlobalManagerMove a Downloadmanager to a new position.- Specified by:
moveToin interfaceGlobalManager- Parameters:
manager- DownloadManager to movenewPosition- position to place
-
moveTo
- Specified by:
moveToin interfaceGlobalManager
-
fixUpDownloadManagerPositions
public void fixUpDownloadManagerPositions()Description copied from interface:GlobalManagerVerifies 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:
fixUpDownloadManagerPositionsin interfaceGlobalManager
-
getResolverTaggableType
public long getResolverTaggableType()- Specified by:
getResolverTaggableTypein interfaceTaggableResolver
-
resolveTaggable
- Specified by:
resolveTaggablein interfaceTaggableResolver
-
getResolvedTaggables
- Specified by:
getResolvedTaggablesin interfaceTaggableResolver
-
importDataSource
- Specified by:
importDataSourcein interfaceDataSourceResolver.DataSourceImporter
-
getDisplayName
- Specified by:
getDisplayNamein interfaceTaggableResolver
-
requestAttention
- Specified by:
requestAttentionin interfaceTaggableResolver
-
addLifecycleControlListener
- Specified by:
addLifecycleControlListenerin interfaceTaggableResolver
-
removeLifecycleControlListener
- Specified by:
removeLifecycleControlListenerin interfaceTaggableResolver
-
informDestroyed
protected void informDestroyed() -
informDestroyInitiated
-
addListener
Description copied from interface:GlobalManagerAdd a Global Manager listener and triggers it- Specified by:
addListenerin interfaceGlobalManager- Parameters:
listener- Listener to add
-
addListener
- Specified by:
addListenerin interfaceGlobalManager- Parameters:
listener-trigger-
-
removeListener
Description copied from interface:GlobalManagerRemoves a Global Manager listener- Specified by:
removeListenerin interfaceGlobalManager- Parameters:
listener- Listener to remove
-
addEventListener
- Specified by:
addEventListenerin interfaceGlobalManager
-
removeEventListener
- Specified by:
removeEventListenerin interfaceGlobalManager
-
fireGlobalManagerEvent
- Specified by:
fireGlobalManagerEventin interfaceGlobalManager
-
addDownloadWillBeRemovedListener
Description copied from interface:GlobalManagerAdd a listener triggered when Download is about to be removed- Specified by:
addDownloadWillBeRemovedListenerin interfaceGlobalManager- Parameters:
l- Listener to add
-
removeDownloadWillBeRemovedListener
Description copied from interface:GlobalManagerRemove a listener triggered when Download is about to be removed- Specified by:
removeDownloadWillBeRemovedListenerin interfaceGlobalManager- Parameters:
l- Listener to remove
-
stateChanged
- Specified by:
stateChangedin interfaceDownloadManagerListener- Overrides:
stateChangedin 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:GlobalManagerDetermines whether we are only seeding, and not currently downloading anything.- Specified by:
isSeedingOnlyin interfaceGlobalManager- Returns:
- Seeding Only State
-
isPotentiallySeedingOnly
public boolean isPotentiallySeedingOnly()Description copied from interface:GlobalManagerAs for isSeedingOnly but includes queued seeds- Specified by:
isPotentiallySeedingOnlyin interfaceGlobalManager- Returns:
-
getTotalSwarmsPeerRate
public long getTotalSwarmsPeerRate(boolean downloading, boolean seeding) -
computeNATStatus
protected void computeNATStatus() -
getNATStatus
Description copied from interface:GlobalManagerSee plugin ConnectionManager.NAT_ constants for return values- Specified by:
getNATStatusin interfaceGlobalManager- Returns:
- ConnectionManager.NAT_*
-
seedPieceRecheck
protected void seedPieceRecheck() -
seedPieceRecheck
-
getDMAdapter
protected DownloadManagerInitialisationAdapter getDMAdapter(DownloadManagerInitialisationAdapter adapter) -
fixLongFileName
-
addDownloadManagerInitialisationAdapter
Description copied from interface:GlobalManagerAny adapters added will get a chance to see/set the initial state of downloads as they are added- Specified by:
addDownloadManagerInitialisationAdapterin interfaceGlobalManager- Parameters:
adapter-
-
removeDownloadManagerInitialisationAdapter
public void removeDownloadManagerInitialisationAdapter(DownloadManagerInitialisationAdapter adapter) - Specified by:
removeDownloadManagerInitialisationAdapterin interfaceGlobalManager
-
getDownloadHistoryManager
- Specified by:
getDownloadHistoryManagerin interfaceGlobalManager
-
generate
- Specified by:
generatein interfaceAEDiagnosticsEvidenceGenerator
-
main
-
setMainlineDHTProvider
Description copied from interface:GlobalManagerCalling 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:
setMainlineDHTProviderin interfaceGlobalManager
-
getMainlineDHTProvider
- Specified by:
getMainlineDHTProviderin interfaceGlobalManager
-
statsRequest
- Specified by:
statsRequestin interfaceGlobalManager
-