Class LocalNameServer

java.lang.Object
  extended by LocalNameServer

public class LocalNameServer
extends java.lang.Object

This class represents the local name server that routes the messages among PEs. Each PE has a related local name server.

Version:
1.2 (06/2005)
Author:
Yin Xiong, Glenn Matthews

Field Summary
(package private)  java.lang.String gns
          The address of the global name server.
(package private)  int PEid
          The ID of the PE this local name server serves.
(package private)  java.util.Vector<RoutingInfo> routingTable
          A vector that stores the LP address information
 
Constructor Summary
LocalNameServer(int pid)
          Construct a new LocalNameServer object.
 
Method Summary
 int addRoutingInfo(RoutingInfo rinfo)
          Adds a row of routing inforamtion into the routing table.
 int addRoutingRow(RoutingInfo rinfo)
          Adds a row of routing inforamtion into the lookup table.
 void dump()
          Displays the contents of the routing table.
 java.lang.String getAPPids()
          Returns (as a tab-separated list) the APPids of every known LP.
 int getLidByAid(java.lang.String appid)
          Looks up the LP id of an LP by its application id.
 int getPidByAid(java.lang.String appid)
          Looks up the PE id of an LP by its application id.
 RoutingInfo getRoutingInfoByAid(java.lang.String appid)
          Looks up the routing info by an LP's application id.
 RoutingInfo getRoutingInfoByLid(int lid)
          Looks up the routing info by an LP id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PEid

int PEid
The ID of the PE this local name server serves.


gns

java.lang.String gns
The address of the global name server.


routingTable

java.util.Vector<RoutingInfo> routingTable
A vector that stores the LP address information

Constructor Detail

LocalNameServer

public LocalNameServer(int pid)
Construct a new LocalNameServer object.

Parameters:
pid - int the system-assigned id of this PE
Method Detail

addRoutingRow

public int addRoutingRow(RoutingInfo rinfo)
Adds a row of routing inforamtion into the lookup table.

Parameters:
rinfo - an RoutingInfo instance representing a row in the table.
Returns:
the size of the lookup table.

dump

public void dump()
Displays the contents of the routing table.


getRoutingInfoByAid

public RoutingInfo getRoutingInfoByAid(java.lang.String appid)
Looks up the routing info by an LP's application id.

Parameters:
appid - String representing the application id of the LP.

getRoutingInfoByLid

public RoutingInfo getRoutingInfoByLid(int lid)
Looks up the routing info by an LP id.

Parameters:
lid - int representing the LP id.

addRoutingInfo

public int addRoutingInfo(RoutingInfo rinfo)
Adds a row of routing inforamtion into the routing table.

Parameters:
rinfo - an RoutingInfo instance representing a row in the table.
Returns:
the size of the routing table.

getPidByAid

public int getPidByAid(java.lang.String appid)
Looks up the PE id of an LP by its application id.

Parameters:
appid - String representing the application id of the LP.

getLidByAid

public int getLidByAid(java.lang.String appid)
Looks up the LP id of an LP by its application id.

Parameters:
appid - String representing the application id of the LP.

getAPPids

public java.lang.String getAPPids()
Returns (as a tab-separated list) the APPids of every known LP.

Since:
1.2