org.gudy.azureus2.pluginsimpl.local.messaging
Class GenericMessageConnectionImpl

java.lang.Object
  extended by org.gudy.azureus2.pluginsimpl.local.messaging.GenericMessageConnectionImpl
All Implemented Interfaces:
GenericMessageConnection

public class GenericMessageConnectionImpl
extends Object
implements GenericMessageConnection


Field Summary
 
Fields inherited from interface org.gudy.azureus2.plugins.messaging.generic.GenericMessageConnection
TT_INDIRECT, TT_NONE, TT_TCP, TT_UDP
 
Constructor Summary
protected GenericMessageConnectionImpl(MessageManagerImpl _message_manager, GenericMessageConnectionAdapter _delegate)
           
protected GenericMessageConnectionImpl(MessageManagerImpl _message_manager, String _msg_id, String _msg_desc, GenericMessageEndpointImpl _endpoint, int _stream_crypto, byte[][] _shared_secrets)
           
 
Method Summary
protected  void accepted()
          Incoming connection has been accepted
 void addInboundRateLimiter(RateLimiter limiter)
           
 void addListener(GenericMessageConnectionListener listener)
           
 void addOutboundRateLimiter(RateLimiter limiter)
           
 void close()
           
 void closing()
           
 void connect()
           
 void connect(ByteBuffer initial_data)
          Outgoing connection
protected  void connectTCP(ByteBuffer initial_data, InetSocketAddress tcp_ep)
           
protected  void connectTunnel(ByteBuffer initial_data, GenericMessageEndpoint ep, InetSocketAddress rendezvous, InetSocketAddress target)
           
protected  void connectUDP(ByteBuffer initial_data, InetSocketAddress udp_ep, boolean nat_traversal)
           
 int getConnectMethodCount()
           
 GenericMessageEndpoint getEndpoint()
           
 int getMaximumMessageSize()
           
 int getTransportType()
           
 String getType()
           
 boolean isIncoming()
           
protected  void receive(GenericMessage message)
           
 void removeInboundRateLimiter(RateLimiter limiter)
           
 void removeListener(GenericMessageConnectionListener listener)
           
 void removeOutboundRateLimiter(RateLimiter limiter)
           
protected  void reportConnected()
           
protected  void reportFailed(Throwable e)
           
 void send(PooledByteBuffer message)
           
protected  void setDelegate(GenericMessageConnectionAdapter _delegate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericMessageConnectionImpl

protected GenericMessageConnectionImpl(MessageManagerImpl _message_manager,
                                       GenericMessageConnectionAdapter _delegate)

GenericMessageConnectionImpl

protected GenericMessageConnectionImpl(MessageManagerImpl _message_manager,
                                       String _msg_id,
                                       String _msg_desc,
                                       GenericMessageEndpointImpl _endpoint,
                                       int _stream_crypto,
                                       byte[][] _shared_secrets)
Method Detail

getEndpoint

public GenericMessageEndpoint getEndpoint()
Specified by:
getEndpoint in interface GenericMessageConnection

getMaximumMessageSize

public int getMaximumMessageSize()
Specified by:
getMaximumMessageSize in interface GenericMessageConnection

getType

public String getType()
Specified by:
getType in interface GenericMessageConnection

getTransportType

public int getTransportType()
Specified by:
getTransportType in interface GenericMessageConnection

addInboundRateLimiter

public void addInboundRateLimiter(RateLimiter limiter)
Specified by:
addInboundRateLimiter in interface GenericMessageConnection

removeInboundRateLimiter

public void removeInboundRateLimiter(RateLimiter limiter)
Specified by:
removeInboundRateLimiter in interface GenericMessageConnection

addOutboundRateLimiter

public void addOutboundRateLimiter(RateLimiter limiter)
Specified by:
addOutboundRateLimiter in interface GenericMessageConnection

removeOutboundRateLimiter

public void removeOutboundRateLimiter(RateLimiter limiter)
Specified by:
removeOutboundRateLimiter in interface GenericMessageConnection

isIncoming

public boolean isIncoming()

getConnectMethodCount

public int getConnectMethodCount()

connect

public void connect()
             throws MessageException
Specified by:
connect in interface GenericMessageConnection
Throws:
MessageException

setDelegate

protected void setDelegate(GenericMessageConnectionAdapter _delegate)

connect

public void connect(ByteBuffer initial_data)
             throws MessageException
Outgoing connection

Parameters:
initial_data -
Throws:
MessageException

connectTCP

protected void connectTCP(ByteBuffer initial_data,
                          InetSocketAddress tcp_ep)

connectUDP

protected void connectUDP(ByteBuffer initial_data,
                          InetSocketAddress udp_ep,
                          boolean nat_traversal)

connectTunnel

protected void connectTunnel(ByteBuffer initial_data,
                             GenericMessageEndpoint ep,
                             InetSocketAddress rendezvous,
                             InetSocketAddress target)

accepted

protected void accepted()
Incoming connection has been accepted


send

public void send(PooledByteBuffer message)
          throws MessageException
Specified by:
send in interface GenericMessageConnection
Throws:
MessageException

receive

protected void receive(GenericMessage message)

closing

public void closing()

close

public void close()
           throws MessageException
Specified by:
close in interface GenericMessageConnection
Throws:
MessageException

reportConnected

protected void reportConnected()

reportFailed

protected void reportFailed(Throwable e)

addListener

public void addListener(GenericMessageConnectionListener listener)
Specified by:
addListener in interface GenericMessageConnection

removeListener

public void removeListener(GenericMessageConnectionListener listener)
Specified by:
removeListener in interface GenericMessageConnection