org.gudy.azureus2.pluginsimpl.local.download
Class DownloadStubImpl

java.lang.Object
  extended by org.gudy.azureus2.pluginsimpl.local.download.DownloadStubImpl
All Implemented Interfaces:
DownloadStub, DownloadStub.DownloadStubEx

public class DownloadStubImpl
extends Object
implements DownloadStub.DownloadStubEx


Nested Class Summary
protected static class DownloadStubImpl.DownloadStubFileImpl
           
 
Nested classes/interfaces inherited from interface org.gudy.azureus2.plugins.download.DownloadStub
DownloadStub.DownloadStubEx, DownloadStub.DownloadStubFile
 
Constructor Summary
protected DownloadStubImpl(DownloadManagerImpl _manager, DownloadImpl _download, String[] _manual_tags, Map<String,Object> _gm_map)
           
protected DownloadStubImpl(DownloadManagerImpl _manager, Map<String,Object> _map)
           
 
Method Summary
 Download destubbify()
           
 Map<String,Object> exportToMap()
           
 long getCreationDate()
           
 Map getGMMap()
           
 long getLongAttribute(TorrentAttribute attribute)
          There are logically separate from the un-stubbed download, if you want to synchronize values from non-stub and stub then it is up to you to do it.
 String[] getManualTags()
           
 String getName()
           
 String getSavePath()
           
 int getShareRatio()
           
 DownloadStub.DownloadStubFile[] getStubFiles()
           
 Torrent getTorrent()
           
 byte[] getTorrentHash()
           
 long getTorrentSize()
           
 boolean isStub()
           
 void remove()
           
 void remove(boolean delete_torrent, boolean delete_data)
           
 void setLongAttribute(TorrentAttribute attribute, long value)
           
protected  void setStubbified()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DownloadStubImpl

protected DownloadStubImpl(DownloadManagerImpl _manager,
                           DownloadImpl _download,
                           String[] _manual_tags,
                           Map<String,Object> _gm_map)

DownloadStubImpl

protected DownloadStubImpl(DownloadManagerImpl _manager,
                           Map<String,Object> _map)
Method Detail

exportToMap

public Map<String,Object> exportToMap()

isStub

public boolean isStub()
Specified by:
isStub in interface DownloadStub

setStubbified

protected void setStubbified()

destubbify

public Download destubbify()
                    throws DownloadException
Specified by:
destubbify in interface DownloadStub
Throws:
DownloadException

getTorrent

public Torrent getTorrent()
Specified by:
getTorrent in interface DownloadStub

getName

public String getName()
Specified by:
getName in interface DownloadStub

getTorrentHash

public byte[] getTorrentHash()
Specified by:
getTorrentHash in interface DownloadStub

getTorrentSize

public long getTorrentSize()
Specified by:
getTorrentSize in interface DownloadStub

getCreationDate

public long getCreationDate()
Specified by:
getCreationDate in interface DownloadStub.DownloadStubEx

getSavePath

public String getSavePath()
Specified by:
getSavePath in interface DownloadStub

getStubFiles

public DownloadStub.DownloadStubFile[] getStubFiles()
Specified by:
getStubFiles in interface DownloadStub

getManualTags

public String[] getManualTags()
Specified by:
getManualTags in interface DownloadStub.DownloadStubEx

getShareRatio

public int getShareRatio()
Specified by:
getShareRatio in interface DownloadStub.DownloadStubEx

getLongAttribute

public long getLongAttribute(TorrentAttribute attribute)
Description copied from interface: DownloadStub
There are logically separate from the un-stubbed download, if you want to synchronize values from non-stub and stub then it is up to you to do it. So I suggest that you infact don't do this but just use these methods as a means to cache essential attributes from unstubbed ones in the 'will-be-added' listener event

Specified by:
getLongAttribute in interface DownloadStub
Returns:

setLongAttribute

public void setLongAttribute(TorrentAttribute attribute,
                             long value)
Specified by:
setLongAttribute in interface DownloadStub

getGMMap

public Map getGMMap()

remove

public void remove()
Specified by:
remove in interface DownloadStub

remove

public void remove(boolean delete_torrent,
                   boolean delete_data)
            throws DownloadException,
                   DownloadRemovalVetoException
Specified by:
remove in interface DownloadStub.DownloadStubEx
Throws:
DownloadException
DownloadRemovalVetoException