net.captp.jcomm
Class CapTPMgr

java.lang.Object
  |
  +--net.captp.jcomm.CapTPMgr
All Implemented Interfaces:
NewConnectionReactor

public class CapTPMgr
extends Object
implements NewConnectionReactor

Untamed:


Field Summary
private  VatTPMgr myConnMgr
          The connections manager to talk to
private  ESecureRandom myEntropy
          makes new unguessable numbers
private  LocatorUnum myLocatorUnum
           
private  FlexMap myProxyConnections
          map from DataConnections to ProxyConnections
(package private)  Sealer mySealer
          for self recognition
private  SwissTable mySwissTable
          Registration table to use for map between ObjectIDs and objs
(package private)  Unsealer myUnsealer
           
 
Constructor Summary
(package private) CapTPMgr(KeyPair identityKeys, NetConfig netConfig, SwissTable swissTable, ESecureRandom entropy, LocatorUnum locatorUnum)
          Constructor
 
Method Summary
private  CapTPConnection arrangeProxyConnection(VatTPConnection dataConn)
          Do the work of setting up a new CapTPConnection, regardless of which end initiated the transaction.
(package private)  void connectionDead(VatTPConnection connection, Resolver optBufferedLookups)
          Be informed that one of our connections has died.
 LocatorUnum getLocatorUnum()
          Enabled:
 NetConfig getNetConfig()
          Enabled: Return the post-on-the-air configuration parameters
(package private)  CapTPConnection getOrMakeProxyConnection(ConstList searchPath, String vatID)
          If vatID is me, return null, else get or make a live CapTPConnection for vatID.
(package private)  SwissTable getSwissTable()
           
(package private)  CapTPConnection optProxyConnection(String vatID)
          If I've got a live CapTPConnection for that vatID, return it, else null.
 void reactToNewConnection(VatTPConnection connection)
          Enabled: Notice that a new (inbound) data connection has appeared.
 ConstList searchPath()
          Enabled: Return the search path to our own vat.
 void setVatLocationLookup(VatLocationLookup vls)
          Enabled: Set the object which will respond to vat location queries on our listen port.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mySwissTable

private final SwissTable mySwissTable
Registration table to use for map between ObjectIDs and objs


myProxyConnections

private FlexMap myProxyConnections
map from DataConnections to ProxyConnections


myConnMgr

private VatTPMgr myConnMgr
The connections manager to talk to


myEntropy

private final ESecureRandom myEntropy
makes new unguessable numbers


mySealer

final Sealer mySealer
for self recognition


myUnsealer

final Unsealer myUnsealer

myLocatorUnum

private final LocatorUnum myLocatorUnum
Constructor Detail

CapTPMgr

CapTPMgr(KeyPair identityKeys,
         NetConfig netConfig,
         SwissTable swissTable,
         ESecureRandom entropy,
         LocatorUnum locatorUnum)
   throws UnknownHostException,
          IOException
Constructor

Parameters:
identityKeys - The identity of the vat we are managing remote references into.
netConfig - Where to listen, register, and tell other to look for me.
swissTable - Associates swissNumbers with references.
entropy - Provides new unguessable numbers.
Method Detail

arrangeProxyConnection

private CapTPConnection arrangeProxyConnection(VatTPConnection dataConn)
                                        throws IOException
Do the work of setting up a new CapTPConnection, regardless of which end initiated the transaction. If there is already an existing connection to the indicated party, just use it.

Parameters:
dataConn - The VatTPConnection upon which we are communicating.
Returns:
The resulting new (or existing) CapTPConnection.
IOException

connectionDead

void connectionDead(VatTPConnection connection,
                    Resolver optBufferedLookups)
Be informed that one of our connections has died.

Parameters:
connection - The connection that died
optBufferedLookups - SturdyRef lookup requests that were issued in the midst of orderly shutdown (these need to be resubmitted).

getSwissTable

SwissTable getSwissTable()

reactToNewConnection

public void reactToNewConnection(VatTPConnection connection)
Enabled: Notice that a new (inbound) data connection has appeared.

Specified by:
reactToNewConnection in interface NewConnectionReactor
Parameters:
connection - The new VatTPConnection object.
See Also:
net.vattp.data.NewConnectionReactor

optProxyConnection

CapTPConnection optProxyConnection(String vatID)
                             throws IOException
If I've got a live CapTPConnection for that vatID, return it, else null.

This does *not* initiate a connection attempt.

IOException

getOrMakeProxyConnection

CapTPConnection getOrMakeProxyConnection(ConstList searchPath,
                                         String vatID)
                                   throws IOException
If vatID is me, return null, else get or make a live CapTPConnection for vatID.

IOException

searchPath

public ConstList searchPath()
Enabled: Return the search path to our own vat.


getNetConfig

public NetConfig getNetConfig()
Enabled: Return the post-on-the-air configuration parameters


setVatLocationLookup

public void setVatLocationLookup(VatLocationLookup vls)
Enabled: Set the object which will respond to vat location queries on our listen port.

Parameters:
vls - The VLS object

getLocatorUnum

public LocatorUnum getLocatorUnum()
Enabled:



comments?