|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.gudy.azureus2.core3.logging.LogRelation
org.gudy.azureus2.pluginsimpl.local.download.DownloadImpl
public class DownloadImpl
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.gudy.azureus2.plugins.download.DownloadStub |
|---|
DownloadStub.DownloadStubFile |
| Field Summary |
|---|
| Fields inherited from interface org.gudy.azureus2.plugins.download.Download |
|---|
FLAG_ALLOW_PERMITTED_PEER_SOURCE_CHANGES, FLAG_DISABLE_AUTO_FILE_MOVE, FLAG_DISABLE_IP_FILTER, FLAG_DO_NOT_DELETE_DATA_ON_REMOVE, FLAG_FORCE_DIRECT_DELETE, FLAG_LIGHT_WEIGHT, FLAG_LOW_NOISE, FLAG_METADATA_DOWNLOAD, FLAG_MOVE_ON_COMPLETION_DONE, FLAG_ONLY_EVER_SEEDED, FLAG_SCAN_INCOMPLETE_PIECES, PR_HIGH_PRIORITY, PR_LOW_PRIORITY, ST_DOWNLOADING, ST_ERROR, ST_NAMES, ST_PREPARING, ST_QUEUED, ST_READY, ST_SEEDING, ST_STOPPED, ST_STOPPING, ST_WAITING |
| Fields inherited from interface org.gudy.azureus2.core3.download.DownloadManagerStateAttributeListener |
|---|
WILL_BE_READ, WRITTEN |
| Constructor Summary | |
|---|---|
protected |
DownloadImpl(DownloadManagerImpl _manager,
DownloadManager _dm)
|
| Method Summary | |
|---|---|
boolean |
activateRequest(int count)
|
void |
addActivationListener(DownloadActivationListener l)
Adds a listener that will be invoked when a request is made to activate a torrent. |
void |
addAttributeListener(DownloadAttributeListener listener,
TorrentAttribute attr,
int event_type)
Adds a listener that will be informed of when attributes on a download have been read / modified. |
void |
addCompletionListener(DownloadCompletionListener l)
Adds a listener that will be informed when a download moves into a completed state. |
void |
addDownloadWillBeRemovedListener(DownloadWillBeRemovedListener l)
Adds a listener that will be informed when a download is about to be removed. |
void |
addListener(DownloadListener l)
Adds a listener that will be informed of changes to a download's state. |
void |
addPeerListener(DownloadPeerListener listener)
Adds a listener that will be informed of when peer managers have been added / removed for a download. |
void |
addPropertyListener(DownloadPropertyListener l)
Adds a listener that will be informed of when properties on a download have been read / modified. |
void |
addRateLimiter(RateLimiter limiter,
boolean is_upload)
|
void |
addTrackerListener(DownloadTrackerListener l)
Adds a listener that will be informed when the latest announce/scrape results change. |
void |
addTrackerListener(DownloadTrackerListener l,
boolean immediateTrigger)
Adds a listener that will be informed when the latest announce/scrape results change. |
void |
announceResult(TRTrackerAnnouncerResponse response)
|
void |
attributeEventOccurred(DownloadManager download,
String attribute,
int event_type)
|
SaveLocationChange |
calculateDefaultDownloadLocation()
Returns a SaveLocationChange object describing the appropriate location
for the download (and torrent file) to exist in, based on the download's completion
state, the for-completion rules in place, and the SaveLocationManager
object in use. |
File[] |
calculateDefaultPaths(boolean for_moving)
Deprecated. |
boolean |
canBeRemoved()
Tests whether or not a download can be removed. |
boolean |
canMoveDataFiles()
Returns true if Azureus will allow the data files for the torrent to be moved. |
boolean |
canStubbify()
|
void |
changeLocation(SaveLocationChange slc)
Apply the changes in the given SaveLocationChange object - this includes
moving torrent and data file data. |
void |
completionChanged(DownloadManager manager,
boolean bCompleted)
Notification that the completion state has changed. |
protected TorrentAttribute |
convertAttribute(String name)
|
protected String |
convertAttribute(TorrentAttribute attribute)
|
protected int |
convertState(int dm_state)
|
protected void |
destroy()
|
Download |
destubbify()
|
void |
downloadComplete(DownloadManager manager)
Notification that we were downloading and the download has completed |
void |
filePriorityChanged(DownloadManager download,
DiskManagerFileInfo file)
|
DownloadActivationEvent |
getActivationState()
Gives access to the current activation state. |
DownloadScrapeResult |
getAggregatedScrapeResult()
Returns an aggregated scrape result of all good results, or if none the same as getLastScrapeResult |
String |
getAttribute(TorrentAttribute attribute)
Gets an attribute of this download. |
boolean |
getBooleanAttribute(TorrentAttribute attribute)
Gets the value of the given attribute from the download. |
String |
getCategoryName()
Returns the name of the Category |
long |
getCreationTime()
returns the time this download was created in milliseconds |
DiskManager |
getDiskManager()
Return the disk manager, null if its not running |
int |
getDiskManagerFileCount()
Return the number of DiskManagerFile objects |
DiskManagerFileInfo[] |
getDiskManagerFileInfo()
Returns info about the torrent's files. |
DiskManagerFileInfo |
getDiskManagerFileInfo(int index)
Returns file info for the given index. |
List<DistributedDatabase> |
getDistributedDatabases()
|
DownloadManager |
getDownload()
|
byte[] |
getDownloadPeerId()
Get the local peerID advertised to the download swarm. |
int |
getDownloadRateLimitBytesPerSecond()
Get the max download rate allowed for this download. |
String |
getErrorStateDetails()
When the download state is ERROR this method returns the error details |
boolean |
getFlag(long flag)
Get the flag value |
long |
getFlags()
get all the flags as a bitmap |
int |
getIndex()
Index of download. |
int |
getIntAttribute(TorrentAttribute attribute)
Gets the value of the given attribute from the download. |
DownloadAnnounceResult |
getLastAnnounceResult()
Gives access to the last announce result received from the tracker for the download |
DownloadScrapeResult |
getLastScrapeResult()
Gives access to the last scrape result received from the tracker for the download |
String[] |
getListAttribute(TorrentAttribute attribute)
|
long |
getLongAttribute(TorrentAttribute attribute)
Gets the value of the given attribute from the download. |
Map |
getMapAttribute(TorrentAttribute attribute)
|
int |
getMaximumDownloadKBPerSecond()
Get the max download rate allowed for this download |
String |
getName()
Returns the name of the torrent. |
PeerManager |
getPeerManager()
return the current peer manager for the download. |
int |
getPosition()
Returns the current position in the queue Completed and Incompleted downloads have seperate position sets. |
int |
getPriority()
Downloads can either be low or high priority (see PR_ constants above) |
Object[] |
getQueryableInterfaces()
Query this class for a reference to another class that it may hold |
String |
getRelationText()
A short description of what your class holds that can be printed by the logger |
String |
getSavePath()
This returns the full save path for the download. |
int |
getSeedingRank()
The torrents with the highest rankings will be seeded first. |
int |
getState()
get state from above ST_ set |
DownloadStats |
getStats()
Gives access to the download's statistics |
DownloadStub.DownloadStubFile[] |
getStubFiles()
|
int |
getSubState()
For the STOPPING state this method gives the state that is being transited too (STOPPED, QUEUED or ERROR) |
Torrent |
getTorrent()
Each download has a corresponding torrent |
String |
getTorrentFileName()
Returns the full file path and name of the .torrent file |
byte[] |
getTorrentHash()
|
long |
getTorrentSize()
|
TrackerPeerSource |
getTrackerPeerSource()
|
int |
getUploadRateLimitBytesPerSecond()
Get the max upload rate allowed for this download. |
Object |
getUserData(Object key)
get user-defined key/value |
boolean |
hasAttribute(TorrentAttribute attribute)
Returns true if the download has an explicit value stored for
the given attribute. |
void |
initialize()
See lifecycle description above |
boolean |
isChecking()
When a download is completed it is rechecked (if the option is enabled). |
boolean |
isComplete()
Indicates if the download has completed or not, exluding any files marked as Do No Download |
boolean |
isComplete(boolean bIncludeDND)
Indicates if the download has completed or not |
boolean |
isForceStart()
Retrieves whether the download is force started |
boolean |
isInDefaultSaveDir()
Returns true if the download is being saved to one of the default save directories. |
boolean |
isMessagingEnabled()
Is advanced AZ messaging enabled for this download. |
boolean |
isMoving()
Returns true if the download is currently in the process of having its datafiles moved |
boolean |
isPaused()
|
boolean |
isPersistent()
Downloads can be persistent (be remembered across Azureus sessions), or non-persistent. |
boolean |
isPriorityLocked()
When a download's priority is locked this means that seeding rules should not change a downloads priority, it is under manual control |
protected void |
isRemovable()
|
boolean |
isRemoved()
|
boolean |
isStartStopLocked()
When a download is "start-stop locked" it means that seeding rules shouldn't start or stop the download as it is under manual control |
boolean |
isStub()
|
void |
moveDataFiles(File new_parent_dir)
Move a download's data files to a new location. |
void |
moveDataFiles(File new_parent_dir,
String new_name)
Move a download's data files to a new location, and rename the download at the same time. |
void |
moveDown()
Moves the download down one position |
void |
moveTo(int pos)
Moves a download and re-orders the others appropriately. |
void |
moveTorrentFile(File new_parent_dir)
Move a download's torrent file to a new location. |
void |
moveUp()
Moves the download position up one |
void |
pause()
Pause the download |
void |
positionChanged(DownloadManager download,
int oldPosition,
int newPosition)
|
void |
recheckData()
Performs a complete recheck of the downloaded data Download must be in stopped, queued or error state Action is performed asynchronously and will progress the download through states PREPARING back to the relevant state |
void |
remove()
Removes a download. |
void |
remove(boolean delete_torrent,
boolean delete_data)
Same as "remove" but, if successful, deletes the torrent and/or data |
void |
removeActivationListener(DownloadActivationListener l)
Removes a listener object added via the DownloadEventNotifier.addActivationListener(DownloadActivationListener) method. |
void |
removeAttributeListener(DownloadAttributeListener listener,
TorrentAttribute attr,
int event_type)
Removes a listener object added via the {@link #addAttributeListener(DownloadAttributeListener, TorrentAttribute, int) method. |
void |
removeCompletionListener(DownloadCompletionListener l)
Removes a listener object removed via the DownloadEventNotifier.addCompletionListener(DownloadCompletionListener) method. |
void |
removeDownloadWillBeRemovedListener(DownloadWillBeRemovedListener l)
Removes a listener object added via the DownloadEventNotifier.addDownloadWillBeRemovedListener(DownloadWillBeRemovedListener)
method. |
void |
removeListener(DownloadListener l)
Removes a listener object added via the #addDownloadListener(DownloadListener) method. |
void |
removePeerListener(DownloadPeerListener listener)
Removes a listener object added via the DownloadEventNotifier.addPeerListener(DownloadPeerListener) method. |
void |
removePropertyListener(DownloadPropertyListener l)
Removes a listener object added via the DownloadEventNotifier.addPropertyListener(DownloadPropertyListener) method. |
void |
removeRateLimiter(RateLimiter limiter,
boolean is_upload)
|
void |
removeTrackerListener(DownloadTrackerListener l)
Removes a listener object added via the DownloadEventNotifier.addTrackerListener(DownloadTrackerListener) or
DownloadEventNotifier.addTrackerListener(DownloadTrackerListener, boolean) method. |
void |
renameDownload(String new_name)
Renames the file (for a single file torrent) or directory (for a multi file torrent) where the download is being saved to. |
void |
requestTrackerAnnounce()
request a tracker announce |
void |
requestTrackerAnnounce(boolean immediate)
request a tracker announce |
void |
requestTrackerScrape(boolean immediate)
request a tracker announce |
void |
restart()
See lifecycle description above |
void |
resume()
Resume the download if paused |
void |
scrapeResult(TRTrackerScraperResponse response)
|
void |
setAnnounceResult(DownloadAnnounceResult result)
|
void |
setAttribute(TorrentAttribute attribute,
String value)
Sets an attribute of this download. |
void |
setBooleanAttribute(TorrentAttribute attribute,
boolean value)
Sets a boolean attribute on this download. |
void |
setCategory(String sName)
Sets the category for the download |
void |
setDownloadRateLimitBytesPerSecond(int max_rate_bps)
Set the max download rate allowed for this download. |
void |
setFlag(long flag,
boolean set)
Set the flag value. |
void |
setForceStart(boolean forceStart)
Set the forcestart state of the download |
void |
setIntAttribute(TorrentAttribute attribute,
int value)
Sets an integer attribute on this download. |
void |
setListAttribute(TorrentAttribute attribute,
String[] value)
|
void |
setLongAttribute(TorrentAttribute attribute,
long value)
Sets a long attribute on this download. |
void |
setMapAttribute(TorrentAttribute attribute,
Map value)
|
void |
setMaximumDownloadKBPerSecond(int kb)
Sets the maximum download speed in bytes per second. |
void |
setMessagingEnabled(boolean enabled)
Enable or disable advanced AZ messaging for this download. |
void |
setPosition(int newPosition)
Sets the position in the queue Completed and Incompleted downloads have seperate position sets |
void |
setPriority(int priority)
This method sets a download's priority |
void |
setScrapeResult(DownloadScrapeResult result)
|
void |
setSeedingRank(int rank)
The torrents with the highest rankings will be seeded first. |
void |
setUploadRateLimitBytesPerSecond(int max_rate_bps)
Set the max upload rate allowed for this download. |
void |
setUserData(Object key,
Object data)
set user defined value. |
void |
start()
See lifecycle description above |
void |
startDownload(boolean force)
Simple method to start the download. |
void |
stateChanged(DownloadManager manager,
int state)
|
void |
stateChanged(DownloadManagerState state,
DownloadManagerStateEvent event)
|
void |
stop()
See lifecycle description above |
void |
stopAndQueue()
See lifecycle description above |
void |
stopDownload()
Simple method to stop the download. |
DownloadStub |
stubbify()
|
void |
torrentChanged()
|
| Methods inherited from class org.gudy.azureus2.core3.logging.LogRelation |
|---|
propogatedRelationText, queryForClass, queryForClass |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected DownloadImpl(DownloadManagerImpl _manager,
DownloadManager _dm)
| Method Detail |
|---|
public DownloadManager getDownload()
public int getState()
Download
getState in interface Downloadpublic int getSubState()
Download
getSubState in interface Downloadprotected int convertState(int dm_state)
public String getErrorStateDetails()
Download
getErrorStateDetails in interface Downloadpublic long getFlags()
Download
getFlags in interface Downloadpublic boolean getFlag(long flag)
Download
getFlag in interface Downloadflag - FLAG value from above
public void setFlag(long flag,
boolean set)
Download
setFlag in interface Downloadflag - FLAG value from aboveset - true to enable the flag, false to disable it.public int getIndex()
DownloadDownload.getPosition()
getIndex in interface Downloadpublic Torrent getTorrent()
Download
getTorrent in interface Download
public void initialize()
throws DownloadException
Download
initialize in interface DownloadDownloadException
public void start()
throws DownloadException
Download
start in interface DownloadDownloadException
public void restart()
throws DownloadException
Download
restart in interface DownloadDownloadException
public void stop()
throws DownloadException
Download
stop in interface DownloadDownloadException
public void stopAndQueue()
throws DownloadException
Download
stopAndQueue in interface DownloadDownloadException
public void recheckData()
throws DownloadException
Download
recheckData in interface DownloadDownloadExceptionpublic boolean isStartStopLocked()
Download
isStartStopLocked in interface Downloadpublic boolean isForceStart()
Download
isForceStart in interface Downloadpublic void setForceStart(boolean forceStart)
Download
setForceStart in interface DownloadforceStart - True - Download will start, despite any Start/Stop rules/limitspublic boolean isPaused()
isPaused in interface Downloadpublic void pause()
Download
pause in interface Downloadpublic void resume()
Download
resume in interface Downloadpublic int getPosition()
Download
getPosition in interface Downloadpublic long getCreationTime()
Download
getCreationTime in interface Downloadpublic void setPosition(int newPosition)
Download
setPosition in interface Downloadpublic void moveUp()
Download
moveUp in interface Downloadpublic void moveDown()
Download
moveDown in interface Downloadpublic void moveTo(int pos)
Download
moveTo in interface Downloadpublic String getName()
Download
getName in interface DownloadgetName in interface DownloadStubpublic String getTorrentFileName()
Download
getTorrentFileName in interface Downloadpublic String getCategoryName()
Download
getCategoryName in interface Downloadpublic String getAttribute(TorrentAttribute attribute)
Download
getAttribute in interface Downloadpublic String[] getListAttribute(TorrentAttribute attribute)
getListAttribute in interface Download
public void setListAttribute(TorrentAttribute attribute,
String[] value)
setListAttribute in interface Download
public void setMapAttribute(TorrentAttribute attribute,
Map value)
setMapAttribute in interface Downloadvalue - must be bencodable - key is string, value is Map, List, Long or byte[]public Map getMapAttribute(TorrentAttribute attribute)
getMapAttribute in interface Download
public void setAttribute(TorrentAttribute attribute,
String value)
Download
setAttribute in interface Downloadattribute - Previously created attributevalue - Value to store. null to remove attributepublic boolean hasAttribute(TorrentAttribute attribute)
Downloadtrue if the download has an explicit value stored for
the given attribute.
hasAttribute in interface Downloadpublic boolean getBooleanAttribute(TorrentAttribute attribute)
Downloadfalse will be returned.
getBooleanAttribute in interface Download
public void setBooleanAttribute(TorrentAttribute attribute,
boolean value)
Download
setBooleanAttribute in interface Downloadpublic int getIntAttribute(TorrentAttribute attribute)
Download0 will be returned.
getIntAttribute in interface Download
public void setIntAttribute(TorrentAttribute attribute,
int value)
Download
setIntAttribute in interface Downloadpublic long getLongAttribute(TorrentAttribute attribute)
Download0 will be returned.
getLongAttribute in interface DownloadgetLongAttribute in interface DownloadStub
public void setLongAttribute(TorrentAttribute attribute,
long value)
Download
setLongAttribute in interface DownloadsetLongAttribute in interface DownloadStubprotected String convertAttribute(TorrentAttribute attribute)
protected TorrentAttribute convertAttribute(String name)
public void setCategory(String sName)
Download
setCategory in interface DownloadsName - Category namepublic boolean isPersistent()
Download
isPersistent in interface Download
public void remove()
throws DownloadException,
DownloadRemovalVetoException
Download
remove in interface Downloadremove in interface DownloadStubDownloadException
DownloadRemovalVetoException
public void remove(boolean delete_torrent,
boolean delete_data)
throws DownloadException,
DownloadRemovalVetoException
Download
remove in interface DownloadDownloadException
DownloadRemovalVetoException
public boolean canBeRemoved()
throws DownloadRemovalVetoException
Download
canBeRemoved in interface DownloadDownloadRemovalVetoExceptionpublic DownloadStats getStats()
Download
getStats in interface Downloadpublic boolean isComplete()
Download
isComplete in interface Downloadpublic boolean isComplete(boolean bIncludeDND)
Download
isComplete in interface DownloadbIncludeDND - Whether to include DND files when determining
completion state
public boolean isChecking()
Download
isChecking in interface Downloadpublic boolean isMoving()
Download
isMoving in interface Download
protected void isRemovable()
throws DownloadRemovalVetoException
DownloadRemovalVetoExceptionprotected void destroy()
public void stateChanged(DownloadManager manager,
int state)
stateChanged in interface DownloadManagerListenerpublic void downloadComplete(DownloadManager manager)
DownloadManagerListener
downloadComplete in interface DownloadManagerListener
public void completionChanged(DownloadManager manager,
boolean bCompleted)
DownloadManagerListener
completionChanged in interface DownloadManagerListener
public void filePriorityChanged(DownloadManager download,
DiskManagerFileInfo file)
filePriorityChanged in interface DownloadManagerListener
public void positionChanged(DownloadManager download,
int oldPosition,
int newPosition)
positionChanged in interface DownloadManagerListenerpublic void addListener(DownloadListener l)
DownloadEventNotifier
addListener in interface DownloadEventNotifierl - The listener to add.public void removeListener(DownloadListener l)
DownloadEventNotifier#addDownloadListener(DownloadListener) method.
removeListener in interface DownloadEventNotifierl - The listener to remove.
public void addAttributeListener(DownloadAttributeListener listener,
TorrentAttribute attr,
int event_type)
DownloadEventNotifier
addAttributeListener in interface DownloadEventNotifierlistener - The listener to add.attr - The torrent attribute to be notified about.event_type - The type of event to be notified of, as defined on DownloadAttributeListener.
public void removeAttributeListener(DownloadAttributeListener listener,
TorrentAttribute attr,
int event_type)
DownloadEventNotifier
removeAttributeListener in interface DownloadEventNotifierlistener - The listener to remove.attr - The torrent attribute which it registered with.event_type - The type of event which it registered with.public DownloadAnnounceResult getLastAnnounceResult()
Download
getLastAnnounceResult in interface Downloadpublic DownloadScrapeResult getLastScrapeResult()
Download
getLastScrapeResult in interface Downloadpublic DownloadScrapeResult getAggregatedScrapeResult()
Download
getAggregatedScrapeResult in interface Downloadpublic void scrapeResult(TRTrackerScraperResponse response)
scrapeResult in interface DownloadManagerTrackerListenerpublic void announceResult(TRTrackerAnnouncerResponse response)
announceResult in interface DownloadManagerTrackerListenerpublic TrackerPeerSource getTrackerPeerSource()
public void setAnnounceResult(DownloadAnnounceResult result)
setAnnounceResult in interface Downloadpublic void setScrapeResult(DownloadScrapeResult result)
setScrapeResult in interface Download
public void stateChanged(DownloadManagerState state,
DownloadManagerStateEvent event)
stateChanged in interface DownloadManagerStateListenerpublic void addPropertyListener(DownloadPropertyListener l)
DownloadEventNotifier
addPropertyListener in interface DownloadEventNotifierl - The listener to add.public void removePropertyListener(DownloadPropertyListener l)
DownloadEventNotifierDownloadEventNotifier.addPropertyListener(DownloadPropertyListener) method.
removePropertyListener in interface DownloadEventNotifierl - The listener to remove.public void torrentChanged()
public void addTrackerListener(DownloadTrackerListener l)
DownloadEventNotifierListener events will be immediately triggered after the listener has been added.
addTrackerListener in interface DownloadEventNotifierl - The listener to add.
public void addTrackerListener(DownloadTrackerListener l,
boolean immediateTrigger)
DownloadEventNotifier
addTrackerListener in interface DownloadEventNotifierl - The listener to add.immediateTrigger - Whether to immediately trigger listener's events.public void removeTrackerListener(DownloadTrackerListener l)
DownloadEventNotifierDownloadEventNotifier.addTrackerListener(DownloadTrackerListener) or
DownloadEventNotifier.addTrackerListener(DownloadTrackerListener, boolean) method.
removeTrackerListener in interface DownloadEventNotifierl - The listener to remove.public void addDownloadWillBeRemovedListener(DownloadWillBeRemovedListener l)
DownloadEventNotifier
addDownloadWillBeRemovedListener in interface DownloadEventNotifierl - The listener to add.public void removeDownloadWillBeRemovedListener(DownloadWillBeRemovedListener l)
DownloadEventNotifierDownloadEventNotifier.addDownloadWillBeRemovedListener(DownloadWillBeRemovedListener)
method.
removeDownloadWillBeRemovedListener in interface DownloadEventNotifierl - The listener to remove.public void addPeerListener(DownloadPeerListener listener)
DownloadEventNotifier
addPeerListener in interface DownloadEventNotifierlistener - The listener to add.public void removePeerListener(DownloadPeerListener listener)
DownloadEventNotifierDownloadEventNotifier.addPeerListener(DownloadPeerListener) method.
removePeerListener in interface DownloadEventNotifierlistener - The listener to remove.public boolean activateRequest(int count)
activateRequest in interface DownloadManagerActivationListenerpublic DownloadActivationEvent getActivationState()
Download
getActivationState in interface Downloadpublic void addActivationListener(DownloadActivationListener l)
DownloadEventNotifier
addActivationListener in interface DownloadEventNotifierl - The listener to add.public void removeActivationListener(DownloadActivationListener l)
DownloadEventNotifierDownloadEventNotifier.addActivationListener(DownloadActivationListener) method.
removeActivationListener in interface DownloadEventNotifierl - The listener to remove.public void addCompletionListener(DownloadCompletionListener l)
DownloadEventNotifier
addCompletionListener in interface DownloadEventNotifierl - The listener to add.public void removeCompletionListener(DownloadCompletionListener l)
DownloadEventNotifierDownloadEventNotifier.addCompletionListener(DownloadCompletionListener) method.
removeCompletionListener in interface DownloadEventNotifierl - The listener to remove.public PeerManager getPeerManager()
Download
getPeerManager in interface Downloadpublic DiskManager getDiskManager()
Download
getDiskManager in interface Downloadpublic int getDiskManagerFileCount()
Download
getDiskManagerFileCount in interface Downloadpublic DiskManagerFileInfo getDiskManagerFileInfo(int index)
Download
getDiskManagerFileInfo in interface Downloadpublic DiskManagerFileInfo[] getDiskManagerFileInfo()
Download
getDiskManagerFileInfo in interface Downloadpublic void setMaximumDownloadKBPerSecond(int kb)
Download
setMaximumDownloadKBPerSecond in interface Downloadpublic int getMaximumDownloadKBPerSecond()
Download
getMaximumDownloadKBPerSecond in interface Downloadpublic int getUploadRateLimitBytesPerSecond()
Download
getUploadRateLimitBytesPerSecond in interface Downloadpublic void setUploadRateLimitBytesPerSecond(int max_rate_bps)
Download
setUploadRateLimitBytesPerSecond in interface Downloadmax_rate_bps - limit in bytes per second, 0 for unlimited, -1 for upload disabledpublic int getDownloadRateLimitBytesPerSecond()
Download
getDownloadRateLimitBytesPerSecond in interface Downloadpublic void setDownloadRateLimitBytesPerSecond(int max_rate_bps)
Download
setDownloadRateLimitBytesPerSecond in interface Downloadmax_rate_bps - limit in bytes per second, 0 for unlimited, -1 for dowmload disabled
public void addRateLimiter(RateLimiter limiter,
boolean is_upload)
addRateLimiter in interface Downloadlimiter - create via ConnectionManageris_upload - false -> download limit
public void removeRateLimiter(RateLimiter limiter,
boolean is_upload)
removeRateLimiter in interface Downloadpublic int getSeedingRank()
Download
getSeedingRank in interface Downloadpublic void setSeedingRank(int rank)
Download
setSeedingRank in interface Downloadrank - New Rankingpublic String getSavePath()
Download
getSavePath in interface DownloadgetSavePath in interface DownloadStub
public void moveDataFiles(File new_parent_dir)
throws DownloadException
DownloadIf a download is running, it will be automatically paused and resumed afterwards - be aware that this behaviour may generate stateChanged events being fired.
moveDataFiles in interface DownloadDownloadException
public void moveDataFiles(File new_parent_dir,
String new_name)
throws DownloadException
DownloadIf a download is running, it will be automatically paused and resumed afterwards - be aware that this behaviour may generate stateChanged events being fired.
moveDataFiles in interface DownloadDownloadException#moveDataFiles(File)},
#renameDownload(String)}
public void renameDownload(String new_name)
throws DownloadException
DownloadDownload.moveDataFiles(File)).
This will not rename the displayed name for the torrent - if you wish to do that, you must do it via
the TorrentAttribute class.
If a download is running, it will be automatically paused and resumed afterwards - be aware that this behaviour may generate stateChanged events being fired.
renameDownload in interface Downloadnew_name - New name for the download.
DownloadExceptionDownload.moveDataFiles(File)
public void moveTorrentFile(File new_parent_dir)
throws DownloadException
Download
moveTorrentFile in interface DownloadDownloadExceptionpublic File[] calculateDefaultPaths(boolean for_moving)
DownloadThis method takes one argument - for_moving. This essentially indicates whether you are getting this information for purposes of just finding where Azureus would store these files by default, or whether you are considering moving the files from its current location.
If for_moving is false, this method will determine locations for the download and the torrent file where Azureus would store them by default (it may return the current paths used by this download).
If for_moving is true, then this method will consider the download's current location, and whether it is allowed to move it - you may not be allowed to move this download (based on Azureus's current rules) if the download doesn't exist within a default save directory already. If a download is complete, we consider whether we are allowed to move downloads on completion, and whether that includes downloads outside the default save directory.
In this case, the array may contain null indicating that the Azureus doesn't believe that the download should be moved (based on the current rules the user has set out). However, you are not prevented from changing the location of the torrent file or download.
calculateDefaultPaths in interface Downloadfor_moving - Indicates whether you want this information for the purposes
of moving the download or not.
public boolean isInDefaultSaveDir()
Download
isInDefaultSaveDir in interface Downloadpublic void requestTrackerAnnounce()
Download
requestTrackerAnnounce in interface Downloadpublic void requestTrackerAnnounce(boolean immediate)
Download
requestTrackerAnnounce in interface Downloadpublic void requestTrackerScrape(boolean immediate)
Download
requestTrackerScrape in interface Downloadpublic byte[] getDownloadPeerId()
Download
getDownloadPeerId in interface Downloadpublic boolean isMessagingEnabled()
Download
isMessagingEnabled in interface Downloadpublic void setMessagingEnabled(boolean enabled)
Download
setMessagingEnabled in interface Downloadenabled - true to enabled, false to disabledpublic int getPriority()
Download
getPriority in interface Downloadpublic boolean isPriorityLocked()
Download
isPriorityLocked in interface Downloadpublic void setPriority(int priority)
Download
setPriority in interface Downloadpriority - the required priority, see PR_ constants abovepublic boolean isRemoved()
isRemoved in interface Downloadpublic String getRelationText()
LogRelation
getRelationText in class LogRelationpublic Object[] getQueryableInterfaces()
LogRelation
getQueryableInterfaces in class LogRelationpublic boolean canMoveDataFiles()
Download
canMoveDataFiles in interface Download
public void attributeEventOccurred(DownloadManager download,
String attribute,
int event_type)
attributeEventOccurred in interface DownloadManagerStateAttributeListenerpublic SaveLocationChange calculateDefaultDownloadLocation()
DownloadSaveLocationChange object describing the appropriate location
for the download (and torrent file) to exist in, based on the download's completion
state, the for-completion rules in place, and the SaveLocationManager
object in use.
calculateDefaultDownloadLocation in interface Downloadpublic Object getUserData(Object key)
Download
getUserData in interface Download
public void setUserData(Object key,
Object data)
Download
setUserData in interface Downloadpublic void startDownload(boolean force)
Download
startDownload in interface Downloadforce - true to force the download to be started.public void stopDownload()
Download
stopDownload in interface Downloadpublic boolean isStub()
isStub in interface DownloadStubpublic boolean canStubbify()
canStubbify in interface Download
public DownloadStub stubbify()
throws DownloadException,
DownloadRemovalVetoException
stubbify in interface DownloadDownloadException
DownloadRemovalVetoException
public Download destubbify()
throws DownloadException
destubbify in interface DownloadStubDownloadExceptionpublic List<DistributedDatabase> getDistributedDatabases()
getDistributedDatabases in interface Downloadpublic byte[] getTorrentHash()
getTorrentHash in interface DownloadStubpublic long getTorrentSize()
getTorrentSize in interface DownloadStubpublic DownloadStub.DownloadStubFile[] getStubFiles()
getStubFiles in interface DownloadStub
public void changeLocation(SaveLocationChange slc)
throws DownloadException
DownloadSaveLocationChange object - this includes
moving torrent and data file data.
changeLocation in interface Downloadslc - The change to apply.
DownloadException - If there is a problem moving the data.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||