net.captp.jcomm
Class Introducer

java.lang.Object
  |
  +--org.erights.e.elib.serial.BaseLoader
        |
        +--net.captp.jcomm.Introducer
All Implemented Interfaces:
Loader, Marker, PassByProxy, Uncaller

public class Introducer
extends BaseLoader
implements PassByProxy

Untamed:


Field Summary
private  ESecureRandom myEntropy
           
private  LocatorUnum myLocatorUnum
           
private  NetConfig myNetConfig
          Changes by going on-the-air
private  CapTPMgr myOptCapTPMgr
          if onTheAir
private  SwissTable myOptSwissTable
          if identified
private  KeyPair myOptVatIdentity
          if identified
 
Fields inherited from interface org.erights.e.elib.serial.PassByProxy
HONORARY, HONORED_NAMES
 
Constructor Summary
private Introducer(ConstMap optProps, ESecureRandom entropy)
           
 
Method Summary
 void __printOn(TextWriter out)
          Enabled:
 Object get(String uriBody)
          Enabled: Same as sturdyFromURI, but named get/1 so the introducer can be used as a URIGetter.
(package private)  CapTPMgr getCapTPMgr()
           
 LocatorUnum getLocatorUnum()
          Enabled:
 NetConfig getNetConfig()
          Enabled: Configuration parameter read as a JavaBeans property.
(package private)  SwissTable getSwissTable()
          For use by the SturdyRefMaker and IdentityMgr
 String getVatID()
          Enabled: The fingerprint of the public key of this Introducers identity (and therefore, this vat's identity).
 boolean hasIdentity()
          Enabled: Is this Introducer's identity (and therefore, this vat's identity) already determined?
 boolean isOnTheAir()
          Enabled: Is this vat able to send and receive inter-vat messages?
static Object[] makePair(ConstMap optProps, ESecureRandom entropy, Timer timer)
          Enabled: Returns a pair of a new Introducer, a corresponding IdentityMgr.
 ConstList negotiable()
          Enabled: The list of protocols I can negotiate to speak.
 KeyPair newVatIdentity()
          Enabled: If no identity has yet been determined, generate a new one, and return its public/private key pair.
 ConstList onTheAir()
          Enabled: Become able to communicate.
 Object[] optUncall(Object obj)
          Enabled:
 void setNetConfig(NetConfig newNetConfig)
          Enabled: Configuration parameter set as a JavaBeans property, so long as we are off the air.
 void setVatIdentity(KeyPair identity)
          Enabled: If no identity has yet been determined, become identified as the identity represented by this key pair.
 SturdyRef sturdyFromURI(String uri)
          Enabled: Produce a SturdyRef given a URI.
 String sturdyToURI(SturdyRef ref)
          Enabled: Produce a URI given a SturdyRef.
 
Methods inherited from class org.erights.e.elib.serial.BaseLoader
getOptWrappingUncall, optUnget, ungetToUncall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myNetConfig

private NetConfig myNetConfig
Changes by going on-the-air


myEntropy

private final ESecureRandom myEntropy

myLocatorUnum

private final LocatorUnum myLocatorUnum

myOptVatIdentity

private KeyPair myOptVatIdentity
if identified


myOptSwissTable

private SwissTable myOptSwissTable
if identified


myOptCapTPMgr

private CapTPMgr myOptCapTPMgr
if onTheAir

Constructor Detail

Introducer

private Introducer(ConstMap optProps,
                   ESecureRandom entropy)
Method Detail

makePair

public static Object[] makePair(ConstMap optProps,
                                ESecureRandom entropy,
                                Timer timer)
Enabled: Returns a pair of


getNetConfig

public NetConfig getNetConfig()
Enabled: Configuration parameter read as a JavaBeans property.


setNetConfig

public void setNetConfig(NetConfig newNetConfig)
Enabled: Configuration parameter set as a JavaBeans property, so long as we are off the air.


hasIdentity

public boolean hasIdentity()
Enabled: Is this Introducer's identity (and therefore, this vat's identity) already determined?


newVatIdentity

public KeyPair newVatIdentity()
Enabled: If no identity has yet been determined, generate a new one, and return its public/private key pair.

This pair conveys the authority to claim to be this vat, so guard it well.

Throws:
SecurityException - if an identity has already been determined.

setVatIdentity

public void setVatIdentity(KeyPair identity)
Enabled: If no identity has yet been determined, become identified as the identity represented by this key pair.

To implement identity-persistence, the birth incarnation of a vat should do a newVatIdentity and remember the resulting key pair. Reincarnations of the "same" vat should then do a setVatIdentity with the saved identity, in order to be the reincarnation of the previous vat.

Throws:
SecurityException - if an identity has already been determined.

getSwissTable

SwissTable getSwissTable()
For use by the SturdyRefMaker and IdentityMgr


getVatID

public String getVatID()
Enabled: The fingerprint of the public key of this Introducers identity (and therefore, this vat's identity).

An identity must have already been determined.


isOnTheAir

public boolean isOnTheAir()
Enabled: Is this vat able to send and receive inter-vat messages?


onTheAir

public ConstList onTheAir()
                   throws UnknownHostException,
                          IOException
Enabled: Become able to communicate.

Change NetConfig according to the listen addresses we actually acquired. Return the list of negotiable protocols.

If not yet identified, this will privately generate a new vat identity, but not reveal it through any public protocol. Therefore, applications that wish to do their own identity-persistence must first call either newVatIdentity() or setVatIdentity(..).

UnknownHostException
IOException

getCapTPMgr

CapTPMgr getCapTPMgr()
Returns:

getLocatorUnum

public LocatorUnum getLocatorUnum()
Enabled:


sturdyFromURI

public SturdyRef sturdyFromURI(String uri)
                        throws MalformedURLException
Enabled: Produce a SturdyRef given a URI.

Parameters:
uri - An E format ("<cap://...>") URI string referring to some object.
Returns:
A SturdyRef matching the given URI.
MalformedURLException

sturdyToURI

public String sturdyToURI(SturdyRef ref)
                   throws MalformedURLException
Enabled: Produce a URI given a SturdyRef.

Parameters:
ref - The SturdyRef whose URI is desired
Returns:
An E format ("") URI string matching the SturdyRef
MalformedURLException

negotiable

public ConstList negotiable()
Enabled: The list of protocols I can negotiate to speak.


get

public Object get(String uriBody)
Enabled: Same as sturdyFromURI, but named get/1 so the introducer can be used as a URIGetter.

Specified by:
get in interface Loader

optUncall

public Object[] optUncall(Object obj)
Enabled:

Specified by:
optUncall in interface Uncaller
Parameters:
obj -
Returns:

__printOn

public void __printOn(TextWriter out)
               throws IOException
Enabled:

IOException


comments?