|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanet.generic.commonapi.NodeImpl
planet.symphony.SymphonyNode
public class SymphonyNode
This node is an implementation of the Symphony overlay.
Nested Class Summary | |
---|---|
class |
SymphonyNode.StabilizeTask
Simple TimerTask that invoke stabilize() Node method. |
Field Summary | |
---|---|
static int |
ACCEPT_CONNECT
|
boolean |
alive
|
static int |
CANCEL_CONNECT
|
static int |
CLOSE_LONG_CONNECT
|
static int |
CLOSE_NEIGHBOUR_CONNECT
|
static int |
DATA
Type value: It identifies that this message contains an application level Message. |
static java.lang.String[] |
MODES
This String contains a string representation of each mode value of the RouteMessage. |
static int |
NumberOfModes
|
static int |
NumberOfTypes
|
static int |
QUERY_CONNECT
|
static int |
QUERY_JOIN
Type value: First message that is send by any node to get its inmediate successor. |
static int |
REFRESH
Mode value: Defines a message's mode that requires only communication on one way. |
static int |
REPLY
Mode value: Defines the response of a communication. |
static int |
REQUEST
Mode value: Defines the start of communication that requires response (REPLY). |
int |
retriesNewLongDistance
|
static int |
SET_INFO
|
boolean |
stabilized
|
static java.lang.String[] |
TYPES
This String contains a string representation of each type value of the RouteMessage. |
Fields inherited from class planet.generic.commonapi.NodeImpl |
---|
endpoints, id, listeners, nodeHandle, role |
Constructor Summary | |
---|---|
SymphonyNode(Id id)
|
Method Summary | |
---|---|
void |
addToNeighbourSet(java.util.Collection c)
|
void |
addToNeighbourSet(NodeHandle neighbour)
|
void |
broadcast(java.lang.String appId,
NodeHandle to,
NodeHandle nextHop,
Message msg)
This method throws a NoSuchMethodError, because the broadcast algorithm is not implemented yet. |
RouteMessage |
buildMessage(NodeHandle from,
NodeHandle to,
int type,
int mode,
Message m)
|
RouteMessage |
buildMessage(NodeHandle from,
NodeHandle to,
int type,
int mode,
Message m,
java.lang.String key)
|
RouteMessage |
buildMessage(NodeHandle from,
NodeHandle to,
NodeHandle nextHop,
int type,
int mode,
Message m)
|
RouteMessage |
buildMessage(NodeHandle from,
NodeHandle to,
NodeHandle nextHop,
int type,
int mode,
Message m,
java.lang.String key)
|
void |
dispatcher(RouteMessage msg)
|
void |
fail()
The leave protocol is the same as in leave case. |
java.util.Set |
getAllLinks()
Gets all node connections to other nodes as its NodeHandles. |
NodeHandle |
getClosestNodeHandle(Id id)
Returns the NodeHandle closest to id. |
void |
getEInGML(java.util.Collection E,
GMLConstraint constraint)
This method is a callback method used to collect all of the edges of a graph according to GML file format for latter visual graph performance. |
java.util.Hashtable |
getEndPoints()
|
java.util.Set |
getIncommingSet()
|
java.util.Hashtable |
getInfo()
Returns information of the node |
java.util.Collection |
getNeighbourSet()
|
RouteMessage |
getNewLongDistance()
|
java.util.Set |
getNewSet()
|
java.util.Set |
getOutcommingSet()
|
NodeHandle |
getPred()
Returns the NodeHandle of the present predecessor of the node |
NodeHandle |
getSucc()
Returns the NodeHandle of the present successor of the node |
java.util.Vector |
getSuccList(int max)
Returns up to max successors of the actual node. |
boolean |
isAlive()
Informs if this node is alive. |
boolean |
isLocalMessage(RouteMessage msg)
The isLocalMessage's method is an extension method for commonapi specs. |
boolean |
IsStabilized()
|
void |
join(Id bsId)
The node joins in the network |
void |
leave()
The node leaves the network |
java.util.Vector |
localLookup(Id key,
int max,
boolean safe)
Returns a list of nodes that can be used as next hops on a route towards key. |
void |
lookup(Id key)
Lookup of a key |
java.util.Vector |
neighborSet(int max)
Obtains an unordered list of up to max nodes that are neighbors of the local node. |
boolean |
neighbourSetContains(NodeHandle o)
|
void |
networkStabilized(boolean stabilized)
The networkStabilized's method is a callback method used for the network simulator to notify to all nodes the stabilization process has finished and the topology is built up. |
void |
prettyPrintNode()
Shows for System.out only the owner Id, its predecessor and successor. |
void |
printNode()
Shows for System.out all information of the node, including finger table. |
boolean |
process(int actualStep)
Given a time fraction, the node it can do everything what needs during this |
boolean |
range(NodeHandle node,
Id rank,
Id leftKey,
Id rightKey)
This methods ALWAYS return false. |
boolean |
remove(NodeHandle o)
|
java.util.Vector |
replicaSet(Id key,
int maxRank)
Returns an ordered set of nodes on which replicas of the object with this key can be stored. |
NodeHandle |
route(NodeHandle to)
|
void |
routeData(java.lang.String appId,
NodeHandle to,
NodeHandle nextHop,
Message msg)
Receive's data of the application level and sends it through de network. |
java.lang.String |
toString()
|
Methods inherited from class planet.generic.commonapi.NodeImpl |
---|
addMessageListener, dispatchDataMessage, getId, getIdFactory, getLocalHandle, getNewE, getRegisteredApplication, getRegisteredApplications, hasMoreMessages, invokeByStepToAllApplications, nextMessage, outMessages, playsGoodRole, receive, registerApplication, removeMessageListener, send, setGoodRole, setTimer, setTimer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int REQUEST
public static final int REPLY
public static final int REFRESH
public static final int QUERY_JOIN
public static final int SET_INFO
public static final int QUERY_CONNECT
public static final int ACCEPT_CONNECT
public static final int CANCEL_CONNECT
public static final int CLOSE_LONG_CONNECT
public static final int CLOSE_NEIGHBOUR_CONNECT
public static final int NumberOfTypes
public static final int NumberOfModes
public static final int DATA
public static final java.lang.String[] TYPES
public static final java.lang.String[] MODES
public int retriesNewLongDistance
public boolean alive
public boolean stabilized
Constructor Detail |
---|
public SymphonyNode(Id id) throws InitializationException
InitializationException
Method Detail |
---|
public java.util.Hashtable getEndPoints()
public RouteMessage buildMessage(NodeHandle from, NodeHandle to, int type, int mode, Message m)
public RouteMessage buildMessage(NodeHandle from, NodeHandle to, int type, int mode, Message m, java.lang.String key)
public RouteMessage buildMessage(NodeHandle from, NodeHandle to, NodeHandle nextHop, int type, int mode, Message m)
public RouteMessage buildMessage(NodeHandle from, NodeHandle to, NodeHandle nextHop, int type, int mode, Message m, java.lang.String key)
public void addToNeighbourSet(java.util.Collection c)
public void addToNeighbourSet(NodeHandle neighbour)
public java.util.Collection getNeighbourSet()
public boolean neighbourSetContains(NodeHandle o)
public boolean remove(NodeHandle o)
public NodeHandle getSucc()
Node
public NodeHandle getPred()
Node
public java.util.Set getOutcommingSet()
public java.util.Set getIncommingSet()
public java.util.Set getNewSet()
public void lookup(Id key)
NodeImpl
lookup
in class NodeImpl
key
- Idpublic void join(Id bsId)
NodeImpl
join
in interface Node
join
in class NodeImpl
bsId
- Id of a node in the networkpublic void leave()
NodeImpl
leave
in interface Node
leave
in class NodeImpl
public RouteMessage getNewLongDistance()
public void dispatcher(RouteMessage msg)
public boolean process(int actualStep)
NodeImpl
process
in interface Node
process
in class NodeImpl
actualStep
- Actual step in simulation time.
public boolean isLocalMessage(RouteMessage msg)
isLocalMessage
in interface Node
isLocalMessage
in class NodeImpl
BehavioursPool
public java.util.Hashtable getInfo()
NodeImpl
getInfo
in class NodeImpl
public void routeData(java.lang.String appId, NodeHandle to, NodeHandle nextHop, Message msg)
Node
appId
- String that includes the application identification.to
- Node that must receive this message. If cannot represents
a real node.nextHop
- Node that must receive this message as first hop.msg
- Message to be sent.
If it is null, the message must be routed.public void printNode()
Node
public void prettyPrintNode()
Node
public boolean isAlive()
Node
public NodeHandle route(NodeHandle to)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean IsStabilized()
public void networkStabilized(boolean stabilized)
stabilized
- True wether the network is stable.public void broadcast(java.lang.String appId, NodeHandle to, NodeHandle nextHop, Message msg)
appId
- Application identification.to
- Source of the message.nextHop
- NextHop of the message.msg
- Message to be send as broadcast.Node.broadcast(java.lang.String,
planet.commonapi.NodeHandle, planet.commonapi.NodeHandle,
planet.commonapi.Message)
public void fail()
Node.fail()
public java.util.Vector getSuccList(int max)
max
- Maximum number of successors to return.
Node.getSuccList(int)
public java.util.Vector localLookup(Id key, int max, boolean safe)
key
- Target keymax
- Number of next hops.safe
- If true, the expected fraction of faulty nodes are the same
of the nodes in the overlay.
Node.localLookup(planet.commonapi.Id, int, boolean)
public java.util.Vector neighborSet(int max)
max
- Maximum of nodes to return.
Node.neighborSet(int)
public boolean range(NodeHandle node, Id rank, Id leftKey, Id rightKey)
node
- Node that is currently a root of some range of keys.rank
- Number of keys that is root the node (rank=rightKey-leftKey).leftKey
- The value that appears in the invokation is the candidate left
key of the range. It may be modified to reflect the correct left margin
once invokation has finished.rightKey
- Shows once the invokation has finished the left margin of
the range.
Node.range(planet.commonapi.NodeHandle,
planet.commonapi.Id, planet.commonapi.Id, planet.commonapi.Id)
public java.util.Vector replicaSet(Id key, int maxRank)
key
- Id for which we find the replica set.maxRank
- Maximum number of members in replica set.
Node.replicaSet(planet.commonapi.Id, int)
public NodeHandle getClosestNodeHandle(Id id)
getClosestNodeHandle
in interface Node
getClosestNodeHandle
in class NodeImpl
id
- Id to find.
public java.util.Set getAllLinks()
public void getEInGML(java.util.Collection E, GMLConstraint constraint)
E
- Edge Setconstraint
- Constraints for edge selection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |