|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EndPoint
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.
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. |
Method Detail |
---|
Id getId()
java.lang.String getApplicationId()
Application getApplication()
void byStep()
NodeHandle getLocalNodeHandle()
void scheduleMessage(RouteMessage message, long delay)
message
- The message to be delivereddelay
- The number of milliseconds to wait before delivering the messagevoid broadcast(Id id, Message message)
id
- Key from the message to be broadcast.message
- Message to be routed to all nodes in the network.boolean forward(RouteMessage message)
message
- RouteMessage to deliver to the application level.
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.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.
java.util.Vector neighborSet(int max)
max
- Maximum of nodes to return.
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.
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.
java.util.Set getAllLinks()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |