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

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

public class DownloadStubImpl
extends Object
implements DownloadStub


Nested Class Summary
protected static class DownloadStubImpl.DownloadStubFileImpl
           
 
Nested classes/interfaces inherited from interface org.gudy.azureus2.plugins.download.DownloadStub
DownloadStub.DownloadStubFile
 
Constructor Summary
protected DownloadStubImpl(DownloadManagerImpl _manager, DownloadImpl _download, Map<String,Object> _gm_map)
           
protected DownloadStubImpl(DownloadManagerImpl _manager, Map<String,Object> _map)
           
 
Method Summary
 Download destubbify()
           
 Map<String,Object> exportToMap()
           
 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 getName()
           
 String getSavePath()
           
 DownloadStub.DownloadStubFile[] getStubFiles()
           
 byte[] getTorrentHash()
           
 long getTorrentSize()
           
 boolean isStub()
           
 void remove()
           
 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,
                           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

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

getSavePath

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

getStubFiles

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

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