Methods Summary |
---|
public boolean | activateRequest(int count)
DownloadActivationEvent event =
new DownloadActivationEvent()
{
public Download
getDownload()
{
return( DownloadImpl.this );
}
public int
getActivationCount()
{
return( count );
}
};
for (Iterator it=activation_listeners.iterator();it.hasNext();){
try{
DownloadActivationListener listener = (DownloadActivationListener)it.next();
if ( listener.activationRequested( event )){
return( true );
}
}catch( Throwable e ){
Debug.printStackTrace(e);
}
}
return( false );
|
public void | addActivationListener(org.gudy.azureus2.plugins.download.DownloadActivationListener l)
try{
peer_listeners_mon.enter();
activation_listeners.add( l );
if ( activation_listeners.size() == 1 ){
download_manager.addActivationListener( this );
}
}finally{
peer_listeners_mon.exit();
}
|
public void | addDownloadWillBeRemovedListener(org.gudy.azureus2.plugins.download.DownloadWillBeRemovedListener l)
try{
removal_listeners_mon.enter();
List new_removal_listeners = new ArrayList( removal_listeners );
new_removal_listeners.add(l);
removal_listeners = new_removal_listeners;
}finally{
removal_listeners_mon.exit();
}
|
public void | addListener(org.gudy.azureus2.plugins.download.DownloadListener l)
try{
listeners_mon.enter();
List new_listeners = new ArrayList( listeners );
new_listeners.add(l);
listeners = new_listeners;
}finally{
listeners_mon.exit();
}
|
public void | addPeerListener(org.gudy.azureus2.plugins.download.DownloadPeerListener l)
try{
peer_listeners_mon.enter();
List new_peer_listeners = new ArrayList( peer_listeners );
new_peer_listeners.add( l );
peer_listeners = new_peer_listeners;
if ( peer_listeners.size() == 1 ){
download_manager.addPeerListener( this );
}
}finally{
peer_listeners_mon.exit();
}
|
public void | addPropertyListener(org.gudy.azureus2.plugins.download.DownloadPropertyListener l)
try{
tracker_listeners_mon.enter();
List new_property_listeners = new ArrayList( property_listeners );
new_property_listeners.add( l );
property_listeners = new_property_listeners;
if ( property_listeners.size() == 1 ){
download_manager.getDownloadState().addListener( this );
}
}finally{
tracker_listeners_mon.exit();
}
|
public void | addTrackerListener(org.gudy.azureus2.plugins.download.DownloadTrackerListener l)
addTrackerListener(l, true);
|
public void | addTrackerListener(org.gudy.azureus2.plugins.download.DownloadTrackerListener l, boolean immediateTrigger)
try{
tracker_listeners_mon.enter();
List new_tracker_listeners = new ArrayList( tracker_listeners );
new_tracker_listeners.add( l );
tracker_listeners = new_tracker_listeners;
if ( tracker_listeners.size() == 1 ){
download_manager.addTrackerListener( this );
}
}finally{
tracker_listeners_mon.exit();
}
if (immediateTrigger) {this.announceTrackerResultsToListener(l);}
|
public void | announceResult(TRTrackerAnnouncerResponse response)
last_announce_result.setContent( response );
List tracker_listeners_ref = tracker_listeners;
for (int i=0;i<tracker_listeners_ref.size();i++){
try{
((DownloadTrackerListener)tracker_listeners_ref.get(i)).announceResult( last_announce_result );
}catch( Throwable e ){
Debug.printStackTrace( e );
}
}
|
void | announceTrackerResultsToListener(org.gudy.azureus2.plugins.download.DownloadTrackerListener l)
l.announceResult(last_announce_result);
l.scrapeResult(last_scrape_result);
|
public java.io.File[] | calculateDefaultPaths(boolean for_moving)
return download_manager.calculateDefaultPaths(for_moving);
|
public boolean | canBeRemoved()
int dl_state = download_manager.getState();
if ( dl_state == DownloadManager.STATE_STOPPED ||
dl_state == DownloadManager.STATE_ERROR ||
dl_state == DownloadManager.STATE_QUEUED ){
GlobalManager globalManager = download_manager.getGlobalManager();
try{
globalManager.canDownloadManagerBeRemoved(download_manager, false, false);
}catch( GlobalManagerDownloadRemovalVetoException e ){
throw( new DownloadRemovalVetoException( e.getMessage(),e.isSilent()));
}
}else{
throw( new DownloadRemovalVetoException( MessageText.getString("plugin.download.remove.veto.notstopped")));
}
return( true );
|
public void | completionChanged(DownloadManager manager, boolean bCompleted)
|
protected java.lang.String | convertAttribute(org.gudy.azureus2.plugins.torrent.TorrentAttribute attribute)
if ( attribute.getName() == TorrentAttribute.TA_CATEGORY ){
return( DownloadManagerState.AT_CATEGORY );
}else if ( attribute.getName() == TorrentAttribute.TA_NETWORKS ){
return( DownloadManagerState.AT_NETWORKS );
}else if ( attribute.getName() == TorrentAttribute.TA_TRACKER_CLIENT_EXTENSIONS ){
return( DownloadManagerState.AT_TRACKER_CLIENT_EXTENSIONS );
}else if ( attribute.getName() == TorrentAttribute.TA_PEER_SOURCES ){
return( DownloadManagerState.AT_PEER_SOURCES );
}else if ( attribute.getName() == TorrentAttribute.TA_DISPLAY_NAME ){
return( DownloadManagerState.AT_DISPLAY_NAME );
}else if ( attribute.getName() == TorrentAttribute.TA_USER_COMMENT ){
return( DownloadManagerState.AT_USER_COMMENT );
}else if ( attribute.getName() == TorrentAttribute.TA_RELATIVE_SAVE_PATH ){
return( DownloadManagerState.AT_RELATIVE_SAVE_PATH );
}else if ( attribute.getName() == TorrentAttribute.TA_SHARE_PROPERTIES ){
// this is a share-level attribute only, not propagated to individual downloads
return( null );
}else if ( attribute.getName().startsWith( "Plugin." )){
return( attribute.getName());
}else{
Debug.out( "Can't convert attribute '" + attribute.getName() + "'" );
return( null );
}
|
protected org.gudy.azureus2.plugins.torrent.TorrentAttribute | convertAttribute(java.lang.String name)
if ( name.equals( DownloadManagerState.AT_CATEGORY )){
return( TorrentManagerImpl.getSingleton().getAttribute( TorrentAttribute.TA_CATEGORY ));
}else if ( name.equals( DownloadManagerState.AT_NETWORKS )){
return( TorrentManagerImpl.getSingleton().getAttribute( TorrentAttribute.TA_NETWORKS ));
}else if ( name.equals( DownloadManagerState.AT_PEER_SOURCES )){
return( TorrentManagerImpl.getSingleton().getAttribute( TorrentAttribute.TA_PEER_SOURCES ));
}else if ( name.equals( DownloadManagerState.AT_TRACKER_CLIENT_EXTENSIONS )){
return( TorrentManagerImpl.getSingleton().getAttribute( TorrentAttribute.TA_TRACKER_CLIENT_EXTENSIONS ));
}else if ( name.equals ( DownloadManagerState.AT_DISPLAY_NAME)){
return ( TorrentManagerImpl.getSingleton().getAttribute( TorrentAttribute.TA_DISPLAY_NAME ));
}else if ( name.equals ( DownloadManagerState.AT_USER_COMMENT)){
return ( TorrentManagerImpl.getSingleton().getAttribute( TorrentAttribute.TA_USER_COMMENT ));
}else if ( name.equals ( DownloadManagerState.AT_RELATIVE_SAVE_PATH)){
return ( TorrentManagerImpl.getSingleton().getAttribute( TorrentAttribute.TA_RELATIVE_SAVE_PATH ));
}else if ( name.startsWith( "Plugin." )){
return( TorrentManagerImpl.getSingleton().getAttribute( name ));
}else{
return( null );
}
|
protected int | convertState(int dm_state)
// dm states: waiting -> initialising -> initialized ->
// disk states: allocating -> checking -> ready ->
// dm states: downloading -> finishing -> seeding -> stopping -> stopped
// "initialize" call takes from waiting -> initialising -> waiting (no port) or initialized (ok)
// if initialized then disk manager runs through to ready
// "startdownload" takes ready -> dl etc.
// "stopIt" takes to stopped which is equiv to ready
int our_state;
switch( dm_state ){
case DownloadManager.STATE_WAITING:
{
our_state = ST_WAITING;
break;
}
case DownloadManager.STATE_INITIALIZING:
case DownloadManager.STATE_INITIALIZED:
case DownloadManager.STATE_ALLOCATING:
case DownloadManager.STATE_CHECKING:
{
our_state = ST_PREPARING;
break;
}
case DownloadManager.STATE_READY:
{
our_state = ST_READY;
break;
}
case DownloadManager.STATE_DOWNLOADING:
case DownloadManager.STATE_FINISHING: // finishing download - transit to seeding
{
our_state = ST_DOWNLOADING;
break;
}
case DownloadManager.STATE_SEEDING:
{
our_state = ST_SEEDING;
break;
}
case DownloadManager.STATE_STOPPING:
{
our_state = ST_STOPPING;
break;
}
case DownloadManager.STATE_STOPPED:
{
our_state = ST_STOPPED;
break;
}
case DownloadManager.STATE_QUEUED:
{
our_state = ST_QUEUED;
break;
}
case DownloadManager.STATE_ERROR:
{
our_state = ST_ERROR;
break;
}
default:
{
our_state = ST_ERROR;
}
}
return( our_state );
|
protected void | destroy()
download_manager.removeListener( this );
|
public void | downloadComplete(DownloadManager manager)
|
public void | filePriorityChanged(DownloadManager download, org.gudy.azureus2.core3.disk.DiskManagerFileInfo file)
|
public org.gudy.azureus2.plugins.download.DownloadActivationEvent | getActivationState()
return( activation_state );
|
public java.lang.String | getAttribute(org.gudy.azureus2.plugins.torrent.TorrentAttribute attribute)
String name = convertAttribute( attribute );
if ( name != null ){
return( download_manager.getDownloadState().getAttribute( name ));
}
return( null );
|
public boolean | getBooleanAttribute(org.gudy.azureus2.plugins.torrent.TorrentAttribute attribute)
String name = convertAttribute(attribute);
if (name == null) {return false;} // Default value
return download_manager.getDownloadState().getBooleanAttribute(name);
|
public java.lang.String | getCategoryName()
Category category = download_manager.getDownloadState().getCategory();
if (category == null)
category = CategoryManager.getCategory(Category.TYPE_UNCATEGORIZED);
if (category == null)
return null;
return category.getName();
|
public long | getCreationTime()
return( download_manager.getCreationTime());
|
public org.gudy.azureus2.plugins.disk.DiskManager | getDiskManager()
PeerManager pm = getPeerManager();
if ( pm != null ){
return( pm.getDiskManager());
}
return( null );
|
public org.gudy.azureus2.plugins.disk.DiskManagerFileInfo[] | getDiskManagerFileInfo()
org.gudy.azureus2.core3.disk.DiskManagerFileInfo[] info = download_manager.getDiskManagerFileInfo();
if ( info == null ){
return( new DiskManagerFileInfo[0] );
}
DiskManagerFileInfo[] res = new DiskManagerFileInfo[info.length];
for (int i=0;i<res.length;i++){
res[i] = new DiskManagerFileInfoImpl( this, info[i] );
}
return( res );
|
public DownloadManager | getDownload()
return( download_manager );
|
public byte[] | getDownloadPeerId()
TRTrackerAnnouncer announcer = download_manager.getTrackerClient();
if(announcer == null) return null;
return announcer.getPeerId();
|
public int | getDownloadRateLimitBytesPerSecond()
return download_manager.getStats().getDownloadRateLimitBytesPerSecond();
|
public java.lang.String | getErrorStateDetails()
return( download_manager.getErrorDetails());
|
public boolean | getFlag(long flag)
return( download_manager.getDownloadState().getFlag( flag ));
|
public int | getIndex()
GlobalManager globalManager = download_manager.getGlobalManager();
return globalManager.getIndexOf(download_manager);
|
public int | getIntAttribute(org.gudy.azureus2.plugins.torrent.TorrentAttribute attribute)
String name = convertAttribute(attribute);
if (name == null) {return 0;} // Default value
return download_manager.getDownloadState().getIntAttribute(name);
|
public org.gudy.azureus2.plugins.download.DownloadAnnounceResult | getLastAnnounceResult()
TRTrackerAnnouncer tc = download_manager.getTrackerClient();
if ( tc != null ){
last_announce_result.setContent( tc.getLastResponse());
}
return( last_announce_result );
|
public org.gudy.azureus2.plugins.download.DownloadScrapeResult | getLastScrapeResult()
TRTrackerScraperResponse response = download_manager.getTrackerScrapeResponse();
last_scrape_result.setContent( response );
return( last_scrape_result );
|
public java.lang.String[] | getListAttribute(org.gudy.azureus2.plugins.torrent.TorrentAttribute attribute)
String name = convertAttribute( attribute );
if ( name != null ){
return( download_manager.getDownloadState().getListAttribute( name ));
}
return( null );
|
public long | getLongAttribute(org.gudy.azureus2.plugins.torrent.TorrentAttribute attribute)
String name = convertAttribute(attribute);
if (name == null) {return 0L;} // Default value
return download_manager.getDownloadState().getLongAttribute(name);
|
public java.util.Map | getMapAttribute(org.gudy.azureus2.plugins.torrent.TorrentAttribute attribute)
String name = convertAttribute( attribute );
if ( name != null ){
return( download_manager.getDownloadState().getMapAttribute( name ));
}
return( null );
|
public int | getMaximumDownloadKBPerSecond()
return( download_manager.getStats().getDownloadRateLimitBytesPerSecond() /1024 );
|
public java.lang.String | getName()
return download_manager.getDisplayName();
|
public PeerManager | getPeerManager()
PEPeerManager pm = download_manager.getPeerManager();
if ( pm == null ){
return( null );
}
return( PeerManagerImpl.getPeerManager( pm));
|
public int | getPosition()
return download_manager.getPosition();
|
public int | getPriority()
return 0;
|
public java.lang.Object[] | getQueryableInterfaces()
return new Object[] { download_manager };
|
public java.lang.String | getRelationText()
return propogatedRelationText(download_manager);
|
public java.lang.String | getSavePath()
return( download_manager.getSaveLocation().toString());
|
public int | getSeedingRank()
return download_manager.getSeedingRank();
|
public int | getState()
return( convertState( download_manager.getState()) );
|
public org.gudy.azureus2.plugins.download.DownloadStats | getStats()
return( download_stats );
|
public int | getSubState()
int state = getState();
if ( state == ST_STOPPING ){
int substate = download_manager.getSubState();
if ( substate == DownloadManager.STATE_QUEUED ){
return( ST_QUEUED );
}else if ( substate == DownloadManager.STATE_STOPPED ){
return( ST_STOPPED );
}else if ( substate == DownloadManager.STATE_ERROR ){
return( ST_ERROR );
}
}
return( state );
|
public org.gudy.azureus2.plugins.torrent.Torrent | getTorrent()
if (this.torrent != null) {return this.torrent;}
TOTorrent torrent = download_manager.getTorrent();
if (torrent == null) {return null;}
this.torrent = new TorrentImpl(torrent);
return this.torrent;
|
public java.lang.String | getTorrentFileName()
return download_manager.getTorrentFileName();
|
public int | getUploadRateLimitBytesPerSecond()
return download_manager.getStats().getUploadRateLimitBytesPerSecond();
|
public boolean | hasAttribute(org.gudy.azureus2.plugins.torrent.TorrentAttribute attribute)
String name = convertAttribute(attribute);
if (name == null) {return false;}
return download_manager.getDownloadState().hasAttribute(name);
|
public void | initialize()
int state = download_manager.getState();
if ( state == DownloadManager.STATE_WAITING ){
download_manager.initialize();
}else{
throw( new DownloadException( "Download::initialize: download not waiting (state=" + state + ")" ));
}
|
public boolean | isChecking()
return( download_stats.getCheckingDoneInThousandNotation() != -1 );
|
public boolean | isComplete()
return download_manager.isDownloadComplete(false);
|
public boolean | isComplete(boolean bIncludeDND)
return download_manager.isDownloadComplete(bIncludeDND);
|
public boolean | isForceStart()
return download_manager.isForceStart();
|
public boolean | isInDefaultSaveDir()
return download_manager.isInDefaultSaveDir();
|
public boolean | isMessagingEnabled() return download_manager.isExtendedMessagingEnabled();
|
public boolean | isPaused()
return( download_manager.isPaused());
|
public boolean | isPersistent()
return download_manager.isPersistent();
|
public boolean | isPriorityLocked()
return false;
|
protected void | isRemovable()
// no sync required, see update code
for (int i=0;i<removal_listeners.size();i++){
try{
((DownloadWillBeRemovedListener)removal_listeners.get(i)).downloadWillBeRemoved(this);
}catch( DownloadRemovalVetoException e ){
throw( e );
}catch( Throwable e ){
Debug.printStackTrace( e );
}
}
|
public boolean | isStartStopLocked()
return( download_manager.getState() == DownloadManager.STATE_STOPPED );
|
public void | moveDataFiles(java.io.File new_parent_dir)
try{
download_manager.moveDataFiles( new_parent_dir );
}catch( DownloadManagerException e ){
throw( new DownloadException("move operation failed", e ));
}
|
public void | moveDataFiles(java.io.File new_parent_dir, java.lang.String new_name)
try{
download_manager.moveDataFiles( new_parent_dir, new_name );
}catch( DownloadManagerException e ){
throw( new DownloadException("move / rename operation failed", e ));
}
|
public void | moveDown()
download_manager.getGlobalManager().moveDown(download_manager);
|
public void | moveTo(int pos)
download_manager.getGlobalManager().moveTo( download_manager, pos );
|
public void | moveTorrentFile(java.io.File new_parent_dir)
try{
download_manager.moveTorrentFile( new_parent_dir );
}catch( DownloadManagerException e ){
throw( new DownloadException("move operation failed", e ));
}
|
public void | moveUp()
download_manager.getGlobalManager().moveUp(download_manager);
|
public void | pause()
download_manager.pause();
|
public void | peerAdded(PEPeer peer)
|
public void | peerManagerAdded(PEPeerManager manager)
if ( peer_listeners.size() > 0 ){
PeerManager pm = PeerManagerImpl.getPeerManager( manager);
for (int i=0;i<peer_listeners.size();i++){
((DownloadPeerListener)peer_listeners.get(i)).peerManagerAdded( this, pm );
}
}
|
public void | peerManagerRemoved(PEPeerManager manager)
if ( peer_listeners.size() > 0 ){
PeerManager pm = PeerManagerImpl.getPeerManager( manager);
for (int i=0;i<peer_listeners.size();i++){
((DownloadPeerListener)peer_listeners.get(i)).peerManagerRemoved( this, pm );
}
}
|
public void | peerManagerWillBeAdded(PEPeerManager manager)
|
public void | peerRemoved(PEPeer peer)
|
public void | pieceAdded(PEPiece piece)
|
public void | pieceRemoved(PEPiece piece)
|
public void | positionChanged(DownloadManager download, int oldPosition, int newPosition)
for (int i = 0; i < listeners.size(); i++) {
try {
((DownloadListener)listeners.get(i)).positionChanged(this, oldPosition, newPosition);
} catch (Throwable e) {
Debug.printStackTrace( e );
}
}
|
public void | recheckData()
if ( !download_manager.canForceRecheck()){
throw( new DownloadException( "Download::recheckData: download must be stopped, queued or in error state" ));
}
download_manager.forceRecheck();
|
public void | remove()
remove( false, false );
|
public void | remove(boolean delete_torrent, boolean delete_data)
int dl_state = download_manager.getState();
if ( dl_state == DownloadManager.STATE_STOPPED ||
dl_state == DownloadManager.STATE_ERROR ||
dl_state == DownloadManager.STATE_QUEUED ){
GlobalManager globalManager = download_manager.getGlobalManager();
try{
globalManager.removeDownloadManager(download_manager, delete_torrent, delete_data);
}catch( GlobalManagerDownloadRemovalVetoException e ){
throw( new DownloadRemovalVetoException( e.getMessage()));
}
}else{
throw( new DownloadRemovalVetoException( MessageText.getString("plugin.download.remove.veto.notstopped")));
}
|
public void | removeActivationListener(org.gudy.azureus2.plugins.download.DownloadActivationListener l)
try{
peer_listeners_mon.enter();
activation_listeners.remove( l );
if ( activation_listeners.size() == 0 ){
download_manager.removeActivationListener( this );
}
}finally{
peer_listeners_mon.exit();
}
|
public void | removeDownloadWillBeRemovedListener(org.gudy.azureus2.plugins.download.DownloadWillBeRemovedListener l)
try{
removal_listeners_mon.enter();
List new_removal_listeners = new ArrayList( removal_listeners );
new_removal_listeners.remove(l);
removal_listeners = new_removal_listeners;
}finally{
removal_listeners_mon.exit();
}
|
public void | removeListener(org.gudy.azureus2.plugins.download.DownloadListener l)
try{
listeners_mon.enter();
List new_listeners = new ArrayList(listeners);
new_listeners.remove(l);
listeners = new_listeners;
}finally{
listeners_mon.exit();
}
|
public void | removePeerListener(org.gudy.azureus2.plugins.download.DownloadPeerListener l)
try{
peer_listeners_mon.enter();
List new_peer_listeners = new ArrayList( peer_listeners );
new_peer_listeners.remove( l );
peer_listeners = new_peer_listeners;
if ( peer_listeners.size() == 0 ){
download_manager.removePeerListener( this );
}
}finally{
peer_listeners_mon.exit();
}
|
public void | removePropertyListener(org.gudy.azureus2.plugins.download.DownloadPropertyListener l)
try{
tracker_listeners_mon.enter();
List new_property_listeners = new ArrayList( property_listeners );
new_property_listeners.remove( l );
property_listeners = new_property_listeners;
if ( property_listeners.size() == 0 ){
download_manager.getDownloadState().removeListener( this );
}
}finally{
tracker_listeners_mon.exit();
}
|
public void | removeTrackerListener(org.gudy.azureus2.plugins.download.DownloadTrackerListener l)
try{
tracker_listeners_mon.enter();
List new_tracker_listeners = new ArrayList( tracker_listeners );
new_tracker_listeners.remove( l );
tracker_listeners = new_tracker_listeners;
if ( tracker_listeners.size() == 0 ){
download_manager.removeTrackerListener( this );
}
}finally{
tracker_listeners_mon.exit();
}
|
public void | renameDownload(java.lang.String new_name)
try {download_manager.renameDownload(new_name);}
catch (DownloadManagerException e) {
throw new DownloadException("rename operation failed", e);
}
|
public void | requestTrackerAnnounce()
download_manager.requestTrackerAnnounce( false );
|
public void | requestTrackerAnnounce(boolean immediate)
download_manager.requestTrackerAnnounce( immediate );
|
public void | requestTrackerScrape(boolean immediate)
download_manager.requestTrackerScrape( immediate );
|
public void | restart()
int state = download_manager.getState();
if ( state == DownloadManager.STATE_STOPPED ||
state == DownloadManager.STATE_QUEUED ){
download_manager.setStateWaiting();
}else{
throw( new DownloadException( "Download::restart: download already running (state=" + state + ")" ));
}
|
public void | resume()
download_manager.resume();
|
public void | scrapeResult(TRTrackerScraperResponse response)
last_scrape_result.setContent( response );
for (int i=0;i<tracker_listeners.size();i++){
try{
((DownloadTrackerListener)tracker_listeners.get(i)).scrapeResult( last_scrape_result );
}catch( Throwable e ){
Debug.printStackTrace( e );
}
}
|
public void | setAnnounceResult(org.gudy.azureus2.plugins.download.DownloadAnnounceResult result)
download_manager.setAnnounceResult( result );
|
public void | setAttribute(org.gudy.azureus2.plugins.torrent.TorrentAttribute attribute, java.lang.String value)
String name = convertAttribute( attribute );
if ( name != null ){
download_manager.getDownloadState().setAttribute( name, value );
}
|
public void | setBooleanAttribute(org.gudy.azureus2.plugins.torrent.TorrentAttribute attribute, boolean value)
String name = convertAttribute(attribute);
if (name != null) {
download_manager.getDownloadState().setBooleanAttribute(name, value);
}
|
public void | setCategory(java.lang.String sName)
Category category = CategoryManager.getCategory(sName);
if (category == null)
category = CategoryManager.createCategory(sName);
download_manager.getDownloadState().setCategory(category);
|
public void | setDownloadRateLimitBytesPerSecond(int max_rate_bps)
download_manager.getStats().setDownloadRateLimitBytesPerSecond( max_rate_bps );
|
public void | setFlag(long flag, boolean set)
download_manager.getDownloadState().setFlag(flag, set);
|
public void | setForceStart(boolean forceStart)
download_manager.setForceStart(forceStart);
|
public void | setIntAttribute(org.gudy.azureus2.plugins.torrent.TorrentAttribute attribute, int value)
String name = convertAttribute(attribute);
if (name != null) {
download_manager.getDownloadState().setIntAttribute(name, value);
}
|
public void | setListAttribute(org.gudy.azureus2.plugins.torrent.TorrentAttribute attribute, java.lang.String[] value)
String name = convertAttribute(attribute);
if (name != null) {
download_manager.getDownloadState().setListAttribute(name, value);
}
|
public void | setLongAttribute(org.gudy.azureus2.plugins.torrent.TorrentAttribute attribute, long value)
String name = convertAttribute(attribute);
if (name != null) {
download_manager.getDownloadState().setLongAttribute(name, value);
}
|
public void | setMapAttribute(org.gudy.azureus2.plugins.torrent.TorrentAttribute attribute, java.util.Map value)
String name = convertAttribute( attribute );
if ( name != null ){
// gotta clone before updating in case user has read values and then just
// updated them - setter code optimises out sets of the same values...
download_manager.getDownloadState().setMapAttribute( name, BEncoder.cloneMap( value ));
}
|
public void | setMaximumDownloadKBPerSecond(int kb)
if(kb==-1){
Debug.out("setMaximiumDownloadKBPerSecond got value (-1) ZERO_DOWNLOAD. (-1)"+
"does not work through this method, use getDownloadRateLimitBytesPerSecond() instead.");
}//if
download_manager.getStats().setDownloadRateLimitBytesPerSecond( kb < 0 ? 0 : kb*1024 );
|
public void | setMessagingEnabled(boolean enabled)
throw new RuntimeException("setMessagingEnabled is in the process of being removed - if you are seeing this error, let the Azureus developers know that you need this method to stay!");
//download_manager.setAZMessagingEnabled( enabled );
|
public void | setPosition(int newPosition)
download_manager.setPosition(newPosition);
|
public void | setPriority(int priority)
|
public void | setScrapeResult(org.gudy.azureus2.plugins.download.DownloadScrapeResult result)
download_manager.setScrapeResult( result );
|
public void | setSeedingRank(int rank)
download_manager.setSeedingRank(rank);
|
public void | setSessionAuthenticator(org.gudy.azureus2.plugins.download.session.SessionAuthenticator auth)
//TODO
|
public void | setUploadRateLimitBytesPerSecond(int max_rate_bps)
download_manager.getStats().setUploadRateLimitBytesPerSecond( max_rate_bps );
|
public void | start()
int state = download_manager.getState();
if ( state == DownloadManager.STATE_READY ){
download_manager.startDownload();
}else{
throw( new DownloadException( "Download::start: download not ready (state=" + state + ")" ));
}
|
public void | stateChanged(DownloadManager manager, int state)
int prev_state = latest_state;
latest_state = convertState(state);
// System.out.println("Plug: dl = " + getName() + ", prev = " + prev_state + ", curr = " + latest_state + ", signalled state = " + state);
boolean curr_forcedStart = isForceStart();
if ( prev_state != latest_state || latest_forcedStart != curr_forcedStart ){
latest_forcedStart = curr_forcedStart;
for (int i=0;i<listeners.size();i++){
try{
((DownloadListener)listeners.get(i)).stateChanged( this, prev_state, latest_state );
}catch( Throwable e ){
Debug.printStackTrace( e );
}
}
}
|
public void | stateChanged(DownloadManagerState state, DownloadManagerStateEvent event)
final int type = event.getType();
if ( type == DownloadManagerStateEvent.ET_ATTRIBUTE_WRITTEN ||
type == DownloadManagerStateEvent.ET_ATTRIBUTE_WILL_BE_READ ){
String name = (String)event.getData();
List property_listeners_ref = property_listeners;
final TorrentAttribute attr = convertAttribute( name );
if ( attr != null ){
for (int i=0;i<property_listeners_ref.size();i++){
try{
((DownloadPropertyListener)property_listeners_ref.get(i)).propertyChanged(
this,
new DownloadPropertyEvent()
{
public int
getType()
{
return( type==DownloadManagerStateEvent.ET_ATTRIBUTE_WRITTEN
?DownloadPropertyEvent.PT_TORRENT_ATTRIBUTE_WRITTEN
:DownloadPropertyEvent.PT_TORRENT_ATTRIBUTE_WILL_BE_READ );
}
public Object
getData()
{
return( attr );
}
});
}catch( Throwable e ){
Debug.printStackTrace( e );
}
}
}
}
|
public void | stop()
if ( download_manager.getState() != DownloadManager.STATE_STOPPED){
download_manager.stopIt( DownloadManager.STATE_STOPPED, false, false );
}else{
throw( new DownloadException( "Download::stop: download already stopped" ));
}
|
public void | stopAndQueue()
if ( download_manager.getState() != DownloadManager.STATE_QUEUED){
download_manager.stopIt( DownloadManager.STATE_QUEUED, false, false );
}else{
throw( new DownloadException( "Download::stopAndQueue: download already queued" ));
}
|
public void | torrentChanged()
TRTrackerAnnouncer client = download_manager.getTrackerClient();
if ( client != null ){
client.resetTrackerUrl(true);
}
|