net.tomp2p.rpc
Class HandshakeRPC

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

public class HandshakeRPC
extends ReplyHandler


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
org.jboss.netty.channel.ChannelHandler.Sharable
 
Constructor Summary
HandshakeRPC(PeerBean peerBean, ConnectionBean connectionBean)
           
 
Method Summary
 boolean checkMessage(Message message)
          Before a reply can be done, the message needs to be checked.
 FutureResponse fireTCP(PeerAddress remoteNode)
           
 FutureResponse fireUDP(PeerAddress remoteNode)
           
 Message handleResponse(Message message)
          If the message is OK, that has been previously checked by the user using checkMessage, a reply to the message is generated here.
 FutureResponse pingBroadcastUDP(PeerAddress remoteNode)
           
 FutureResponse pingTCP(PeerAddress remoteNode)
           
 FutureResponse pingTCPDiscover(PeerAddress remoteNode)
           
 FutureResponse pingTCPProbe(PeerAddress remoteNode)
           
 FutureResponse pingUDP(PeerAddress remoteNode)
           
 FutureResponse pingUDPDiscover(PeerAddress remoteNode)
           
 FutureResponse pingUDPProbe(PeerAddress remoteNode)
           
 
Methods inherited from class net.tomp2p.rpc.ReplyHandler
createMessage, exceptionCaught, forwardMessage, isSign, registerIoHandler, setSign
 
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

HandshakeRPC

public HandshakeRPC(PeerBean peerBean,
                    ConnectionBean connectionBean)
Method Detail

pingBroadcastUDP

public FutureResponse pingBroadcastUDP(PeerAddress remoteNode)

pingUDP

public FutureResponse pingUDP(PeerAddress remoteNode)

pingTCP

public FutureResponse pingTCP(PeerAddress remoteNode)

fireUDP

public FutureResponse fireUDP(PeerAddress remoteNode)

fireTCP

public FutureResponse fireTCP(PeerAddress remoteNode)

pingUDPDiscover

public FutureResponse pingUDPDiscover(PeerAddress remoteNode)

pingTCPDiscover

public FutureResponse pingTCPDiscover(PeerAddress remoteNode)

pingUDPProbe

public FutureResponse pingUDPProbe(PeerAddress remoteNode)

pingTCPProbe

public FutureResponse pingTCPProbe(PeerAddress remoteNode)

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

handleResponse

public Message handleResponse(Message message)
                       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.