Class VatLocationServer

All Implemented Interfaces:

class VatLocationServer
extends Object
implements VatLocationLookup

A vat location server, which maintains a collection of the locations of E vats which it can lookup on demand.

These registrations have a finite lifetime which we also manage here. In order to better decouple issues during this stage of development, this version is no longer persistent.

XXX The VLS must be registered under swiss number 0 so it can respond, as an E object, to registrations (and unregistrations?).

XXX The VLS must be registered by setVatLocationLookup to listen on port 0 for location queries.

Eris Messick, Bill Frantz, Chip Morningstar, Mark Miller

Field Summary
private static int MINUTE
private  FlexMap myRegistrations
          Collection of current registrations
private  Timer myTimer
          Can be transient or persistent, depending on policy
private static String[] NO_LOCATIONS
private static int REG_DURATION
Constructor Summary
VatLocationServer(Timer timer)
          Construct a vat location server.
Method Summary
 String[] getLocations(String vatID)
          XXX Will currently only return either a zero or a one element array.
 void put(String vatID, String searchPath)
          Add a new vat to the registry.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


private final FlexMap myRegistrations
Collection of current registrations


private final Timer myTimer
Can be transient or persistent, depending on policy


private static final int MINUTE


private static final int REG_DURATION


private static final String[] NO_LOCATIONS
Constructor Detail


public VatLocationServer(Timer timer)
Construct a vat location server.

Since, in this version, we are only starting from scratch, it makes a new empty registration collection.

Method Detail


public String[] getLocations(String vatID)
XXX Will currently only return either a zero or a one element array.

Specified by:
getLocations in interface VatLocationLookup
is the locations the requestor should try next


public void put(String vatID,
                String searchPath)
Add a new vat to the registry.

vatID - Vat ID of vat being added
searchPath - Were in the world to find it