3.20.1.1. Pastry Endpoint API

interface Node
{
  Endpoint registerApplication (Application application, java.lang.String instance);
  ...
}

interface Endpoint
{
  Id getId ();

  // Get a list of nodes that can route towards a node
  NodeHandleSet localLookup (Id id, int num, boolean safe);
  // Get the list of neighbor nodes
  NodeHandleSet neighborSet (int num);

  // Get the range of keys we are responsible for
  IdRange range (NodeHandle handle, int rank, Id lkey);
  // Get a list of nodes that can store a replica
  NodeHandleSet replicaSet (Id id, int maxRank);

  // Send a message to a node
  void route (Id id, Message message, NodeHandle hint);
  ...
}