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 Object
implements SFPluginDetailsLoader, ResourceDownloaderListener


Field Summary
protected  List listeners
           
protected  List plugin_ids
           
protected  boolean plugin_ids_loaded
           
protected  long plugin_ids_loaded_at
           
protected  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, InputStream data)
           
 void failed(ResourceDownloader downloader, ResourceDownloaderException e)
           
 SFPluginDetails[] getPluginDetails()
           
 SFPluginDetails getPluginDetails(String name)
           
 String[] getPluginIDs()
           
protected  String getRelativeURLBase()
           
static SFPluginDetailsLoader getSingleton()
           
protected  void informListeners(String log)
           
protected  void loadPluginDetails(SFPluginDetailsImpl details)
           
protected  void loadPluginList()
           
protected  boolean processPluginStream(SFPluginDetailsImpl details, InputStream is)
           
 void removeListener(SFPluginDetailsLoaderListener l)
           
 void reportActivity(ResourceDownloader downloader, 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 List plugin_ids

plugin_map

protected Map plugin_map

listeners

protected 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 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,
                                      InputStream is)

getPluginIDs

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

getPluginDetails

public SFPluginDetails getPluginDetails(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,
                           String activity)
Specified by:
reportActivity in interface ResourceDownloaderListener

completed

public boolean completed(ResourceDownloader downloader,
                         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(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