ANTS v2.0 API

ants.route
Class DynamicRouteApp

java.lang.Object
  |
  +--ants.core.Entity
        |
        +--ants.core.Application
              |
              +--ants.route.DynamicRouteApp

public class DynamicRouteApp
extends Application
implements NeighborListener

The "app" that maintains a node's dynamic routing tables.

This is really just an app so it can justify sending capsules off without priming them off some other capsule. (All this code used to be part of DynamicRouteTable.)

Understands the default '-port' argument that all apps grok.

Author:
Utah Janos Team, David Wetherall

Field Summary
static int APP_PORT
           
 
Fields inherited from class ants.core.Application
defaults
 
Constructor Summary
DynamicRouteApp()
          App constructors can't do anything useful.
 
Method Summary
 void neighborAdded(int address, edu.utah.janos.nodeos.Address link)
          A neighbor was added to the neighbor table
 void neighborRemoved(int address, edu.utah.janos.nodeos.Address link)
          A neighbor was removed from the neighbor table
 void receive(Capsule unknownCap)
          Receive and process RouteUpdateCapsule.
 void setArgs(KeyArgs k)
          Parse command line arguments.
 void start()
          The active route table logic.
 
Methods inherited from class ants.core.Application
getDefaultResources, getDefaultTTL, getNode, getNodeAddress, getPort, getPrincipal, send, send, setDefaultResources, setDefaultTTL, thisNode, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

APP_PORT

public static final int APP_PORT
Constructor Detail

DynamicRouteApp

public DynamicRouteApp()
App constructors can't do anything useful. Ideally, I would like to set this.node and this.table, but I can't because the node hasn't been plugged into this app yet, and I need to node to get the table...
Method Detail

setArgs

public void setArgs(KeyArgs k)
             throws InvalidKeyArgsException
Parse command line arguments.

See the class description for a list of the arguments and their meaning.

Overrides:
setArgs in class Application
Tags copied from class: Application
See Also:
#port, KeyArgs

start

public void start()
The active route table logic.

Harmless if invoked on a static table.

Overrides:
start in class Application

receive

public void receive(Capsule unknownCap)
Receive and process RouteUpdateCapsule. RouteUpdateCapsules contain zero or more route update records. Each "record" consists of a destination and a "distance" to that destination.
Overrides:
receive in class Application
Parameters:
unknownCap - the RouteUpdateCapsule.

neighborAdded

public void neighborAdded(int address,
                          edu.utah.janos.nodeos.Address link)
A neighbor was added to the neighbor table
Specified by:
neighborAdded in interface NeighborListener

neighborRemoved

public void neighborRemoved(int address,
                            edu.utah.janos.nodeos.Address link)
A neighbor was removed from the neighbor table
Specified by:
neighborRemoved in interface NeighborListener

ANTS v2.0 API

This documentation is Copyright (C) 1998-2001 The University of Utah and the University of Washington. All Rights Reserved. See the individual source files for distribution terms.
Documentation, software, and mailing lists for ANTS v2.0 can be found at the Janos Project: http://www.cs.utah.edu/flux/janos/