net.vattp.vls
Class VatLocationServer

java.lang.Object
  |
  +--net.vattp.vls.VatLocationServer
All Implemented Interfaces:
VatLocationLookup

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.

Author:
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

myRegistrations

private final FlexMap myRegistrations
Collection of current registrations


myTimer

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


MINUTE

private static final int MINUTE

REG_DURATION

private static final int REG_DURATION

NO_LOCATIONS

private static final String[] NO_LOCATIONS
Constructor Detail

VatLocationServer

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

getLocations

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

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

put

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

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


comments?