org.gudy.azureus2.core3.global.impl
Class GlobalManagerImpl

java.lang.Object
  extended by org.gudy.azureus2.core3.download.impl.DownloadManagerAdapter
      extended by org.gudy.azureus2.core3.global.impl.GlobalManagerImpl
All Implemented Interfaces:
AzureusCoreComponent, TaggableResolver, DownloadManagerListener, GlobalManager, AEDiagnosticsEvidenceGenerator

public class GlobalManagerImpl
extends DownloadManagerAdapter
implements GlobalManager, AEDiagnosticsEvidenceGenerator

Author:
Olivier

Nested Class Summary
 class GlobalManagerImpl.Checker
           
 
Constructor Summary
GlobalManagerImpl(AzureusCore core, GlobalMangerProgressListener listener, long existingTorrentLoadDelay)
           
 
Method Summary
protected  DownloadManager addDownloadManager(DownloadManager download_manager, boolean save, boolean notifyListeners)
           
 DownloadManager addDownloadManager(String fileName, byte[] optionalHash, String savePath, int initialState, boolean persistent)
          Create and add a Download Manager to the global list
 DownloadManager addDownloadManager(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 list
 DownloadManager addDownloadManager(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 list
 DownloadManager addDownloadManager(String fileName, String savePath)
          Create and add a Download Manager to the global list
 void addDownloadManagerInitialisationAdapter(DownloadManagerInitialisationAdapter adapter)
          Any adapters added will get a chance to see/set the initial state of downloads as they are added
 void addDownloadWillBeRemovedListener(GlobalManagerDownloadWillBeRemovedListener l)
          Add a listener triggered when Download is about to be removed
 void addEventListener(GlobalManagerEventListener listener)
           
 void addListener(GlobalManagerListener listener)
          Add a Global Manager listener
 void addListener(GlobalManagerListener listener, boolean trigger)
           
 void canDownloadManagerBeRemoved(DownloadManager manager, boolean remove_torrent, boolean remove_data)
          Determines whether a DownloadManager can be removed
 boolean canPauseDownload(DownloadManager manager)
           
 boolean canPauseDownloads()
          Indicates whether or not there are any downloads that can be paused.
 boolean canResumeDownloads()
          Indicates whether or not there are any paused downloads to resume.
protected  void checkForceStart(boolean known_to_exist)
           
protected  void checkSeedingOnlyState()
           
protected  void checkSeedingOnlyStateSupport()
           
 void clearNonPersistentDownloadState(byte[] hash)
           
protected  void computeNATStatus()
           
 boolean contains(DownloadManager manager)
           
 int downloadManagerCount(boolean bCompleted)
          Retrieve the number of download managers the global manager is managing.
static Long[] enlargeLongArray(Long[] array, int expandTo)
           
 Map exportDownloadStateToMap(DownloadManager dm)
           
 void fireGlobalManagerEvent(int type, DownloadManager param)
           
 void fixUpDownloadManagerPositions()
          Verifies the positions of the DownloadManagers, filling in gaps and shifting duplicate IDs down if necessary.
 void generate(IndentWriter writer)
           
 String getDisplayName(Taggable taggable)
           
protected  DownloadManagerInitialisationAdapter getDMAdapter(DownloadManagerInitialisationAdapter adapter)
           
 Object getDownloadHistoryManager()
           
 DownloadManager getDownloadManager(HashWrapper hw)
          Retrieve the DownloadManager associated with a hash
 DownloadManager getDownloadManager(TOTorrent torrent)
          Retrieve the DownloadManager associated with a TOTorrent object
 List<DownloadManager> getDownloadManagers()
          Retrieve a list of DownloadManagers that GlobalManager is handling
 int getIndexOf(DownloadManager manager)
          Retrieve the index of a DownloadManager within the GlobalManager list retrieved via GlobalManager.getDownloadManagers().
 MainlineDHTProvider getMainlineDHTProvider()
           
 int getNATStatus()
          See plugin ConnectionManager.NAT_ constants for return values
 int getPauseDownloadPeriodRemaining()
          seconds remaining, 0 if not active
 List<Taggable> getResolvedTaggables()
           
 long getResolverTaggableType()
           
 GlobalManagerStats getStats()
          Retrieve the Global Manager Statistics class
 long getTotalSwarmsPeerRate(boolean downloading, boolean seeding)
           
 TRTrackerScraper getTrackerScraper()
          Retrieve the Tracker Scraper management class
 DownloadManager importDownloadStateFromMap(Map map)
           
protected  void informDestroyed()
           
 void informDestroyInitiated()
           
 boolean isMoveableDown(DownloadManager manager)
          Retrieve whether a DownloadManager can move down in the GlobalManager list
 boolean isMoveableUp(DownloadManager manager)
          Retrieve whether a DownloadManager can move up in the GlobalManager list
 boolean isPaused(DownloadManager manager)
          Retrieve whether a DownloadManager is in a paused state
 boolean isPotentiallySeedingOnly()
          As for isSeedingOnly but includes queued seeds
 boolean isSeedingOnly()
          Determines whether we are only seeding, and not currently downloading anything.
 String isSwarmMerging(DownloadManager dm)
           
 DownloadManager loadDownload(Map mDownload, int currentDownload, int nbDownloads, GlobalMangerProgressListener progress_listener, boolean debug)
           
 void loadExistingTorrentsNow(boolean async)
           
static void main(String[] args)
           
 void moveDown(DownloadManager manager)
          Move one DownloadManager down in the GlobalManager's list
 void moveEnd(DownloadManager[] manager)
          Move a list of DownloadManagers to the end of the GlobalManager list
 void moveTo(DownloadManager manager, int newPosition)
          Move a Downloadmanager to a new position.
 void moveTop(DownloadManager[] manager)
          Move a list of DownloadManagers to the top of the GlobalManager list
 void moveUp(DownloadManager manager)
          Move one DownloadManager up in the GlobalManager's list
 boolean pauseDownload(DownloadManager manager)
          Pause one DownloadManager
 void pauseDownloads()
          Pauses (stops) all running downloads/seedings.
protected  void pauseDownloads(boolean tag_only)
           
 void pauseDownloadsForPeriod(int seconds)
          pause any non-paused downloads and auto-resume all downloads after n seconds
 void removeDownloadManager(DownloadManager manager)
          Removes a DownloadManager from the global list, providing it can be removed (see #canDownloadManagerBeRemoved(DownloadManager))
 void removeDownloadManager(DownloadManager manager, boolean remove_torrent, boolean remove_data)
           
 void removeDownloadManagerInitialisationAdapter(DownloadManagerInitialisationAdapter adapter)
           
 void removeDownloadWillBeRemovedListener(GlobalManagerDownloadWillBeRemovedListener l)
          Remove a listener triggered when Download is about to be removed
 void removeEventListener(GlobalManagerEventListener listener)
           
 void removeListener(GlobalManagerListener listener)
          Removes a Global Manager listener
 void requestAttention(String id)
           
 Taggable resolveTaggable(String id)
           
 void resumeDownload(DownloadManager manager)
          Resume a previously paused DownloadManager
 void resumeDownloads()
          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 effect
 boolean 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 immediate)
           
 void saveState()
           
protected  void seedPieceRecheck()
           
protected  boolean seedPieceRecheck(DownloadManager manager)
           
 void setMainlineDHTProvider(MainlineDHTProvider provider)
          Calling this method doesn't prepare Azureus 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)
           
 void startAllDownloads()
          Starts all downloads
 void stateChanged(DownloadManager manager, int new_state)
           
 void statsRequest(Map request, Map reply)
           
 void stopAllDownloads()
          Stops all downloads without removing them
protected  void stopAllDownloads(boolean for_close)
           
 void stopGlobalManager()
          Puts GlobalManager in a stopped state.
Used when closing down Azureus.
 
Methods inherited from class org.gudy.azureus2.core3.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
 

Constructor Detail

GlobalManagerImpl

public GlobalManagerImpl(AzureusCore core,
                         GlobalMangerProgressListener listener,
                         long existingTorrentLoadDelay)
Method Detail

loadExistingTorrentsNow

public void loadExistingTorrentsNow(boolean async)
Specified by:
loadExistingTorrentsNow in interface GlobalManager

addDownloadManager

public DownloadManager addDownloadManager(String fileName,
                                          String savePath)
Description copied from interface: GlobalManager
Create and add a Download Manager to the global list

Specified by:
addDownloadManager in interface GlobalManager
Parameters:
fileName - location and name of torrent file
savePath - 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 interface GlobalManager
Parameters:
fileName - location and name of torrent file
savePath - path to write the data to
initialState - 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 interface GlobalManager
Parameters:
torrent_file_name - location and name of torrent file
savePath - path to write the data to
initialState - Initial state of download. See DownloadManager.STATE_*
persistent - Whether the download should be treated as persistent download
for_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 interface GlobalManager
Parameters:
torrent_file_name - location and name of torrent file
savePath - path to write the data to
initialState - Initial state of download. See DownloadManager.STATE_*
persistent - Whether the download should be treated as persistent download
for_seeding - Whether the manager should assume the torrent is already complete and ready for seeding.
Returns:
true, if the download was added

clearNonPersistentDownloadState

public void clearNonPersistentDownloadState(byte[] hash)
Specified by:
clearNonPersistentDownloadState in interface GlobalManager

addDownloadManager

protected DownloadManager addDownloadManager(DownloadManager download_manager,
                                             boolean save,
                                             boolean notifyListeners)

getDownloadManagers

public List<DownloadManager> getDownloadManagers()
Description copied from interface: GlobalManager
Retrieve a list of DownloadManagers that GlobalManager is handling

Specified by:
getDownloadManagers in interface GlobalManager
Returns:
a list of DownloadManagers

getDownloadManager

public DownloadManager getDownloadManager(TOTorrent torrent)
Description copied from interface: GlobalManager
Retrieve the DownloadManager associated with a TOTorrent object

Specified by:
getDownloadManager in interface GlobalManager
Parameters:
torrent - Torrent to search for
Returns:
The DownloadManager associted with the TOTOrrent, or null if none found

getDownloadManager

public DownloadManager getDownloadManager(HashWrapper hw)
Description copied from interface: GlobalManager
Retrieve the DownloadManager associated with a hash

Specified by:
getDownloadManager in interface GlobalManager
Parameters:
hw - Hash to search for
Returns:
The DownloadManager associted 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 interface GlobalManager
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 (see #canDownloadManagerBeRemoved(DownloadManager))

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

Specified by:
removeDownloadManager in interface GlobalManager
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 interface GlobalManager
Throws:
GlobalManagerDownloadRemovalVetoException

stopGlobalManager

public void stopGlobalManager()
Description copied from interface: GlobalManager
Puts GlobalManager in a stopped state.
Used when closing down Azureus.

Specified by:
stopGlobalManager in interface GlobalManager

stopAllDownloads

public void stopAllDownloads()
Description copied from interface: GlobalManager
Stops all downloads without removing them

Specified by:
stopAllDownloads in interface GlobalManager

stopAllDownloads

protected void stopAllDownloads(boolean for_close)

startAllDownloads

public void startAllDownloads()
Starts all downloads

Specified by:
startAllDownloads in interface GlobalManager

pauseDownload

public boolean pauseDownload(DownloadManager manager)
Description copied from interface: GlobalManager
Pause one DownloadManager

Specified by:
pauseDownload in interface GlobalManager
Parameters:
manager - DownloadManager to pause
Returns:
False if DownloadManager was invalid, stopped, or pause failed

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 interface GlobalManager

getPauseDownloadPeriodRemaining

public int getPauseDownloadPeriodRemaining()
Description copied from interface: GlobalManager
seconds remaining, 0 if not active

Specified by:
getPauseDownloadPeriodRemaining in interface GlobalManager
Returns:

pauseDownloads

public void pauseDownloads()
Description copied from interface: GlobalManager
Pauses (stops) all running downloads/seedings.

Specified by:
pauseDownloads in interface GlobalManager

pauseDownloads

protected void pauseDownloads(boolean tag_only)

canPauseDownload

public boolean canPauseDownload(DownloadManager manager)

isPaused

public boolean isPaused(DownloadManager manager)
Description copied from interface: GlobalManager
Retrieve whether a DownloadManager is in a paused state

Specified by:
isPaused in interface GlobalManager
Parameters:
manager - DownloadManager to query
Returns:
the pause state

canPauseDownloads

public boolean canPauseDownloads()
Description copied from interface: GlobalManager
Indicates whether or not there are any downloads that can be paused.

Specified by:
canPauseDownloads in interface GlobalManager
Returns:
true if there is at least one download to pause, false if none

resumeDownload

public void resumeDownload(DownloadManager manager)
Description copied from interface: GlobalManager
Resume a previously paused DownloadManager

Specified by:
resumeDownload in interface GlobalManager
Parameters:
manager - DownloadManager to resume

resumingDownload

public boolean resumingDownload(DownloadManager manager)
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 interface GlobalManager
Returns:

resumeDownloads

public void resumeDownloads()
Description copied from interface: GlobalManager
Resumes (starts) all downloads paused by the previous pauseDownloads call.

Specified by:
resumeDownloads in interface GlobalManager

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 interface GlobalManager
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 interface GlobalManager
Returns:
true if there is at least one download to resume, false if none.

isSwarmMerging

public String isSwarmMerging(DownloadManager dm)
Specified by:
isSwarmMerging in interface GlobalManager

saveState

public void saveState()
Specified by:
saveState in interface GlobalManager

saveDownloads

protected void saveDownloads(boolean immediate)

loadDownload

public DownloadManager loadDownload(Map mDownload,
                                    int currentDownload,
                                    int nbDownloads,
                                    GlobalMangerProgressListener progress_listener,
                                    boolean debug)

enlargeLongArray

public static Long[] enlargeLongArray(Long[] array,
                                      int expandTo)

exportDownloadStateToMap

public Map exportDownloadStateToMap(DownloadManager dm)
Specified by:
exportDownloadStateToMap in interface GlobalManager

importDownloadStateFromMap

public DownloadManager importDownloadStateFromMap(Map map)
Specified by:
importDownloadStateFromMap in interface GlobalManager

getTrackerScraper

public TRTrackerScraper getTrackerScraper()
Description copied from interface: GlobalManager
Retrieve the Tracker Scraper management class

Specified by:
getTrackerScraper in interface GlobalManager
Returns:

getStats

public GlobalManagerStats getStats()
Description copied from interface: GlobalManager
Retrieve the Global Manager Statistics class

Specified by:
getStats in interface GlobalManager
Returns:
the Global Manager Statistics class

contains

public boolean contains(DownloadManager manager)
Specified by:
contains in interface GlobalManager
Returns:

getIndexOf

public int getIndexOf(DownloadManager manager)
Description copied from interface: GlobalManager
Retrieve the index of a DownloadManager within the GlobalManager list retrieved via GlobalManager.getDownloadManagers().

This is NOT the DownloadManager's position

Specified by:
getIndexOf in interface GlobalManager
Parameters:
manager - DownloadManger to find the index of
Returns:
index, -1 if not in list

isMoveableUp

public boolean isMoveableUp(DownloadManager manager)
Description copied from interface: GlobalManager
Retrieve whether a DownloadManager can move up in the GlobalManager list

Specified by:
isMoveableUp in interface GlobalManager
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 interface GlobalManager
Parameters:
bCompleted - True: Return count of completed downloads
False: Return count of incomplete downloads
Returns:
count

isMoveableDown

public boolean isMoveableDown(DownloadManager manager)
Description copied from interface: GlobalManager
Retrieve whether a DownloadManager can move down in the GlobalManager list

Specified by:
isMoveableDown in interface GlobalManager
Parameters:
manager - DownloadManager to check
Returns:
True - Can move down

moveUp

public void moveUp(DownloadManager manager)
Description copied from interface: GlobalManager
Move one DownloadManager up in the GlobalManager's list

Specified by:
moveUp in interface GlobalManager
Parameters:
manager - DownloadManager to move up

moveDown

public void moveDown(DownloadManager manager)
Description copied from interface: GlobalManager
Move one DownloadManager down in the GlobalManager's list

Specified by:
moveDown in interface GlobalManager
Parameters:
manager - DownloadManager to move down

moveTop

public void moveTop(DownloadManager[] manager)
Description copied from interface: GlobalManager
Move a list of DownloadManagers to the top of the GlobalManager list

Specified by:
moveTop in interface GlobalManager
Parameters:
manager - array list of DownloadManager objects to move

moveEnd

public void moveEnd(DownloadManager[] manager)
Description copied from interface: GlobalManager
Move a list of DownloadManagers to the end of the GlobalManager list

Specified by:
moveEnd in interface GlobalManager
Parameters:
manager - array list of DownloadManager objects to move

moveTo

public void moveTo(DownloadManager manager,
                   int newPosition)
Description copied from interface: GlobalManager
Move a Downloadmanager to a new position.

Specified by:
moveTo in interface GlobalManager
Parameters:
manager - DownloadManager to move
newPosition - position to place

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 interface GlobalManager

getResolverTaggableType

public long getResolverTaggableType()
Specified by:
getResolverTaggableType in interface TaggableResolver

resolveTaggable

public Taggable resolveTaggable(String id)
Specified by:
resolveTaggable in interface TaggableResolver

getResolvedTaggables

public List<Taggable> getResolvedTaggables()
Specified by:
getResolvedTaggables in interface TaggableResolver

getDisplayName

public String getDisplayName(Taggable taggable)
Specified by:
getDisplayName in interface TaggableResolver

requestAttention

public void requestAttention(String id)
Specified by:
requestAttention in interface TaggableResolver

informDestroyed

protected void informDestroyed()

informDestroyInitiated

public void informDestroyInitiated()

addListener

public void addListener(GlobalManagerListener listener)
Description copied from interface: GlobalManager
Add a Global Manager listener

Specified by:
addListener in interface GlobalManager
Parameters:
listener - Listener to add

addListener

public void addListener(GlobalManagerListener listener,
                        boolean trigger)
Specified by:
addListener in interface GlobalManager

removeListener

public void removeListener(GlobalManagerListener listener)
Description copied from interface: GlobalManager
Removes a Global Manager listener

Specified by:
removeListener in interface GlobalManager
Parameters:
listener - Listener to remove

addEventListener

public void addEventListener(GlobalManagerEventListener listener)
Specified by:
addEventListener in interface GlobalManager

removeEventListener

public void removeEventListener(GlobalManagerEventListener listener)
Specified by:
removeEventListener in interface GlobalManager

fireGlobalManagerEvent

public void fireGlobalManagerEvent(int type,
                                   DownloadManager param)
Specified by:
fireGlobalManagerEvent in interface GlobalManager

addDownloadWillBeRemovedListener

public void addDownloadWillBeRemovedListener(GlobalManagerDownloadWillBeRemovedListener l)
Description copied from interface: GlobalManager
Add a listener triggered when Download is about to be removed

Specified by:
addDownloadWillBeRemovedListener in interface GlobalManager
Parameters:
l - Listener to add

removeDownloadWillBeRemovedListener

public void removeDownloadWillBeRemovedListener(GlobalManagerDownloadWillBeRemovedListener l)
Description copied from interface: GlobalManager
Remove a listener triggered when Download is about to be removed

Specified by:
removeDownloadWillBeRemovedListener in interface GlobalManager
Parameters:
l - Listener to remove

stateChanged

public void stateChanged(DownloadManager manager,
                         int new_state)
Specified by:
stateChanged in interface DownloadManagerListener
Overrides:
stateChanged in class DownloadManagerAdapter

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 interface GlobalManager
Returns:
Seeding Only State

isPotentiallySeedingOnly

public boolean isPotentiallySeedingOnly()
Description copied from interface: GlobalManager
As for isSeedingOnly but includes queued seeds

Specified by:
isPotentiallySeedingOnly in interface GlobalManager
Returns:

getTotalSwarmsPeerRate

public long getTotalSwarmsPeerRate(boolean downloading,
                                   boolean seeding)

computeNATStatus

protected void computeNATStatus()

getNATStatus

public int getNATStatus()
Description copied from interface: GlobalManager
See plugin ConnectionManager.NAT_ constants for return values

Specified by:
getNATStatus in interface GlobalManager
Returns:
ConnectionManager.NAT_*

seedPieceRecheck

protected void seedPieceRecheck()

seedPieceRecheck

protected boolean seedPieceRecheck(DownloadManager manager)

getDMAdapter

protected DownloadManagerInitialisationAdapter getDMAdapter(DownloadManagerInitialisationAdapter adapter)

addDownloadManagerInitialisationAdapter

public void addDownloadManagerInitialisationAdapter(DownloadManagerInitialisationAdapter adapter)
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 interface GlobalManager

removeDownloadManagerInitialisationAdapter

public void removeDownloadManagerInitialisationAdapter(DownloadManagerInitialisationAdapter adapter)
Specified by:
removeDownloadManagerInitialisationAdapter in interface GlobalManager

getDownloadHistoryManager

public Object getDownloadHistoryManager()
Specified by:
getDownloadHistoryManager in interface GlobalManager

generate

public void generate(IndentWriter writer)
Specified by:
generate in interface AEDiagnosticsEvidenceGenerator

main

public static void main(String[] args)

setMainlineDHTProvider

public void setMainlineDHTProvider(MainlineDHTProvider provider)
Description copied from interface: GlobalManager
Calling this method doesn't prepare Azureus 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 interface GlobalManager

getMainlineDHTProvider

public MainlineDHTProvider getMainlineDHTProvider()
Specified by:
getMainlineDHTProvider in interface GlobalManager

statsRequest

public void statsRequest(Map request,
                         Map reply)
Specified by:
statsRequest in interface GlobalManager