net.tomp2p.rpc
Class DirectDataRPC

java.lang.Object
  extended by org.jboss.netty.channel.SimpleChannelHandler
      extended by net.tomp2p.rpc.ReplyHandler
          extended by net.tomp2p.rpc.DirectDataRPC
All Implemented Interfaces:
org.jboss.netty.channel.ChannelDownstreamHandler, org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler

public class DirectDataRPC
extends ReplyHandler


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
org.jboss.netty.channel.ChannelHandler.Sharable
 
Constructor Summary
DirectDataRPC(PeerBean peerBean, ConnectionBean connectionBean)
           
 
Method Summary
 boolean checkMessage(Message message)
          Before a reply can be done, the message needs to be checked.
 Message handleResponse(Message message, boolean sign)
          If the message is OK, that has been previously checked by the user using checkMessage, a reply to the message is generated here.
 boolean hasObjectDataReply()
           
 boolean hasRawDataReply()
           
 RequestHandlerTCP send(PeerAddress remoteNode, org.jboss.netty.buffer.ChannelBuffer buffer, boolean raw)
           
 FutureData send(PeerAddress remoteNode, org.jboss.netty.buffer.ChannelBuffer buffer, boolean raw, ChannelCreator cc)
           
 FutureData send(PeerAddress remoteNode, org.jboss.netty.buffer.ChannelBuffer buffer, boolean raw, ChannelCreator cc, int idleTCPMillis)
           
 void setReply(ObjectDataReply objectDataReply)
           
 void setReply(RawDataReply rawDataReply)
           
 
Methods inherited from class net.tomp2p.rpc.ReplyHandler
createMessage, exceptionCaught, forwardMessage, registerIoHandler, setSignReply
 
Methods inherited from class org.jboss.netty.channel.SimpleChannelHandler
bindRequested, channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, closeRequested, connectRequested, disconnectRequested, handleDownstream, handleUpstream, messageReceived, setInterestOpsRequested, unbindRequested, writeComplete, writeRequested
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectDataRPC

public DirectDataRPC(PeerBean peerBean,
                     ConnectionBean connectionBean)
Method Detail

send

public FutureData send(PeerAddress remoteNode,
                       org.jboss.netty.buffer.ChannelBuffer buffer,
                       boolean raw,
                       ChannelCreator cc)

send

public FutureData send(PeerAddress remoteNode,
                       org.jboss.netty.buffer.ChannelBuffer buffer,
                       boolean raw,
                       ChannelCreator cc,
                       int idleTCPMillis)

send

public RequestHandlerTCP send(PeerAddress remoteNode,
                              org.jboss.netty.buffer.ChannelBuffer buffer,
                              boolean raw)

setReply

public void setReply(RawDataReply rawDataReply)

setReply

public void setReply(ObjectDataReply objectDataReply)

checkMessage

public boolean checkMessage(Message message)
Description copied from class: ReplyHandler
Before a reply can be done, the message needs to be checked. If you return false, then the peer is removed from the map and the channel is closed.

Specified by:
checkMessage in class ReplyHandler
Parameters:
message - Request message
Returns:
True if a request should be generated, false if channel should be closed and nothing should be replied

hasRawDataReply

public boolean hasRawDataReply()

hasObjectDataReply

public boolean hasObjectDataReply()

handleResponse

public Message handleResponse(Message message,
                              boolean sign)
                       throws Exception
Description copied from class: ReplyHandler
If the message is OK, that has been previously checked by the user using checkMessage, a reply to the message is generated here.

Specified by:
handleResponse in class ReplyHandler
Parameters:
message - Request message
Throws:
Exception


Copyright © 2011. All Rights Reserved.