|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanet.generic.commonapi.EndPointImpl
Nested Class Summary | |
class |
EndPointImpl.MessageScheduler
Implements an scheduler for sent messages to this application with a specified delay. |
Constructor Summary | |
EndPointImpl(Application app,
Node node)
Generates an EndPoint from id in String format and the actual Node. |
Method Summary | |
void |
broadcast(Id key,
Message message)
Sends a broadcast message to the network. |
boolean |
forward(RouteMessage message)
Deliver only the content Message in RouteMessage to the application and returns if this message must be forward. |
Application |
getApplication()
Gets the associated Application. |
java.lang.String |
getApplicationId()
Returns the identification of the related Application |
Id |
getId()
Returns the identification of the related Node |
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. |
java.lang.String |
toString()
Shows a String representatio of this EndPoint |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public EndPointImpl(Application app, Node node)
app
- Related Applicationnode
- Actual Node.Method Detail |
public void route(Id id, Message message, NodeHandle hint)
route
in interface EndPoint
id
- The destination Id of the message.message
- The message to deliverhint
- The destination desired known node. If unknown node, it may be null.public void broadcast(Id key, Message message)
broadcast
in interface EndPoint
message
- The message to deliverkey
- Key from the message to be broadcast.public NodeHandle getLocalNodeHandle()
getLocalNodeHandle
in interface EndPoint
public void scheduleMessage(RouteMessage message, long delay)
scheduleMessage
in interface EndPoint
message
- The message to be delivereddelay
- The number of milliseconds to wait before delivering the messagepublic boolean forward(RouteMessage message)
forward
in interface EndPoint
message
- RouteMessage to be forwarding.
EndPoint.forward(planet.commonapi.RouteMessage)
public java.lang.String getApplicationId()
getApplicationId
in interface EndPoint
EndPoint.getApplicationId()
public Application getApplication()
getApplication
in interface EndPoint
public Id getId()
getId
in interface EndPoint
EndPoint.getId()
public java.util.Vector replicaSet(Id key, int maxRank)
EndPoint
replicaSet
in interface EndPoint
key
- Key from which obtain the replica set.maxRank
- Number of nodes in replica set.
Returns the replica node set.
The number of successor list is defined in the context.
public java.util.Vector localLookup(Id key, int max, boolean safe)
localLookup
in interface EndPoint
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)
neighborSet
in interface EndPoint
max
- Maximum of nodes to return.
public boolean range(NodeHandle node, Id rank, Id leftKey, Id rightKey)
EndPoint
range
in interface EndPoint
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.
This operation provides information about ranges of keys for
which the node is currently a root. Returns false if
the range could not be determined, true otherwise.
It is an error to query the range of a node not present in
the neighbor set.
The [leftKey,rightKey] denotes the inclusive range of key values.
public java.lang.String toString()
Object.toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |