org.gudy.azureus2.pluginsimpl.update.sf.impl2
Class SFPluginDetailsLoaderImpl

java.lang.Object
  extended by org.gudy.azureus2.pluginsimpl.update.sf.impl2.SFPluginDetailsLoaderImpl
All Implemented Interfaces:
ResourceDownloaderListener, SFPluginDetailsLoader

public class SFPluginDetailsLoaderImpl
extends java.lang.Object
implements SFPluginDetailsLoader, ResourceDownloaderListener


Field Summary
protected  java.util.List listeners
           
protected  java.util.List plugin_ids
           
protected  boolean plugin_ids_loaded
           
protected  long plugin_ids_loaded_at
           
protected  java.util.Map plugin_map
           
protected  ResourceDownloaderFactory rd_factory
           
protected  AEMonitor this_mon
           
 
Constructor Summary
protected SFPluginDetailsLoaderImpl()
           
 
Method Summary
 void addListener(SFPluginDetailsLoaderListener l)
           
 boolean completed(ResourceDownloader downloader, java.io.InputStream data)
           
 void failed(ResourceDownloader downloader, ResourceDownloaderException e)
           
 SFPluginDetails[] getPluginDetails()
           
 SFPluginDetails getPluginDetails(java.lang.String name)
           
 java.lang.String[] getPluginIDs()
           
protected  java.lang.String getRelativeURLBase()
           
static SFPluginDetailsLoader getSingleton()
           
protected  void informListeners(java.lang.String log)
           
protected  void loadPluginDetails(SFPluginDetailsImpl details)
           
protected  void loadPluginList()
           
protected  boolean processPluginStream(SFPluginDetailsImpl details, java.io.InputStream is)
           
 void removeListener(SFPluginDetailsLoaderListener l)
           
 void reportActivity(ResourceDownloader downloader, java.lang.String activity)
           
 void reportAmountComplete(ResourceDownloader downloader, long amount)
           
 void reportPercentComplete(ResourceDownloader downloader, int percentage)
           
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

plugin_ids_loaded

protected boolean plugin_ids_loaded

plugin_ids_loaded_at

protected long plugin_ids_loaded_at

plugin_ids

protected java.util.List plugin_ids

plugin_map

protected java.util.Map plugin_map

listeners

protected java.util.List listeners

rd_factory

protected ResourceDownloaderFactory rd_factory

this_mon

protected AEMonitor this_mon
Constructor Detail

SFPluginDetailsLoaderImpl

protected SFPluginDetailsLoaderImpl()
Method Detail

getSingleton

public static SFPluginDetailsLoader getSingleton()

getRelativeURLBase

protected java.lang.String getRelativeURLBase()

loadPluginList

protected void loadPluginList()
                       throws SFPluginDetailsException
Throws:
SFPluginDetailsException

loadPluginDetails

protected void loadPluginDetails(SFPluginDetailsImpl details)
                          throws SFPluginDetailsException
Throws:
SFPluginDetailsException

processPluginStream

protected boolean processPluginStream(SFPluginDetailsImpl details,
                                      java.io.InputStream is)

getPluginIDs

public java.lang.String[] getPluginIDs()
                                throws SFPluginDetailsException
Specified by:
getPluginIDs in interface SFPluginDetailsLoader
Throws:
SFPluginDetailsException

getPluginDetails

public SFPluginDetails getPluginDetails(java.lang.String name)
                                 throws SFPluginDetailsException
Specified by:
getPluginDetails in interface SFPluginDetailsLoader
Throws:
SFPluginDetailsException

getPluginDetails

public SFPluginDetails[] getPluginDetails()
                                   throws SFPluginDetailsException
Specified by:
getPluginDetails in interface SFPluginDetailsLoader
Throws:
SFPluginDetailsException

reportPercentComplete

public void reportPercentComplete(ResourceDownloader downloader,
                                  int percentage)
Specified by:
reportPercentComplete in interface ResourceDownloaderListener

reportAmountComplete

public void reportAmountComplete(ResourceDownloader downloader,
                                 long amount)
Specified by:
reportAmountComplete in interface ResourceDownloaderListener

reportActivity

public void reportActivity(ResourceDownloader downloader,
                           java.lang.String activity)
Specified by:
reportActivity in interface ResourceDownloaderListener

completed

public boolean completed(ResourceDownloader downloader,
                         java.io.InputStream data)
Specified by:
completed in interface ResourceDownloaderListener
Returns:
return true if the completed download is OK. If false is returned then if there are alternative download sources they will be tried. If there are no other sources then the download will be "failed"

failed

public void failed(ResourceDownloader downloader,
                   ResourceDownloaderException e)
Specified by:
failed in interface ResourceDownloaderListener

informListeners

protected void informListeners(java.lang.String log)

reset

public void reset()
Specified by:
reset in interface SFPluginDetailsLoader

addListener

public void addListener(SFPluginDetailsLoaderListener l)
Specified by:
addListener in interface SFPluginDetailsLoader

removeListener

public void removeListener(SFPluginDetailsLoaderListener l)
Specified by:
removeListener in interface SFPluginDetailsLoader