public class NeighborRPC extends DispatchHandler
| Modifier and Type | Class and Description |
|---|---|
static class |
NeighborRPC.SearchValues
The search values for fast get.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
NEIGHBOR_LIMIT |
static int |
NEIGHBOR_SIZE |
| Constructor and Description |
|---|
NeighborRPC(PeerBean peerBean,
ConnectionBean connectionBean) |
NeighborRPC(PeerBean peerBean,
ConnectionBean connectionBean,
boolean register)
Setup the RPC and register for incoming messages.
|
| Modifier and Type | Method and Description |
|---|---|
FutureResponse |
closeNeighbors(PeerAddress remotePeer,
NeighborRPC.SearchValues searchValues,
Message.Type type,
ChannelCreator channelCreator,
ConnectionConfiguration configuration)
Requests close neighbors from the remote peer.
|
protected Collection<PeerAddress> |
getNeighbors(Number160 id,
int atLeast)
TODO: explain why protected method here.
|
void |
handleResponse(Message message,
PeerConnection peerConnection,
boolean sign,
Responder responder)
If the message is OK, that has been previously checked by the user using checkMessage, a reply to the message is
generated here.
|
connectionBean, createMessage, createResponseMessage, createResponseMessage, forwardMessage, peerBean, register, register, signpublic static final int NEIGHBOR_SIZE
public static final int NEIGHBOR_LIMIT
public NeighborRPC(PeerBean peerBean, ConnectionBean connectionBean)
public NeighborRPC(PeerBean peerBean, ConnectionBean connectionBean, boolean register)
peerBean - The peer beanconnectionBean - The connection beanpublic FutureResponse closeNeighbors(PeerAddress remotePeer, NeighborRPC.SearchValues searchValues, Message.Type type, ChannelCreator channelCreator, ConnectionConfiguration configuration)
remotePeer - The remote peer to send this requestsearchValues - The values to search for in the storagetype - The type of the neighbor request:
channelCreator - The channel creator that creates connectionsconfiguration - The client side connection configurationpublic void handleResponse(Message message, PeerConnection peerConnection, boolean sign, Responder responder) throws IOException
DispatchHandlerhandleResponse in class DispatchHandlermessage - Request messagesign - Flag to indicate if message is signedIOExceptionprotected Collection<PeerAddress> getNeighbors(Number160 id, int atLeast)
Copyright © 2014. All rights reserved.