org.sdnplatform.sync.internal.remote
Class RemoteSyncChannelHandler

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.remote.RemoteSyncChannelHandler
All Implemented Interfaces:
org.jboss.netty.channel.ChannelDownstreamHandler, org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler

public class RemoteSyncChannelHandler
extends AbstractRPCChannelHandler

Implement the client side of the RPC service for the RemoteSyncManager

Author:
readams
See Also:
RemoteSyncManager

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
 
Fields inherited from class org.sdnplatform.sync.internal.rpc.AbstractRPCChannelHandler
channelState, currentChallenge, logger
 
Constructor Summary
RemoteSyncChannelHandler(RemoteSyncManager syncManager)
           
 
Method Summary
 void channelDisconnected(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent e)
           
 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.String getLocalNodeIdString()
          Get the node ID for the local node as a string for use output
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 handleCursorResponse(CursorResponseMessage response, org.jboss.netty.channel.Channel channel)
           
protected  void handleDeleteResponse(DeleteResponseMessage response, org.jboss.netty.channel.Channel channel)
           
protected  void handleError(ErrorMessage error, org.jboss.netty.channel.Channel channel)
           
protected  void handleGetResponse(GetResponseMessage response, org.jboss.netty.channel.Channel channel)
           
protected  void handleHello(HelloMessage hello, org.jboss.netty.channel.Channel channel)
           
protected  void handlePutResponse(PutResponseMessage response, org.jboss.netty.channel.Channel channel)
           
protected  void handleRegisterResponse(RegisterResponseMessage response, org.jboss.netty.channel.Channel channel)
           
 
Methods inherited from class org.sdnplatform.sync.internal.rpc.AbstractRPCChannelHandler
channelConnected, channelIdle, error, exceptionCaught, getError, getRemoteNodeIdString, handleClusterJoinRequest, handleClusterJoinResponse, handleCursorRequest, handleDeleteRequest, handleEchoRequest, handleFullSyncRequest, handleGetRequest, handlePutRequest, handleRegisterRequest, 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, 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
 

Constructor Detail

RemoteSyncChannelHandler

public RemoteSyncChannelHandler(RemoteSyncManager syncManager)
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

channelDisconnected

public void channelDisconnected(org.jboss.netty.channel.ChannelHandlerContext ctx,
                                org.jboss.netty.channel.ChannelStateEvent e)
                         throws java.lang.Exception
Overrides:
channelDisconnected 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

handleGetResponse

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

handlePutResponse

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

handleDeleteResponse

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

handleCursorResponse

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

handleRegisterResponse

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

handleError

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

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

getLocalNodeIdString

protected java.lang.String getLocalNodeIdString()
Description copied from class: AbstractRPCChannelHandler
Get the node ID for the local node as a string for use output

Overrides:
getLocalNodeIdString in class AbstractRPCChannelHandler
Returns:
the node ID

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

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