|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DownloadManager
Field Summary | |
---|---|
static int |
ET_INSUFFICIENT_SPACE
|
static int |
ET_NONE
|
static int |
ET_OTHER
|
static int |
STATE_ALLOCATING
|
static int |
STATE_CHECKING
|
static int |
STATE_CLOSED
|
static int |
STATE_DOWNLOADING
|
static int |
STATE_ERROR
|
static int |
STATE_FINISHING
|
static int |
STATE_INITIALIZED
|
static int |
STATE_INITIALIZING
|
static int |
STATE_QUEUED
|
static int |
STATE_READY
|
static int |
STATE_SEEDING
|
static int |
STATE_START_OF_DAY
|
static int |
STATE_STOPPED
|
static int |
STATE_STOPPING
|
static int |
STATE_WAITING
|
static int |
WEALTH_ERROR
|
static int |
WEALTH_KO
|
static int |
WEALTH_NO_REMOTE
|
static int |
WEALTH_NO_TRACKER
|
static int |
WEALTH_OK
|
static int |
WEALTH_STOPPED
|
Fields inherited from interface com.aelitis.azureus.core.tag.Taggable |
---|
TT_DOWNLOAD, TT_PEER |
Method Summary | |
---|---|
void |
addActivationListener(DownloadManagerActivationListener listener)
|
void |
addDiskListener(DownloadManagerDiskListener listener)
|
void |
addListener(DownloadManagerListener listener)
|
void |
addListener(DownloadManagerListener listener,
boolean triggerStateChange)
|
void |
addPeerListener(DownloadManagerPeerListener listener)
|
void |
addPeerListener(DownloadManagerPeerListener listener,
boolean bDispatchForExisting)
|
void |
addPieceListener(DownloadManagerPieceListener listener)
|
void |
addPieceListener(DownloadManagerPieceListener listener,
boolean bDispatchForExisting)
|
void |
addRateLimiter(LimitedRateGroup group,
boolean upload)
|
void |
addTPSListener(DownloadManagerTPSListener listener)
|
void |
addTrackerListener(DownloadManagerTrackerListener listener)
|
boolean |
canForceRecheck()
|
boolean |
canMoveDataFiles()
|
void |
copyDataFiles(java.io.File parent_dir)
|
void |
destroy(boolean is_duplicate)
Indicates that the download manager is no longer needed |
boolean |
filesExist()
Deprecated. Use filesExist(boolean) - to be removed when EMP dependency removed |
boolean |
filesExist(boolean expected_to_be_allocated)
Checks if all the files the user wants to download from this torrent actually exist on their filesystem. |
void |
fireGlobalManagerEvent(int event_type)
|
void |
forceRecheck()
|
void |
forceRecheck(ForceRecheckListener l)
|
void |
generateEvidence(IndentWriter writer)
|
java.io.File |
getAbsoluteSaveLocation()
Returns the file location where we save the torrent, this includes the parent directory and the actual file name. |
int |
getActivationCount()
|
boolean |
getAssumedComplete()
Retrieve whether this download is assumed complete. |
long |
getAutoResumeTime()
|
long |
getCreationTime()
gives the time this download was created (not the torrent but the download itself) |
int |
getCryptoLevel()
|
PEPeer[] |
getCurrentPeers()
|
PEPiece[] |
getCurrentPieces()
|
java.lang.Object |
getData(java.lang.String key)
Deprecated. Use getUserData |
DiskManager |
getDiskManager()
|
DiskManagerFileInfo[] |
getDiskManagerFileInfo()
Deprecated. use getDiskManagerFileInfoSet() instead |
DiskManagerFileInfoSet |
getDiskManagerFileInfoSet()
|
java.lang.String |
getDisplayName()
|
DownloadManagerState |
getDownloadState()
|
int |
getEffectiveMaxUploads()
Returns the max uploads depending on whether the download is seeding and it has a separate rate for this |
int |
getEffectiveUploadRateLimitBytesPerSecond()
returns the currently in force upload speed limit which may vary from the stats. |
java.lang.String |
getErrorDetails()
|
int |
getErrorType()
|
int |
getExtendedMessagingMode()
|
GlobalManager |
getGlobalManager()
|
java.util.List<TRTrackerScraperResponse> |
getGoodTrackerScrapeResponses()
|
int |
getHealthStatus()
|
java.lang.String |
getInternalName()
returns a name based on the torrent hash or an empty string if torrent invalid |
int |
getMaxUploads()
|
int |
getNATStatus()
See plugin ConnectionManager.NAT_ constants for return values |
int |
getNbPeers()
|
int |
getNbPieces()
|
int |
getNbSeeds()
|
int |
getNumFileInfos()
|
PEPeerManager |
getPeerManager()
|
java.lang.String |
getPieceLength()
|
int |
getPosition()
|
LimitedRateGroup[] |
getRateLimiters(boolean upload)
|
java.io.File |
getSaveLocation()
|
int |
getSeedingRank()
|
long |
getSize()
|
int |
getState()
|
DownloadManagerStats |
getStats()
|
int[] |
getStorageType(DiskManagerFileInfo[] infos)
|
int |
getSubState()
For stopping this returns the target state after stopping (stopped/queued) |
TOTorrent |
getTorrent()
|
java.lang.String |
getTorrentComment()
|
java.lang.String |
getTorrentCreatedBy()
|
long |
getTorrentCreationDate()
|
java.lang.String |
getTorrentFileName()
This includes the full path to the torrent file. |
TRTrackerAnnouncer |
getTrackerClient()
|
java.util.List<TrackerPeerSource> |
getTrackerPeerSources()
|
TRTrackerScraperResponse |
getTrackerScrapeResponse()
|
java.lang.String |
getTrackerStatus()
|
int |
getTrackerTime()
When the next call to the tracker will occur (in seconds) |
java.lang.Object |
getUserData(java.lang.Object key)
|
void |
initialize()
|
boolean |
isDataAlreadyAllocated()
Determine whether disk allocation has already been done. |
boolean |
isDestroyed()
|
boolean |
isDownloadComplete(boolean bIncludingDND)
Retrieves whether the download is complete |
boolean |
isForceStart()
|
boolean |
isInDefaultSaveDir()
Returns true if the download is being saved to one of the default save directories. |
boolean |
isPaused()
|
boolean |
isPersistent()
|
java.lang.String |
isSwarmMerging()
|
boolean |
isTrackerError()
|
boolean |
isUnauthorisedOnTracker()
|
void |
moveDataFiles(java.io.File new_parent_dir)
Move data files to new location. |
void |
moveDataFiles(java.io.File new_parent_dir,
java.lang.String new_name)
Move the files and rename a download in one go. |
void |
moveDataFilesLive(java.io.File new_parent_dir)
At some point someone made the file-move operations stop+restart the download when it was designed to work without doing this (see move-on-complete for example). |
void |
moveTorrentFile(java.io.File new_parent_dir)
Move torrent file to new location. |
void |
moveTorrentFile(java.io.File parent_dir,
java.lang.String new_name)
|
boolean |
pause()
|
boolean |
pause(long auto_resume_time)
|
void |
recheckFile(DiskManagerFileInfo file)
Recheck a particular file. |
void |
removeActivationListener(DownloadManagerActivationListener listener)
|
void |
removeDiskListener(DownloadManagerDiskListener listener)
|
void |
removeListener(DownloadManagerListener listener)
|
void |
removePeerListener(DownloadManagerPeerListener listener)
|
void |
removePieceListener(DownloadManagerPieceListener listener)
|
void |
removeRateLimiter(LimitedRateGroup group,
boolean upload)
|
void |
removeTPSListener(DownloadManagerTPSListener listener)
|
void |
removeTrackerListener(DownloadManagerTrackerListener listener)
|
void |
rename(java.lang.String new_name)
Renames the save file, torrent file and the displayed name. |
void |
renameDownload(java.lang.String new_name)
Rename the download - this means the name of the file being downloaded (for single file torrents), or the name of the directory holding the files (in a multi-file torrent). |
void |
renameTorrent(java.lang.String new_name)
|
void |
renameTorrentSafe(java.lang.String name)
Same as renameTorrent, but appends numbers if torrent already exists |
boolean |
requestAssumedCompleteMode()
Will set this download to be "assumed complete" for if the download is already complete (excluding DND) |
void |
requestAttention()
|
void |
requestTrackerAnnounce(boolean immediate)
|
void |
requestTrackerScrape(boolean immediate)
|
void |
resetFile(DiskManagerFileInfo file)
Reset the file download state to totally undownloaded. |
void |
resume()
|
void |
saveDownload()
persist any general download related information, excluding resume data which is managed separately by saveResumeData |
void |
saveResumeData()
persist resume data |
boolean |
seedPieceRecheck()
Gives the download an opportunity to schedule seeding mode piece rechecks if desired |
void |
setAnnounceResult(DownloadAnnounceResult result)
|
void |
setCreationTime(long t)
|
void |
setCryptoLevel(int level)
|
void |
setData(java.lang.String key,
java.lang.Object value)
Deprecated. @deprecated Use setUserData |
void |
setDataAlreadyAllocated(boolean already_allocated)
Set whether data allocation has already been done, so we know when to allocate and when to throw a missing-data error message. |
void |
setFilePriorities(DiskManagerFileInfo[] fileInfos,
int type)
Sets the priority for an array for files |
void |
setForceStart(boolean forceStart)
|
void |
setMaxUploads(int max_slots)
|
void |
setPieceCheckingEnabled(boolean enabled)
Use with care - introduced to support speed tests whereby we want to avoid checking the virtual torrent used for the test |
void |
setPosition(int newPosition)
|
void |
setScrapeResult(DownloadScrapeResult result)
|
void |
setSeedingRank(int rank)
|
void |
setStateQueued()
|
void |
setStateWaiting()
|
void |
setTorrentFile(java.io.File new_parent_dir,
java.lang.String new_name)
Sets the torrent file name (will perform a move of the torrent file) - this shouldn't be used unless you know what you are doing (it requires the download to be stopped!) - it is safer to use moveTorrentFile instead. |
void |
setTorrentFileName(java.lang.String string)
|
void |
setTorrentSaveDir(java.lang.String sPath)
changes the save directory. |
void |
setTorrentSaveDir(java.lang.String parent_dir,
java.lang.String dl_name)
changes the save directory. |
void |
setTrackerScrapeResponse(TRTrackerScraperResponse response)
|
void |
setUserData(java.lang.Object key,
java.lang.Object value)
To store arbitrary objects against this object. |
void |
startDownload()
|
void |
stopIt(int stateAfterStopping,
boolean remove_torrent,
boolean remove_data)
Stop the download manager, and do any file/torrent removals. |
void |
stopIt(int stateAfterStopping,
boolean remove_torrent,
boolean remove_data,
boolean for_removal)
As above but definitely indicates that the stop is for removal (if for_removal is true) and therefore that any removal specific actions such as removing partial files should be performed |
void |
updateAutoUploadPriority(java.lang.Object key,
boolean inc)
|
Methods inherited from interface com.aelitis.azureus.core.tag.Taggable |
---|
getTaggableID, getTaggableResolver, getTaggableTransientProperty, getTaggableType, setTaggableTransientProperty |
Field Detail |
---|
static final int STATE_START_OF_DAY
static final int STATE_WAITING
static final int STATE_INITIALIZING
static final int STATE_INITIALIZED
static final int STATE_ALLOCATING
static final int STATE_CHECKING
static final int STATE_READY
static final int STATE_DOWNLOADING
static final int STATE_FINISHING
static final int STATE_SEEDING
static final int STATE_STOPPING
static final int STATE_STOPPED
static final int STATE_CLOSED
static final int STATE_QUEUED
static final int STATE_ERROR
static final int WEALTH_STOPPED
static final int WEALTH_NO_TRACKER
static final int WEALTH_NO_REMOTE
static final int WEALTH_OK
static final int WEALTH_KO
static final int WEALTH_ERROR
static final int ET_NONE
static final int ET_OTHER
static final int ET_INSUFFICIENT_SPACE
Method Detail |
---|
void initialize()
int getState()
int getSubState()
void setStateWaiting()
void setStateQueued()
void startDownload()
boolean canForceRecheck()
void forceRecheck()
void forceRecheck(ForceRecheckListener l)
l
- void resetFile(DiskManagerFileInfo file)
file
- void recheckFile(DiskManagerFileInfo file)
file
- void setPieceCheckingEnabled(boolean enabled)
enabled
- void stopIt(int stateAfterStopping, boolean remove_torrent, boolean remove_data)
_stateAfterStopping
- remove_torrent
- remove the .torrent file after stoppingremove_data
- remove the data file after stoppingvoid stopIt(int stateAfterStopping, boolean remove_torrent, boolean remove_data, boolean for_removal)
stateAfterStopping
- remove_torrent
- remove_data
- for_removal
- boolean pause()
boolean pause(long auto_resume_time)
boolean isPaused()
void resume()
long getAutoResumeTime()
GlobalManager getGlobalManager()
DiskManager getDiskManager()
DiskManagerFileInfo[] getDiskManagerFileInfo()
DiskManagerFileInfoSet getDiskManagerFileInfoSet()
int getNumFileInfos()
PEPeerManager getPeerManager()
DownloadManagerState getDownloadState()
TOTorrent getTorrent()
TRTrackerAnnouncer getTrackerClient()
void requestTrackerAnnounce(boolean immediate)
void requestTrackerScrape(boolean immediate)
TRTrackerScraperResponse getTrackerScrapeResponse()
java.util.List<TRTrackerScraperResponse> getGoodTrackerScrapeResponses()
void setTrackerScrapeResponse(TRTrackerScraperResponse response)
java.lang.String getDisplayName()
java.lang.String getInternalName()
long getSize()
java.lang.String getTorrentFileName()
void setTorrentFileName(java.lang.String string)
java.io.File getAbsoluteSaveLocation()
java.io.File getSaveLocation()
void setTorrentSaveDir(java.lang.String sPath)
sPath
- void setTorrentSaveDir(java.lang.String parent_dir, java.lang.String dl_name)
sPath
- boolean isForceStart()
void setForceStart(boolean forceStart)
boolean isPersistent()
boolean isDownloadComplete(boolean bIncludingDND)
bIncludingDND
- true- include files marked as Do Not Download.If there are DND files and you choose to include DND in the calculation, false will always be returned.
java.lang.String getTrackerStatus()
int getTrackerTime()
java.lang.String getTorrentComment()
java.lang.String getTorrentCreatedBy()
long getTorrentCreationDate()
int getNbPieces()
java.lang.String getPieceLength()
int getNbSeeds()
int getNbPeers()
boolean filesExist()
filesExist(boolean)
- to be removed when EMP dependency removed
boolean filesExist(boolean expected_to_be_allocated)
If a file does not exist, the download will be set to error state.
expected_to_be_allocated
- if this is false and allocation hasn't been attempted then the method will return with false without marking the download as in an error state
java.lang.String getErrorDetails()
int getErrorType()
DownloadManagerStats getStats()
int getPosition()
void setPosition(int newPosition)
boolean getAssumedComplete()
Assumed complete status is kept while the torrent is in a non-running state, even if it has no data.
When the torrent starts up, the real complete level will be checked, and if the torrent actually does have missing data, the download will be thrown into error state.
Only a forced-recheck should clear this flag.
#requestAssumedCompleteMode()}
boolean requestAssumedCompleteMode()
int getHealthStatus()
int getNATStatus()
void saveResumeData()
void saveDownload()
java.lang.Object getData(java.lang.String key)
void setData(java.lang.String key, java.lang.Object value)
java.lang.Object getUserData(java.lang.Object key)
void setUserData(java.lang.Object key, java.lang.Object value)
boolean isDataAlreadyAllocated()
void setDataAlreadyAllocated(boolean already_allocated)
already_allocated
- void setSeedingRank(int rank)
int getSeedingRank()
java.lang.String isSwarmMerging()
void setMaxUploads(int max_slots)
int getMaxUploads()
void updateAutoUploadPriority(java.lang.Object key, boolean inc)
int getEffectiveMaxUploads()
int getEffectiveUploadRateLimitBytesPerSecond()
void setCryptoLevel(int level)
int getCryptoLevel()
void moveDataFiles(java.io.File new_parent_dir) throws DownloadManagerException
new_parent_dir
-
DownloadManagerException
void moveDataFilesLive(java.io.File new_parent_dir) throws DownloadManagerException
new_parent_dir
-
DownloadManagerException
void copyDataFiles(java.io.File parent_dir) throws DownloadManagerException
DownloadManagerException
void renameDownload(java.lang.String new_name) throws DownloadManagerException
new_name
-
DownloadManagerException
void moveDataFiles(java.io.File new_parent_dir, java.lang.String new_name) throws DownloadManagerException
DownloadManagerException
moveDataFiles(File)
,
renameDownload(String)
void moveTorrentFile(java.io.File new_parent_dir) throws DownloadManagerException
new_parent_dir
-
DownloadManagerException
boolean isInDefaultSaveDir()
long getCreationTime()
void setCreationTime(long t)
void setAnnounceResult(DownloadAnnounceResult result)
void setScrapeResult(DownloadScrapeResult result)
boolean isUnauthorisedOnTracker()
boolean isTrackerError()
int getExtendedMessagingMode()
void destroy(boolean is_duplicate)
is_duplicate
- indicates whether this dm is being destroyed because it is a duplicateboolean isDestroyed()
PEPiece[] getCurrentPieces()
PEPeer[] getCurrentPeers()
java.util.List<TrackerPeerSource> getTrackerPeerSources()
boolean seedPieceRecheck()
void addRateLimiter(LimitedRateGroup group, boolean upload)
LimitedRateGroup[] getRateLimiters(boolean upload)
void removeRateLimiter(LimitedRateGroup group, boolean upload)
void addListener(DownloadManagerListener listener, boolean triggerStateChange)
listener
- triggerStateChange
- void addListener(DownloadManagerListener listener)
void removeListener(DownloadManagerListener listener)
void addTrackerListener(DownloadManagerTrackerListener listener)
void removeTrackerListener(DownloadManagerTrackerListener listener)
void addPeerListener(DownloadManagerPeerListener listener)
void addPeerListener(DownloadManagerPeerListener listener, boolean bDispatchForExisting)
void removePeerListener(DownloadManagerPeerListener listener)
void addPieceListener(DownloadManagerPieceListener listener)
void addPieceListener(DownloadManagerPieceListener listener, boolean bDispatchForExisting)
void removePieceListener(DownloadManagerPieceListener listener)
void addDiskListener(DownloadManagerDiskListener listener)
void removeDiskListener(DownloadManagerDiskListener listener)
int getActivationCount()
void addActivationListener(DownloadManagerActivationListener listener)
void removeActivationListener(DownloadManagerActivationListener listener)
void addTPSListener(DownloadManagerTPSListener listener)
void removeTPSListener(DownloadManagerTPSListener listener)
void generateEvidence(IndentWriter writer)
int[] getStorageType(DiskManagerFileInfo[] infos)
boolean canMoveDataFiles()
void rename(java.lang.String new_name) throws DownloadManagerException
DownloadManagerException
void renameTorrent(java.lang.String new_name) throws DownloadManagerException
DownloadManagerException
void renameTorrentSafe(java.lang.String name) throws DownloadManagerException
DownloadManagerException
void moveTorrentFile(java.io.File parent_dir, java.lang.String new_name) throws DownloadManagerException
DownloadManagerException
void setTorrentFile(java.io.File new_parent_dir, java.lang.String new_name) throws DownloadManagerException
DownloadManagerException
void fireGlobalManagerEvent(int event_type)
void setFilePriorities(DiskManagerFileInfo[] fileInfos, int type)
fileInfos
- type
- void requestAttention()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |