|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface which represents a node in a peer-to-peer system, regardless of the underlying protocol. This represents a factory, in a sense, that will give a application an Endpoint which it can use to send and receive messages.
Method Summary | |
void |
broadcast(java.lang.String appId,
NodeHandle to,
NodeHandle nextHop,
Message msg)
Initiating a Broadcast Message |
void |
fail()
If supose TCP connections onto network layer, this method must informe with some type of error message to its connected nodes for broken connection. |
java.util.Set |
getAllLinks()
Gets all node connections to other nodes as its NodeHandles. |
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. |
Id |
getId()
Returns the Id of this node |
IdFactory |
getIdFactory()
Returns a factory for Ids specific to this node's protocol. |
NodeHandle |
getLocalHandle()
Returns the NodeHandle for the actual Node. |
void |
getNewE(java.util.Iterator it,
GMLConstraint constraint,
java.util.Collection E,
java.lang.String color)
Adds a new Edge to E set according to specified GMLConstraint. |
NodeHandle |
getPred()
Returns the NodeHandle of the present predecessor of the node |
Application[] |
getRegisteredApplications()
Returns all references of the applications that mantains this node. |
NodeHandle |
getSucc()
Returns the NodeHandle of the present successor of the node |
java.util.Vector |
getSuccList(int max)
Returns the successor list of the present node with max number of Ids. |
boolean |
isAlive()
Informs if this node is alive. |
boolean |
isLocalMessage(RouteMessage msg)
The isLocalMessage's method is an extension method for commonapi specs. |
void |
join(Id nodeId)
This Node joins another node identified by nodeId. |
void |
leave()
This method permits to the actual node to leave 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. |
java.util.Vector |
neighborSet(int max)
Obtains an unordered list of up to max nodes that are neighbors of the local node. |
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. |
Queue |
outMessages()
Returns the outgoing queue with message to be send. |
boolean |
playsGoodRole()
The playsGoodRole's method is an extension method for commonapi specs. |
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)
It permits to the node to send messages, run stabilization, etc. |
boolean |
range(NodeHandle node,
Id rank,
Id leftKey,
Id rightKey)
This operation provides information about ranges of keys for which the node is currently a root. |
void |
receive(RouteMessage msg)
This method is invoked to send a message msg to the actual Node (another ----> me). |
EndPoint |
registerApplication(Application app,
java.lang.String instance)
This returns a VirtualizedNode specific to the given application and instance name to the application, which the application can then use in order to send and receive messages. |
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. |
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. |
void |
send(RouteMessage msg)
This method is invoked to send a message msg to another Node (me ---> another). |
void |
setGoodRole(boolean role)
The setGoodRole's method is an extension method for commonapi specs. |
void |
setTimer(TimerTask task,
long firstTime)
Sets a new task to make only once time. |
void |
setTimer(TimerTask task,
long firstTime,
long period)
Sets a new task to make periodicly at period time. |
Method Detail |
public EndPoint registerApplication(Application app, java.lang.String instance)
app
- The Applicationinstance
- An identifier for a given instance
public Application[] getRegisteredApplications()
public Id getId()
public IdFactory getIdFactory() throws InitializationException
InitializationException
- if occurs any problem with
IdFactory initialization.public void routeData(java.lang.String appId, NodeHandle to, NodeHandle nextHop, Message msg)
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 join(Id nodeId)
nodeId
- Id of Node to join to the actual ring.public void leave()
public void fail()
public boolean process(int actualStep)
actualStep
- Actual step to simulate
public void receive(RouteMessage msg) throws QueueFull
msg
- Message to be received for the actual Node.
QueueFull
- if the incoming queue of the actual Node is full.public void send(RouteMessage msg) throws QueueFull
msg
- Message to be received for the remote Node.
QueueFull
- if the outgoing queue of the actual Node is full.public Queue outMessages()
public void printNode()
public void prettyPrintNode()
public void broadcast(java.lang.String appId, NodeHandle to, NodeHandle nextHop, Message msg)
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.
If it is null, the message must be routed.public NodeHandle getLocalHandle()
public NodeHandle getPred()
public NodeHandle getSucc()
public boolean isAlive()
public java.util.Vector getSuccList(int max)
max
- number of the elements (NodeHandle's) to return
public boolean playsGoodRole()
public void setGoodRole(boolean role)
role
- public boolean isLocalMessage(RouteMessage msg)
BehavioursPool
public void networkStabilized(boolean stabilized)
stabilized
- True wether the network is stable.public void setTimer(TimerTask task, long firstTime)
task
- Job to do at the unique activation.firstTime
- First moment at which the task will be activated, in
absolute representation, not relative for the actual time.public void setTimer(TimerTask task, long firstTime, long period)
task
- Job to do at each activation.firstTime
- First moment at which the task will be activated,
in absolute representation, not relative for the actual timeperiod
- Number of steps or millis of the period.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.
public java.util.Vector neighborSet(int max)
max
- Maximum of nodes to return.
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.
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.
public void getNewE(java.util.Iterator it, GMLConstraint constraint, java.util.Collection E, java.lang.String color)
it
- Iterator over a collection of nodeHandles.constraint
- Specific constraints.color
- Fill color of the edge.E
- Edge set where they have to be added.public void getEInGML(java.util.Collection E, GMLConstraint constraint)
E
- Edge Setconstraint
- Constraints for edge selectionpublic java.util.Set getAllLinks()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |