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 java.lang.Object
implements Plugin, UPnPListener, UPnPMappingListener, UPnPWANConnectionListener, AEDiagnosticsEvidenceGenerator


Field Summary
protected  AEMonitor this_mon
           
 
Constructor Summary
UPnPPlugin()
           
 
Method Summary
 UPnPMapping addMapping(java.lang.String desc_resource, boolean tcp, int port, boolean enabled)
           
protected  void addMapping(UPnPMapping mapping)
           
protected  void addService(UPnPWANConnection wan_service)
           
protected  boolean checkDeviceStats(java.lang.String USN, java.net.URL location)
           
protected  boolean checkDeviceStats(UPnPRootDevice root)
           
protected  void checkState()
           
protected  void closeDown(boolean end_of_day)
           
 boolean deviceDiscovered(java.lang.String USN, java.net.URL location)
           
 void generate(IndentWriter writer)
           
protected  long getDeviceStats(java.lang.String USN, java.lang.String stat_key)
           
 java.lang.String[] getExternalIPAddresses()
           
 UPnPMapping getMapping(boolean tcp, int port)
           
 UPnPMapping[] getMappings()
           
protected  java.lang.String[] getSelectedAddresses()
           
protected  java.lang.String[] getSelectedInterfaces()
           
 UPnPPluginService[] getServices()
           
 UPnPPluginService[] getServices(UPnPDevice device)
           
protected  void ignoreDevice(java.lang.String USN, java.net.URL location)
           
protected  long incrementDeviceStats(java.lang.String USN, java.lang.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, java.lang.String resource, java.lang.String[] params)
           
protected  void logNoRepeat(java.lang.String usn, java.lang.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(java.lang.String USN, java.lang.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(java.lang.String USN,
                            java.net.URL location)

startUp

protected void startUp()

closeDown

protected void closeDown(boolean end_of_day)

deviceDiscovered

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

logNoRepeat

protected void logNoRepeat(java.lang.String usn,
                           java.lang.String msg)

rootDeviceFound

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

checkDeviceStats

protected boolean checkDeviceStats(UPnPRootDevice root)

checkDeviceStats

protected boolean checkDeviceStats(java.lang.String USN,
                                   java.net.URL location)

incrementDeviceStats

protected long incrementDeviceStats(java.lang.String USN,
                                    java.lang.String stat_key)

getDeviceStats

protected long getDeviceStats(java.lang.String USN,
                              java.lang.String stat_key)

setDeviceStats

protected void setDeviceStats(java.lang.String USN,
                              java.lang.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 java.lang.String[] getSelectedInterfaces()

getSelectedAddresses

protected java.lang.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 java.lang.String[] getExternalIPAddresses()

getServices

public UPnPPluginService[] getServices()

getServices

public UPnPPluginService[] getServices(UPnPDevice device)

addMapping

public UPnPMapping addMapping(java.lang.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,
                        java.lang.String resource,
                        java.lang.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