All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.ants.ants.PrimordialNode
java.lang.Object
   |
   +----edu.utah.janos.ants.ants.PrimordialNode

  Summary

class  PrimordialNode
     extends java.lang.Object
{
          // Fields 10
     private static int address;
     private static int consolePort;
     private static final String[] defaults;
     private static CommSpaceHandle neighborsSpace;
     private static String physAddr;
     private static final Hashtable pidToFlowQueue;
     private static RouteTable routeTable;
     private static String routefile;
     static final UnknownMidPackets unknownMidPackets;
     private static boolean updateRoutes;

          // Constructors 1
     private PrimordialNode();

          // Methods 15
     static synchronized void addMID(TypeID, UserID, TypeID, int);
     static CommSpaceHandle fillNeighborSpace() throws IOException;
     private static void fireUpNewAppFlow(AppConfig) throws InterruptedException, IOException;
     private static CommSpaceHandle fireUpNewFlow(Credentials, ThreadPoolSpec, MemSpec, TypeID, CommQueue, String, String[]) throws InterruptedException, IOException;
     private static void fireUpNewProtocolFlow(TypeID, CommQueue) throws InterruptedException, IOException;
     public static int getAddress();
     static String getPhysicalAddress();
     static RouteTable getRouteTable();
     private static RouteTable loadRouteTableImpl(int, boolean, String);
     static int nextHopToNode(int);
     static void setAddress(int);
     static void setArgs(KeyArgs) throws InvalidKeyArgsException;
     static void setPhysicalAddress(String);
     static void start(Vector) throws IOException, AddressFormatException, NoSuchNodeAddress, InterruptedException;
     private static void startConsole(Node, int);

}

The root Node object that boots the system and tracks system-wide state. This is as opposed to the per-flow Node interface that every protocol/application sees.

XXX move the ConfigurationManager stuff into here. %AUTHOR_PAT% %AUTHOR_CKH%




  Fields

· defaults

Summary  |  Top

   private static final String[] defaults

Arguments the PrimordialNode understands and their defaults.


· consolePort

Summary  |  Top
   private static int consolePort

Port to start a console thread on this port (if > -1).


· routefile

Summary  |  Top
   private static String routefile


· updateRoutes

Summary  |  Top
   private static boolean updateRoutes


· routeTable

Summary  |  Top
   private static RouteTable routeTable


· neighborsSpace

Summary  |  Top
   private static CommSpaceHandle neighborsSpace


· address

Summary  |  Top
   private static int address

32-bit logical address of this Node.

XXX replace with a real Address object?


· physAddr

Summary  |  Top
   private static String physAddr

Physical address as an "opaque" String. ("only" addr can parse it...


· pidToFlowQueue

Summary  |  Top
   private static final Hashtable pidToFlowQueue


· unknownMidPackets

Summary  |  Top
   static final UnknownMidPackets unknownMidPackets

Global cache of packets for MIDs that haven't been loaded/resolved.

The Dead Letter Office.


  Constructors

· PrimordialNode

Summary  |  Top

   private PrimordialNode() 

No instance of this class is ever created.



  Methods

· loadRouteTableImpl

Summary  |  Top
   private static RouteTable loadRouteTableImpl(int addr, 
                                                boolean updateRoutes, 
                                                String routeTableFile) 


· start

Summary  |  Top
   static void start(Vector appConfigs)  throws IOException, AddressFormatException, NoSuchNodeAddress, InterruptedException

Start the node on its way.



· startConsole

Summary  |  Top
   private static void startConsole(Node node, 
                                    int consolePort) 


· fillNeighborSpace

Summary  |  Top
   static CommSpaceHandle fillNeighborSpace()  throws IOException

Setup one outchan direct to each neighbor node. Enter each into a hashtable indexed by the logical address of the neighbor.

XXX record the logical address of each neighbor in the neigborsSpace commSpace. Child protocols and apps will create a set of OutChannels from this info. Seems rather weak and ugly, though. Perhaps push-able OutChannelHandles would be a good idea?

XXX this is now redundant with the per-node outchannels, no?

XXX Its really, really sad that I call this once for each Flow I create. Kinda stupid, no?



· getRouteTable

Summary  |  Top
   static RouteTable getRouteTable() 


· nextHopToNode

Summary  |  Top
   static int nextHopToNode(int addr) 

Return the logical ANTS address of the next node on the path to the given addr.



· setArgs

Summary  |  Top
   static void setArgs(KeyArgs k)  throws InvalidKeyArgsException


· getAddress

Summary  |  Top
   public static int getAddress() 


· setAddress

Summary  |  Top
   static void setAddress(int address) 

Set this node's logical address. Only invoked once during configuration of the system after the Node object is created.

See Also: parseCommands



· setPhysicalAddress

Summary  |  Top
   static void setPhysicalAddress(String addr) 

Set the physical address of this node. Needed by the route table update algorithms. Not parsed. Only understood by the core.Address class.

Parameter Description
addr the String representation of this node's physical address.



· getPhysicalAddress

Summary  |  Top
   static String getPhysicalAddress() 


· addMID

Summary  |  Top
   static synchronized void addMID(TypeID pid, 
                                   UserID userInfo, 
                                   TypeID mid, 
                                   int prevNode) 

Add the given MID to the set understood by this node. This creates a flow to handle the mid (using the resource defined by the userInfo field).

XXX Currently the whole method is synchronized. This protects the race-prone lookup/create in the pidToFlowQueue map. It doesn't need to protect the fireUpNewProtocolFlow.

Parameter Description
pid the PID of the new flow.
userInfo the user identity/credentials of the new flow
mid the MID that caused the flow to get loaded.
prevNode the node that sent the initial MID-labeled packet.



· fireUpNewAppFlow

Summary  |  Top
   private static void fireUpNewAppFlow(AppConfig app)  throws InterruptedException, IOException


· fireUpNewProtocolFlow

Summary  |  Top
   private static void fireUpNewProtocolFlow(TypeID pid, 
                                             CommQueue queue)  throws InterruptedException, IOException


· fireUpNewFlow

Summary  |  Top
   private static CommSpaceHandle fireUpNewFlow(Credentials cred, 
                                                ThreadPoolSpec tps, 
                                                MemSpec ms, 
                                                TypeID pid, 
                                                CommQueue queue, 
                                                String className, 
                                                String[] args)  throws InterruptedException, IOException


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7