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 java.lang.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, java.lang.String _msg_id, java.lang.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(java.nio.ByteBuffer initial_data)
          Outgoing connection
protected  void connectTCP(java.nio.ByteBuffer initial_data, java.net.InetSocketAddress tcp_ep)
           
protected  void connectTunnel(java.nio.ByteBuffer initial_data, GenericMessageEndpoint ep, java.net.InetSocketAddress rendezvous, java.net.InetSocketAddress target)
           
protected  void connectUDP(java.nio.ByteBuffer initial_data, java.net.InetSocketAddress udp_ep, boolean nat_traversal)
           
 int getConnectMethodCount()
           
 GenericMessageEndpoint getEndpoint()
           
 int getMaximumMessageSize()
           
 int getTransportType()
           
 java.lang.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(java.lang.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,
                                       java.lang.String _msg_id,
                                       java.lang.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 java.lang.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(java.nio.ByteBuffer initial_data)
             throws MessageException
Outgoing connection

Parameters:
initial_data -
Throws:
MessageException

connectTCP

protected void connectTCP(java.nio.ByteBuffer initial_data,
                          java.net.InetSocketAddress tcp_ep)

connectUDP

protected void connectUDP(java.nio.ByteBuffer initial_data,
                          java.net.InetSocketAddress udp_ep,
                          boolean nat_traversal)

connectTunnel

protected void connectTunnel(java.nio.ByteBuffer initial_data,
                             GenericMessageEndpoint ep,
                             java.net.InetSocketAddress rendezvous,
                             java.net.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(java.lang.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