|
|||||||||||
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 the *local* node, upon which applications can call methods.
Any implementation must include the no argument constructor.
Method Summary | |
void |
broadcast(Id id,
Message message)
Sends a broadcast message to all nodes in the network. |
void |
byStep()
An upcall to inform to each Application for a new step. |
boolean |
forward(RouteMessage message)
Forwarding the message to the Application |
java.util.Set |
getAllLinks()
Gets all node connections to other nodes as its NodeHandles. |
Application |
getApplication()
Gets the associated Application. |
java.lang.String |
getApplicationId()
Returns the Application's identification. |
Id |
getId()
Returns this node's id, which is its identifier in the namespace. |
NodeHandle |
getLocalNodeHandle()
Returns a handle to the local node below this endpoint. |
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. |
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. |
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 |
route(Id id,
Message message,
NodeHandle hint)
This method makes an attempt to route the message to the root of the given id. |
void |
scheduleMessage(RouteMessage message,
long delay)
Schedules a message to be delivered to this application after the provided number of milliseconds. |
EndPoint |
setValues(Application app,
Node node)
Sets the initial values for this EndPoint. |
Method Detail |
public Id getId()
public java.lang.String getApplicationId()
public Application getApplication()
public void byStep()
public NodeHandle getLocalNodeHandle()
public void scheduleMessage(RouteMessage message, long delay)
message
- The message to be delivereddelay
- The number of milliseconds to wait before delivering the messagepublic void broadcast(Id id, Message message)
id
- Key from the message to be broadcast.message
- Message to be routed to all nodes in the network.public boolean forward(RouteMessage message)
message
- RouteMessage to deliver to the application level.
public void route(Id id, Message message, NodeHandle hint)
id
- The destination Id of the message.message
- The message to deliverhint
- NodeHandle to be used to route the message. If it is null,
the message must be routed as the overlay network establish it.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 java.util.Set getAllLinks()
public EndPoint setValues(Application app, Node node)
app
- Uplying application.node
- Underlaying node.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |