public class SymphonyProtocol
extends java.lang.Object
implements peersim.edsim.EDProtocol
| Modifier and Type | Class and Description |
|---|---|
static class |
SymphonyProtocol.BootstrapStatus |
| Modifier and Type | Field and Description |
|---|---|
boolean |
bidirectionalRouting |
boolean |
fixedLongRangeLinks |
java.util.LinkedHashSet<Tuple<peersim.core.Node,SymphonyProtocol.BootstrapStatus>> |
leftShortRangeLinks |
SymphonyProtocol.BootstrapStatus |
loggedIntoNetwork |
java.util.LinkedHashSet<peersim.core.Node> |
longRangeLinksIncoming |
java.util.LinkedHashSet<peersim.core.Node> |
longRangeLinksOutgoing |
boolean |
lookAhead |
java.util.LinkedHashMap<peersim.core.Node,java.util.Set<java.lang.Double>[]> |
lookAheadMap
Array Contract: at position 0 -> OutgoingLongRangeLinks, 1 -> IncomingLongRangeLinks
|
int |
numberFixedLongRangeLinks |
int |
numberShortRangeLinksPerSide |
java.util.LinkedHashSet<Tuple<peersim.core.Node,SymphonyProtocol.BootstrapStatus>> |
rightShortRangeLinks |
int |
sequentialIdentifier |
| Constructor and Description |
|---|
SymphonyProtocol(java.lang.String prefix) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearHistoryMessage() |
java.lang.Object |
clone() |
peersim.core.Node |
findClosestNode(double identifierToRoute,
java.lang.Iterable<peersim.core.Node> container,
boolean clockwise)
Individuates effectively the next candidate for the routing.
|
peersim.core.Node |
getCandidateForBidirectionalRoute(double identifierToRoute)
Method to individuate the next node that as to be contacted through Bidirectional Routing
mode
|
peersim.core.Node |
getCandidateForRouting(double identifierToRoute)
Method to identify the next node that has to be contacted.
|
peersim.core.Node |
getCandidateForUnidirectionalRoute(double identifierToRoute)
Method to individuate the next node that as to be contacted through Unidirectional Routing
mode
|
Tuple<Message,Message>[] |
getHistoryMessage() |
double |
getIdentifier() |
boolean |
isBootstrapped() |
static boolean |
isLeftNeighbour(double rootIdentifier,
double neighbourIdentifier) |
static boolean |
isLeftNeighbour(peersim.core.Node rootNode,
peersim.core.Node neighbourNode) |
boolean |
isManagerOf(double key) |
void |
processEvent(peersim.core.Node node,
int pid,
java.lang.Object event) |
void |
route(peersim.core.Node src,
double key,
Handler handler) |
public final int sequentialIdentifier
public final int numberShortRangeLinksPerSide
public final boolean bidirectionalRouting
public final boolean lookAhead
public final boolean fixedLongRangeLinks
public final int numberFixedLongRangeLinks
public java.util.LinkedHashSet<peersim.core.Node> longRangeLinksOutgoing
public java.util.LinkedHashSet<peersim.core.Node> longRangeLinksIncoming
public java.util.LinkedHashSet<Tuple<peersim.core.Node,SymphonyProtocol.BootstrapStatus>> rightShortRangeLinks
public java.util.LinkedHashSet<Tuple<peersim.core.Node,SymphonyProtocol.BootstrapStatus>> leftShortRangeLinks
public final java.util.LinkedHashMap<peersim.core.Node,java.util.Set<java.lang.Double>[]> lookAheadMap
public SymphonyProtocol.BootstrapStatus loggedIntoNetwork
public peersim.core.Node getCandidateForRouting(double identifierToRoute)
throws RoutingException
RoutingExceptionpublic peersim.core.Node getCandidateForUnidirectionalRoute(double identifierToRoute)
throws RoutingException
RoutingExceptionpublic peersim.core.Node getCandidateForBidirectionalRoute(double identifierToRoute)
throws RoutingException
RoutingExceptionpublic peersim.core.Node findClosestNode(double identifierToRoute,
java.lang.Iterable<peersim.core.Node> container,
boolean clockwise)
throws RoutingException
identifierToRoute - Identifier to reachcontainer - Candidate Nodes Containerclockwise - true, does unidirectional routing. false, does bidirectional routing.RoutingException - Throw in case no candidate is foundpublic static boolean isLeftNeighbour(peersim.core.Node rootNode,
peersim.core.Node neighbourNode)
neighbourNode - Neighbour Nodepublic static boolean isLeftNeighbour(double rootIdentifier,
double neighbourIdentifier)
public void route(peersim.core.Node src,
double key,
Handler handler)
throws RoutingException
RoutingExceptionpublic void processEvent(peersim.core.Node node,
int pid,
java.lang.Object event)
processEvent in interface peersim.edsim.EDProtocolpublic boolean isManagerOf(double key)
public double getIdentifier()
public void clearHistoryMessage()
public java.lang.Object clone()
clone in interface peersim.core.Protocolclone in class java.lang.Objectpublic boolean isBootstrapped()