org.sdnplatform.sync.internal.config.bootstrap
Class BootstrapChannelHandler

java.lang.Object
  extended by org.jboss.netty.channel.SimpleChannelHandler
      extended by org.jboss.netty.handler.timeout.IdleStateAwareChannelHandler
          extended by org.sdnplatform.sync.internal.rpc.AbstractRPCChannelHandler
              extended by org.sdnplatform.sync.internal.config.bootstrap.BootstrapChannelHandler
All Implemented Interfaces:
org.jboss.netty.channel.ChannelDownstreamHandler, org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler

public class BootstrapChannelHandler
extends AbstractRPCChannelHandler


Nested Class Summary
 
Nested classes/interfaces inherited from class org.sdnplatform.sync.internal.rpc.AbstractRPCChannelHandler
AbstractRPCChannelHandler.ChannelState
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
org.jboss.netty.channel.ChannelHandler.Sharable
 
Field Summary
protected static org.slf4j.Logger logger
           
 
Fields inherited from class org.sdnplatform.sync.internal.rpc.AbstractRPCChannelHandler
channelState, currentChallenge
 
Constructor Summary
BootstrapChannelHandler(Bootstrap bootstrap)
           
 
Method Summary
 void channelOpen(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent e)
           
protected  AuthScheme getAuthScheme()
          Get the type of authentication to use for this connection
protected  java.lang.Short getLocalNodeId()
          Get the node ID for the local node if appropriate
protected  java.lang.Short getRemoteNodeId()
          Get the node ID for the remote node if its connected
protected  byte[] getSharedSecret()
          Get a shared secret to be used for authentication handshake.
protected  int getTransactionId()
          Get a transaction ID suitable for sending an async message
protected  void handleClusterJoinResponse(ClusterJoinResponseMessage response, org.jboss.netty.channel.Channel channel)
           
protected  void handleError(ErrorMessage error, org.jboss.netty.channel.Channel channel)
           
protected  void handleHello(HelloMessage hello, org.jboss.netty.channel.Channel channel)
           
 
Methods inherited from class org.sdnplatform.sync.internal.rpc.AbstractRPCChannelHandler
channelConnected, channelIdle, error, exceptionCaught, getError, getLocalNodeIdString, getRemoteNodeIdString, handleClusterJoinRequest, handleCursorRequest, handleCursorResponse, handleDeleteRequest, handleDeleteResponse, handleEchoRequest, handleFullSyncRequest, handleGetRequest, handleGetResponse, handlePutRequest, handlePutResponse, handleRegisterRequest, handleRegisterResponse, handleSMAuthenticated, handleSyncMessage, handleSyncOffer, handleSyncRequest, handleSyncValue, handleSyncValueResponse, handleUnknownMessage, handshake, handshakeChallengeResponse, messageReceived, unexpectedMessage
 
Methods inherited from class org.jboss.netty.handler.timeout.IdleStateAwareChannelHandler
handleUpstream
 
Methods inherited from class org.jboss.netty.channel.SimpleChannelHandler
bindRequested, channelBound, channelClosed, channelDisconnected, channelInterestChanged, channelUnbound, childChannelClosed, childChannelOpen, closeRequested, connectRequested, disconnectRequested, handleDownstream, setInterestOpsRequested, unbindRequested, writeComplete, writeRequested
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.slf4j.Logger logger
Constructor Detail

BootstrapChannelHandler

public BootstrapChannelHandler(Bootstrap bootstrap)
Method Detail

channelOpen

public void channelOpen(org.jboss.netty.channel.ChannelHandlerContext ctx,
                        org.jboss.netty.channel.ChannelStateEvent e)
                 throws java.lang.Exception
Overrides:
channelOpen in class org.jboss.netty.channel.SimpleChannelHandler
Throws:
java.lang.Exception

handleHello

protected void handleHello(HelloMessage hello,
                           org.jboss.netty.channel.Channel channel)
Overrides:
handleHello in class AbstractRPCChannelHandler

handleClusterJoinResponse

protected void handleClusterJoinResponse(ClusterJoinResponseMessage response,
                                         org.jboss.netty.channel.Channel channel)
Overrides:
handleClusterJoinResponse in class AbstractRPCChannelHandler

handleError

protected void handleError(ErrorMessage error,
                           org.jboss.netty.channel.Channel channel)
Overrides:
handleError in class AbstractRPCChannelHandler

getTransactionId

protected int getTransactionId()
Description copied from class: AbstractRPCChannelHandler
Get a transaction ID suitable for sending an async message

Specified by:
getTransactionId in class AbstractRPCChannelHandler
Returns:
the unique transaction ID

getRemoteNodeId

protected java.lang.Short getRemoteNodeId()
Description copied from class: AbstractRPCChannelHandler
Get the node ID for the remote node if its connected

Specified by:
getRemoteNodeId in class AbstractRPCChannelHandler
Returns:
the node ID

getLocalNodeId

protected java.lang.Short getLocalNodeId()
Description copied from class: AbstractRPCChannelHandler
Get the node ID for the local node if appropriate

Specified by:
getLocalNodeId in class AbstractRPCChannelHandler
Returns:
the node ID. Null if this is a client

getAuthScheme

protected AuthScheme getAuthScheme()
Description copied from class: AbstractRPCChannelHandler
Get the type of authentication to use for this connection

Specified by:
getAuthScheme in class AbstractRPCChannelHandler

getSharedSecret

protected byte[] getSharedSecret()
                          throws AuthException
Description copied from class: AbstractRPCChannelHandler
Get a shared secret to be used for authentication handshake. Throwing an exception will cause authentication to fail

Specified by:
getSharedSecret in class AbstractRPCChannelHandler
Returns:
the shared secret
Throws:
AuthException