|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.netty.channel.SimpleChannelHandler
org.jboss.netty.handler.timeout.IdleStateAwareChannelHandler
org.sdnplatform.sync.internal.rpc.AbstractRPCChannelHandler
public abstract class AbstractRPCChannelHandler
Abstract base class for implementing the RPC protocol. The protocol is
defined by a thrift specification; all protocol messages are delivered in
a SyncMessage
which will provide specific type information.
Nested Class Summary | |
---|---|
protected static class |
AbstractRPCChannelHandler.ChannelState
|
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler |
---|
org.jboss.netty.channel.ChannelHandler.Sharable |
Field Summary | |
---|---|
protected AbstractRPCChannelHandler.ChannelState |
channelState
|
protected java.lang.String |
currentChallenge
|
protected static org.slf4j.Logger |
logger
|
Constructor Summary | |
---|---|
AbstractRPCChannelHandler()
|
Method Summary | |
---|---|
void |
channelConnected(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e)
|
void |
channelIdle(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.handler.timeout.IdleStateEvent e)
|
protected void |
error(ErrorMessage error,
org.jboss.netty.channel.Channel channel)
|
void |
exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ExceptionEvent e)
|
protected abstract AuthScheme |
getAuthScheme()
Get the type of authentication to use for this connection |
protected SyncMessage |
getError(int transactionId,
java.lang.Exception error,
MessageType type)
Generate an error message from the provided transaction ID and exception |
protected abstract 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 abstract java.lang.Short |
getRemoteNodeId()
Get the node ID for the remote node if its connected |
protected java.lang.String |
getRemoteNodeIdString()
Get the node ID for the remote node if its connected as a string for use output |
protected abstract byte[] |
getSharedSecret()
Get a shared secret to be used for authentication handshake. |
protected abstract int |
getTransactionId()
Get a transaction ID suitable for sending an async message |
protected void |
handleClusterJoinRequest(ClusterJoinRequestMessage request,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleClusterJoinResponse(ClusterJoinResponseMessage response,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleCursorRequest(CursorRequestMessage request,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleCursorResponse(CursorResponseMessage response,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleDeleteRequest(DeleteRequestMessage request,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleDeleteResponse(DeleteResponseMessage response,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleEchoRequest(EchoRequestMessage request,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleError(ErrorMessage error,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleFullSyncRequest(FullSyncRequestMessage request,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleGetRequest(GetRequestMessage request,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleGetResponse(GetResponseMessage response,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleHello(HelloMessage request,
org.jboss.netty.channel.Channel channel)
|
protected void |
handlePutRequest(PutRequestMessage request,
org.jboss.netty.channel.Channel channel)
|
protected void |
handlePutResponse(PutResponseMessage response,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleRegisterRequest(RegisterRequestMessage request,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleRegisterResponse(RegisterResponseMessage response,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleSMAuthenticated(SyncMessage bsm,
org.jboss.netty.channel.Channel channel)
Handle a generic SyncMessage and dispatch to an appropriate
handler |
protected void |
handleSyncMessage(SyncMessage bsm,
org.jboss.netty.channel.Channel channel)
Handle a generic SyncMessage and dispatch to an appropriate
handler |
protected void |
handleSyncOffer(SyncOfferMessage message,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleSyncRequest(SyncRequestMessage request,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleSyncValue(SyncValueMessage message,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleSyncValueResponse(SyncValueResponseMessage message,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleUnknownMessage(org.jboss.netty.channel.ChannelHandlerContext ctx,
java.lang.Object message)
A handler for messages on the channel that are not of type SyncMessage |
protected void |
handshake(HelloMessage request,
org.jboss.netty.channel.Channel channel)
|
protected void |
handshakeChallengeResponse(HelloMessage request,
org.jboss.netty.channel.Channel channel)
|
void |
messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent e)
|
protected void |
unexpectedMessage(int transactionId,
MessageType type,
org.jboss.netty.channel.Channel channel)
Send an error to the channel indicating that we got an unexpected message for this type of RPC client |
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, channelOpen, 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 |
---|
protected static final org.slf4j.Logger logger
protected java.lang.String currentChallenge
protected AbstractRPCChannelHandler.ChannelState channelState
Constructor Detail |
---|
public AbstractRPCChannelHandler()
Method Detail |
---|
public void channelConnected(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent e) throws java.lang.Exception
channelConnected
in class org.jboss.netty.channel.SimpleChannelHandler
java.lang.Exception
public void channelIdle(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.handler.timeout.IdleStateEvent e) throws java.lang.Exception
channelIdle
in class org.jboss.netty.handler.timeout.IdleStateAwareChannelHandler
java.lang.Exception
public void exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ExceptionEvent e) throws java.lang.Exception
exceptionCaught
in class org.jboss.netty.channel.SimpleChannelHandler
java.lang.Exception
public void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent e) throws java.lang.Exception
messageReceived
in class org.jboss.netty.channel.SimpleChannelHandler
java.lang.Exception
protected void handleUnknownMessage(org.jboss.netty.channel.ChannelHandlerContext ctx, java.lang.Object message)
SyncMessage
ctx
- the contextmessage
- the message objectprotected void handleSyncMessage(SyncMessage bsm, org.jboss.netty.channel.Channel channel)
SyncMessage
and dispatch to an appropriate
handler
bsm
- the messagechannel
- the channel on which the message arrivedprotected void handleSMAuthenticated(SyncMessage bsm, org.jboss.netty.channel.Channel channel)
SyncMessage
and dispatch to an appropriate
handler
bsm
- the messagechannel
- the channel on which the message arrivedprotected void handshake(HelloMessage request, org.jboss.netty.channel.Channel channel)
protected void handshakeChallengeResponse(HelloMessage request, org.jboss.netty.channel.Channel channel) throws AuthException
AuthException
protected void error(ErrorMessage error, org.jboss.netty.channel.Channel channel)
protected void handleHello(HelloMessage request, org.jboss.netty.channel.Channel channel)
protected void handleEchoRequest(EchoRequestMessage request, org.jboss.netty.channel.Channel channel)
protected void handleGetRequest(GetRequestMessage request, org.jboss.netty.channel.Channel channel)
protected void handleGetResponse(GetResponseMessage response, org.jboss.netty.channel.Channel channel)
protected void handlePutRequest(PutRequestMessage request, org.jboss.netty.channel.Channel channel)
protected void handlePutResponse(PutResponseMessage response, org.jboss.netty.channel.Channel channel)
protected void handleDeleteRequest(DeleteRequestMessage request, org.jboss.netty.channel.Channel channel)
protected void handleDeleteResponse(DeleteResponseMessage response, org.jboss.netty.channel.Channel channel)
protected void handleSyncValue(SyncValueMessage message, org.jboss.netty.channel.Channel channel)
protected void handleSyncValueResponse(SyncValueResponseMessage message, org.jboss.netty.channel.Channel channel)
protected void handleSyncOffer(SyncOfferMessage message, org.jboss.netty.channel.Channel channel)
protected void handleSyncRequest(SyncRequestMessage request, org.jboss.netty.channel.Channel channel)
protected void handleFullSyncRequest(FullSyncRequestMessage request, org.jboss.netty.channel.Channel channel)
protected void handleCursorRequest(CursorRequestMessage request, org.jboss.netty.channel.Channel channel)
protected void handleCursorResponse(CursorResponseMessage response, org.jboss.netty.channel.Channel channel)
protected void handleRegisterRequest(RegisterRequestMessage request, org.jboss.netty.channel.Channel channel)
protected void handleRegisterResponse(RegisterResponseMessage response, org.jboss.netty.channel.Channel channel)
protected void handleClusterJoinRequest(ClusterJoinRequestMessage request, org.jboss.netty.channel.Channel channel)
protected void handleClusterJoinResponse(ClusterJoinResponseMessage response, org.jboss.netty.channel.Channel channel)
protected void handleError(ErrorMessage error, org.jboss.netty.channel.Channel channel)
protected SyncMessage getError(int transactionId, java.lang.Exception error, MessageType type)
transactionId
- the transaction Iderror
- the exceptiontype
- the type of the message that generated the error
SyncError
messageprotected void unexpectedMessage(int transactionId, MessageType type, org.jboss.netty.channel.Channel channel)
transactionId
- the transaction ID for the message that generated
the errortype
- The type of the message that generated the errorchannel
- the channel to write the errorprotected abstract int getTransactionId()
protected abstract java.lang.Short getRemoteNodeId()
protected java.lang.String getRemoteNodeIdString()
protected abstract java.lang.Short getLocalNodeId()
protected java.lang.String getLocalNodeIdString()
protected abstract AuthScheme getAuthScheme()
protected abstract byte[] getSharedSecret() throws AuthException
AuthException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |