edu.stanford.rt.credential
Class RTContext

java.lang.Object
  |
  +--edu.stanford.rt.credential.RTContext
Direct Known Subclasses:
CredentialStore

public class RTContext
extends java.lang.Object

Author:
Ninghui Li, Sandra Qiu
RTContext contains the info about ApplicationDomainSecifications and Principals in the system.

Field Summary
private  java.util.HashMap applicationDomains
          Index for ApplicationDomain objects.
Key: HashID
Value: ApplicationDomain
private  java.util.HashMap principals
          Index for Principal objects.
Key: PublicKeyPrincipal
Value: PublicKeyPrincipalInfo
private  ApplicationDomain systemDomain
          The built-in system domain.
 
Constructor Summary
RTContext(RTParser rtParser)
          Constructor for RTContext.
 
Method Summary
 void addApplicationDomain(HashID id, ApplicationDomain appDomain)
          Method addApplicationDomain.
 void addPrincipal(PublicKeyPrincipal id, PublicKeyPrincipalInfo principal)
          Method addPrincipals.
 ApplicationDomain getApplicationDomain(HashID id)
          Method getApplicationDomain.
 ApplicationDomain getApplicationDomain(java.lang.String id)
          Method getApplicationDomain.
 PublicKeyPrincipalInfo getPrincipal(PublicKeyPrincipal id)
          Method getPrincipal.
 ApplicationDomain getSystemDomain()
          Method getSystemDomain.
 boolean hasDomainWithID(java.lang.String idref)
          Method hasDomainWithID.
 java.lang.String toString(java.lang.String indent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

applicationDomains

private java.util.HashMap applicationDomains
Index for ApplicationDomain objects.
Key: HashID
Value: ApplicationDomain


principals

private java.util.HashMap principals
Index for Principal objects.
Key: PublicKeyPrincipal
Value: PublicKeyPrincipalInfo


systemDomain

private ApplicationDomain systemDomain
The built-in system domain.

Constructor Detail

RTContext

public RTContext(RTParser rtParser)
          throws java.lang.Exception
Constructor for RTContext.

Method Detail

getSystemDomain

public ApplicationDomain getSystemDomain()
Method getSystemDomain.

Returns:
ApplicationDomain

getApplicationDomain

public ApplicationDomain getApplicationDomain(java.lang.String id)
Method getApplicationDomain.

Parameters:
id -
Returns:
ApplicationDomain

getApplicationDomain

public ApplicationDomain getApplicationDomain(HashID id)
Method getApplicationDomain.

Parameters:
id -
Returns:
ApplicationDomain

addApplicationDomain

public void addApplicationDomain(HashID id,
                                 ApplicationDomain appDomain)
                          throws DomainSpecException
Method addApplicationDomain.

Parameters:
id -
appDomain -
Throws:
DomainSpecException

getPrincipal

public PublicKeyPrincipalInfo getPrincipal(PublicKeyPrincipal id)
Method getPrincipal.

Parameters:
id -
Returns:
PublicKeyPrincipalInfo

addPrincipal

public void addPrincipal(PublicKeyPrincipal id,
                         PublicKeyPrincipalInfo principal)
                  throws DomainSpecException
Method addPrincipals.

Parameters:
id - the hash value of the principal
principal - the public key info of the principal
Throws:
DomainSpecException

hasDomainWithID

public boolean hasDomainWithID(java.lang.String idref)
Method hasDomainWithID. checks if there is an ApplicationDomain object with given hash id.

Parameters:
idref -
Returns:
boolean

toString

public java.lang.String toString(java.lang.String indent)