net.tomp2p.p2p
Class DistributedRouting
java.lang.Object
net.tomp2p.p2p.DistributedRouting
public class DistributedRouting
- extends Object
Handles routing of nodes to other nodes
- Author:
- Thomas Bocek
Method Summary |
FutureWrapper<FutureRouting> |
bootstrap(Collection<PeerAddress> peerAddresses,
int maxNoNewInfo,
int maxFailures,
int maxSuccess,
int parallel,
boolean forceTCP,
boolean isForceRoutingOnlyToSelf,
ChannelCreator cc)
Bootstraps to the given peerAddresses, i.e. |
static void |
cancel(boolean cancelOnFinish,
int parallel,
BaseFuture[] futureResponses)
|
FutureRouting |
route(Number160 locationKey,
Number160 domainKey,
Collection<Number160> contentKeys,
Message.Type type,
int maxDirectHits,
int maxNoNewInfo,
int maxFailures,
int maxSuccess,
int parallel,
boolean forceTCP,
ChannelCreator cc)
Looks for a route to the given locationKey |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DistributedRouting
public DistributedRouting(PeerBean peerBean,
NeighborRPC neighbors)
bootstrap
public FutureWrapper<FutureRouting> bootstrap(Collection<PeerAddress> peerAddresses,
int maxNoNewInfo,
int maxFailures,
int maxSuccess,
int parallel,
boolean forceTCP,
boolean isForceRoutingOnlyToSelf,
ChannelCreator cc)
- Bootstraps to the given peerAddresses, i.e. looking for near nodes
- Parameters:
peerAddresses
- the node to which bootstrap should be performed tomaxNoNewInfo
- number of nodes asked without new information to stop atmaxFailures
- number of failures to stop atparallel
- number of routing requests performed concurrently
- Returns:
- a FutureRouting object, is set to complete if the route has been found
route
public FutureRouting route(Number160 locationKey,
Number160 domainKey,
Collection<Number160> contentKeys,
Message.Type type,
int maxDirectHits,
int maxNoNewInfo,
int maxFailures,
int maxSuccess,
int parallel,
boolean forceTCP,
ChannelCreator cc)
- Looks for a route to the given locationKey
- Parameters:
locationKey
- the node a route should be found todomainKey
- the domain of the network the current node and locationKey is incontentKeys
- keys of the content to search for. Only used if you perform a getmaxDirectHits
- number of direct hits to stop atmaxNoNewInfo
- number of nodes asked without new information to stop atmaxFailures
- number of failures to stop atparallel
- number of routing requests performed concurrentlyisDigest
- Set to true to return a digest of the remote content for close neighborsforceTCP
- Set to true if routing should use TCP connectionscc
- the channel creator
- Returns:
- a FutureRouting object, is set to complete if the route has been found
cancel
public static void cancel(boolean cancelOnFinish,
int parallel,
BaseFuture[] futureResponses)
Copyright © 2013. All Rights Reserved.