FileDocCategorySizeDatePackage
UPnPMapping.javaAPI DocAzureus 3.0.3.43037Thu Feb 09 19:42:56 GMT 2006com.aelitis.azureus.plugins.upnp

UPnPMapping

public class UPnPMapping extends Object
author
parg

Fields Summary
public static final int
PT_DEFAULT
public static final int
PT_PERSISTENT
public static final int
PT_TRANSIENT
protected String
resource_name
protected boolean
tcp
protected int
port
protected boolean
enabled
protected int
persistent
protected List
listeners
Constructors Summary
protected UPnPMapping(String _resource_name, boolean _tcp, int _port, boolean _enabled)

	
	
	
				
				
					
				 
	
		resource_name	= _resource_name;
		tcp				= _tcp;
		port			= _port;
		enabled			= _enabled;
	
Methods Summary
public voidaddListener(UPnPMappingListener l)

		listeners.add(l);
	
protected voidchanged()

		for (int i=0;i<listeners.size();i++){
			
			((UPnPMappingListener)listeners.get(i)).mappingChanged( this );
		}
	
public voiddestroy()

		for (int i=0;i<listeners.size();i++){
			
			((UPnPMappingListener)listeners.get(i)).mappingDestroyed( this );
		}
	
public intgetPersistent()

		return( persistent );
	
public intgetPort()

		return( port );
	
public java.lang.StringgetString(int port)

		String	name;
		
		if ( MessageText.keyExists( resource_name )){
			
			name = MessageText.getString( resource_name );
			
		}else{
			
			name = resource_name;
		}
		
		return( name + " (" + (isTCP()?"TCP":"UDP")+"/"+port+")" );
	
public java.lang.StringgetString()

		return( getString(getPort()));
	
public booleanisEnabled()

		return( enabled );
	
public booleanisTCP()

		return( tcp );
	
public voidremoveListener(UPnPMappingListener l)

		listeners.remove(l);
	
public voidsetEnabled(boolean _enabled)

		if ( enabled != _enabled ){
			
			enabled	= _enabled;
			
			changed();
		}
	
public voidsetPersistent(int _persistent)

		persistent		= _persistent;
	
public voidsetPort(int _port)

		if ( port != _port ){
			
			port	= _port;
			
			changed();
		}