net.i2p.i2ptunnel
Class I2PTunnelTask

java.lang.Object
  extended by net.i2p.util.EventDispatcherImpl
      extended by net.i2p.i2ptunnel.I2PTunnelTask
All Implemented Interfaces:
EventDispatcher
Direct Known Subclasses:
I2Ping, I2PTunnelClientBase, I2PTunnelServer, I2PTunnelUDPClientBase, I2PTunnelUDPServerBase

public abstract class I2PTunnelTask
extends EventDispatcherImpl

Either a Server or a Client.


Field Summary
protected  boolean open
           
 
Constructor Summary
protected I2PTunnelTask(String name, EventDispatcher notifyThis, I2PTunnel tunnel)
           
 
Method Summary
abstract  boolean close(boolean forced)
           
 void connected(I2PSession session)
          For tasks that don't call I2PTunnel.addSession() directly
 void disconnected(I2PSession session)
           
 void errorOccurred(I2PSession session, String message, Throwable error)
           
 int getId()
           
 I2PTunnel getTunnel()
           
 boolean isOpen()
           
 void optionsUpdated(I2PTunnel tunnel)
          Notify the task that I2PTunnel's options have been updated.
 void reportAbuse(I2PSession session, int severity)
           
protected  void routerDisconnected()
           
 void setId(int id)
           
protected  void setName(String name)
           
 void setTunnel(I2PTunnel pTunnel)
          for apps that use multiple I2PTunnel instances
 String toString()
           
 
Methods inherited from class net.i2p.util.EventDispatcherImpl
attachEventDispatcher, detachEventDispatcher, getEventDispatcher, getEvents, getEventValue, ignoreEvents, notifyEvent, unIgnoreEvents, waitEventValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

open

protected volatile boolean open
Constructor Detail

I2PTunnelTask

protected I2PTunnelTask(String name,
                        EventDispatcher notifyThis,
                        I2PTunnel tunnel)
Method Detail

setTunnel

public void setTunnel(I2PTunnel pTunnel)
for apps that use multiple I2PTunnel instances


getTunnel

public I2PTunnel getTunnel()

getId

public int getId()

isOpen

public boolean isOpen()

setId

public void setId(int id)

setName

protected void setName(String name)

routerDisconnected

protected void routerDisconnected()

close

public abstract boolean close(boolean forced)

optionsUpdated

public void optionsUpdated(I2PTunnel tunnel)
Notify the task that I2PTunnel's options have been updated. Extending classes should override and call I2PTunnel.getClientOptions(), then update the I2PSocketManager.

Since:
0.9.1

connected

public void connected(I2PSession session)
For tasks that don't call I2PTunnel.addSession() directly

Since:
0.8.13

disconnected

public void disconnected(I2PSession session)

errorOccurred

public void errorOccurred(I2PSession session,
                          String message,
                          Throwable error)

reportAbuse

public void reportAbuse(I2PSession session,
                        int severity)

toString

public String toString()
Overrides:
toString in class Object