public interface AddressServer
WARNING: this class is not yet done. It is more of an early example at this point, but it probably does not easily provide for mapping an entire network from a single location as is the original intent. Certainly it would be very hard to make routing decisions based on this. For these reasons, this class will probably be changed in the future.
Modifier and Type | Field and Description |
---|---|
static int |
NODE_MASK
Mask used to extract address of the node in the router's address space.
|
static int |
ROUTER_MASK
Mask used to extract the router address from any valid node address.
|
Modifier and Type | Method and Description |
---|---|
void |
deregister(NodeInfo node)
Remove the given node descriptor from the registry of known/valid
nodes.
|
NodeInfo |
lookupByAddress(int addr)
Returns the node description associated with the specified address.
|
NodeInfo |
lookupByName(java.lang.String name)
Returns the node description associated with the specified name.
|
void |
register(NodeInfo node)
Add the given node descriptor into the registry of known/valid nodes.
|
static final int NODE_MASK
static final int ROUTER_MASK
void register(NodeInfo node)
node
- The node descriptor to add.void deregister(NodeInfo node)
node
- The node descriptor to remove.NodeInfo lookupByName(java.lang.String name)
name
- The name of the node to be found. If set to null
then the descriptor for the local node will be returned.null
if no matching
node is found.NodeInfo lookupByAddress(int addr)
addr
- The address of the node to be found. If set to 0, then the
the descriptor for the local node will be returned.null
if no matching
node is found.