com.aelitis.azureus.plugins.upnp
Class UPnPPlugin

java.lang.Object
  extended by com.aelitis.azureus.plugins.upnp.UPnPPlugin
All Implemented Interfaces:
UPnPMappingListener, UPnPWANConnectionListener, UPnPListener, AEDiagnosticsEvidenceGenerator, Plugin

public class UPnPPlugin
extends Object
implements Plugin, UPnPListener, UPnPMappingListener, UPnPWANConnectionListener, AEDiagnosticsEvidenceGenerator


Field Summary
protected  AEMonitor this_mon
           
 
Constructor Summary
UPnPPlugin()
           
 
Method Summary
 UPnPMapping addMapping(String desc_resource, boolean tcp, int port, boolean enabled)
           
protected  void addMapping(UPnPMapping mapping)
           
protected  void addService(UPnPWANConnection wan_service)
           
protected  boolean checkDeviceStats(String USN, URL location)
           
protected  boolean checkDeviceStats(UPnPRootDevice root)
           
protected  void checkState()
           
protected  void closeDown(boolean end_of_day)
           
 boolean deviceDiscovered(String USN, URL location)
           
 void generate(IndentWriter writer)
           
protected  long getDeviceStats(String USN, String stat_key)
           
 String[] getExternalIPAddresses()
           
 UPnPMapping getMapping(boolean tcp, int port)
           
 UPnPMapping[] getMappings()
           
protected  String[] getSelectedAddresses()
           
protected  String[] getSelectedInterfaces()
           
 UPnPPluginService[] getServices()
           
 UPnPPluginService[] getServices(UPnPDevice device)
           
protected  void ignoreDevice(String USN, URL location)
           
protected  long incrementDeviceStats(String USN, String stat_key)
           
 void initialize(PluginInterface _plugin_interface)
          This method is called when the Plugin is loaded by Azureus
 boolean isEnabled()
           
static void load(PluginInterface plugin_interface)
           
protected  void logAlert(int type, String resource, String[] params)
           
protected  void logNoRepeat(String usn, String msg)
           
 void mappingChanged(UPnPMapping mapping)
           
 void mappingDestroyed(UPnPMapping mapping)
           
 void mappingResult(UPnPWANConnection connection, boolean ok)
           
 void mappingsReadResult(UPnPWANConnection connection, boolean ok)
           
protected  int processDevice(UPnPDevice device)
           
protected  int processServices(UPnPDevice device, UPnPService[] device_services)
           
 void refreshMappings()
          Provided for use by other plugins.
 void refreshMappings(boolean force)
          Provided for use by other plugins.
protected  void removeService(UPnPWANConnection wan_service, boolean replaced)
           
 void rootDeviceFound(UPnPRootDevice device)
           
protected  void setDeviceStats(String USN, String stat_key, long value)
           
protected  void setNATPMPEnableState()
           
protected  void startUp()
           
protected  void updateIgnoreList()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

this_mon

protected AEMonitor this_mon
Constructor Detail

UPnPPlugin

public UPnPPlugin()
Method Detail

load

public static void load(PluginInterface plugin_interface)

initialize

public void initialize(PluginInterface _plugin_interface)
Description copied from interface: Plugin
This method is called when the Plugin is loaded by Azureus

Specified by:
initialize in interface Plugin
Parameters:
_plugin_interface - the interface that the plugin must use to communicate with Azureus

updateIgnoreList

protected void updateIgnoreList()

ignoreDevice

protected void ignoreDevice(String USN,
                            URL location)

startUp

protected void startUp()

closeDown

protected void closeDown(boolean end_of_day)

deviceDiscovered

public boolean deviceDiscovered(String USN,
                                URL location)
Specified by:
deviceDiscovered in interface UPnPListener

logNoRepeat

protected void logNoRepeat(String usn,
                           String msg)

rootDeviceFound

public void rootDeviceFound(UPnPRootDevice device)
Specified by:
rootDeviceFound in interface UPnPListener

checkDeviceStats

protected boolean checkDeviceStats(UPnPRootDevice root)

checkDeviceStats

protected boolean checkDeviceStats(String USN,
                                   URL location)

incrementDeviceStats

protected long incrementDeviceStats(String USN,
                                    String stat_key)

getDeviceStats

protected long getDeviceStats(String USN,
                              String stat_key)

setDeviceStats

protected void setDeviceStats(String USN,
                              String stat_key,
                              long value)

mappingResult

public void mappingResult(UPnPWANConnection connection,
                          boolean ok)
Specified by:
mappingResult in interface UPnPWANConnectionListener

mappingsReadResult

public void mappingsReadResult(UPnPWANConnection connection,
                               boolean ok)
Specified by:
mappingsReadResult in interface UPnPWANConnectionListener

getSelectedInterfaces

protected String[] getSelectedInterfaces()

getSelectedAddresses

protected String[] getSelectedAddresses()

processDevice

protected int processDevice(UPnPDevice device)
                     throws UPnPException
Throws:
UPnPException

processServices

protected int processServices(UPnPDevice device,
                              UPnPService[] device_services)
                       throws UPnPException
Throws:
UPnPException

addService

protected void addService(UPnPWANConnection wan_service)
                   throws UPnPException
Throws:
UPnPException

removeService

protected void removeService(UPnPWANConnection wan_service,
                             boolean replaced)

addMapping

protected void addMapping(UPnPMapping mapping)

mappingChanged

public void mappingChanged(UPnPMapping mapping)
Specified by:
mappingChanged in interface UPnPMappingListener

mappingDestroyed

public void mappingDestroyed(UPnPMapping mapping)
Specified by:
mappingDestroyed in interface UPnPMappingListener

checkState

protected void checkState()

getExternalIPAddresses

public String[] getExternalIPAddresses()

getServices

public UPnPPluginService[] getServices()

getServices

public UPnPPluginService[] getServices(UPnPDevice device)

addMapping

public UPnPMapping addMapping(String desc_resource,
                              boolean tcp,
                              int port,
                              boolean enabled)

getMapping

public UPnPMapping getMapping(boolean tcp,
                              int port)

getMappings

public UPnPMapping[] getMappings()

isEnabled

public boolean isEnabled()

setNATPMPEnableState

protected void setNATPMPEnableState()

logAlert

protected void logAlert(int type,
                        String resource,
                        String[] params)

refreshMappings

public void refreshMappings()
Provided for use by other plugins.


refreshMappings

public void refreshMappings(boolean force)
Provided for use by other plugins.


generate

public void generate(IndentWriter writer)
Specified by:
generate in interface AEDiagnosticsEvidenceGenerator