edu.stanford.rt.credential
Class CredentialDomain

java.lang.Object
  |
  +--edu.stanford.rt.credential.DomainSpecification
        |
        +--edu.stanford.rt.credential.CredentialDomain

public class CredentialDomain
extends DomainSpecification

Author:
Ninghui Li, Sandra Qiu
Implementation of Credential element. Only one CredentialDomain object is associated with each Credential object.

Field Summary
private  org.w3c.dom.Element credentialElement
          the XML Element of the associated Credential.
private  Principal issuer
          Issuer of the associated Credential.
private  java.util.HashMap principals
          maps String (principal shortName) to Principal object
private  java.util.ArrayList roleDefinitions
          list of role defined in this credential.
private  ValidityTime validityTime
          validity time of the associated Credential.
 
Fields inherited from class edu.stanford.rt.credential.DomainSpecification
 
Constructor Summary
CredentialDomain(org.w3c.dom.Element credentialElement, RTContext rtContext)
          Constructor for CredentialDomain.
 
Method Summary
 void addPrincipal(java.lang.String shortName, Principal principal)
          Method addPrincipal.
 void addRoleDefinition(RoleDefinition roleDefinition)
          Add a new role definition.
 Principal getIssuer()
          Returns the issuer.
 Principal getPrincipal(java.lang.String shortName)
          Method getPrincipal.
 ValidityTime getValidityTime()
          Returns the validityTime.
 RoleDeclaration lookupRoleDeclaration(java.lang.String roleName)
          Method lookupRoleDeclaration.
 DataType lookupType(java.lang.String typeName)
          Method lookupType.
 java.util.Iterator roleDefinitionIterator()
          Method roleDefinitionIterator.
 void setHashID(HashID hashID)
          Sets the hashID.
 void setIssuer(Principal issuer)
          Method setIssuer.
 void setValidityTime(ValidityTime validityTime)
          Method setValidityTime.
 java.lang.String toString(java.lang.String indent)
          Method toString.
 
Methods inherited from class edu.stanford.rt.credential.DomainSpecification
addRole, addType, addType, getContext, getHashID, getImportedDomains, getPrincipalType, getRoleDeclarations, getTypeDeclarations, importDomain, isComplete, lookupImportedDomain, lookupRoleDeclaration, lookupType, setComplete, setPrincipalType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

issuer

private Principal issuer
Issuer of the associated Credential.


validityTime

private ValidityTime validityTime
validity time of the associated Credential.


principals

private java.util.HashMap principals
maps String (principal shortName) to Principal object


roleDefinitions

private java.util.ArrayList roleDefinitions
list of role defined in this credential.


credentialElement

private org.w3c.dom.Element credentialElement
the XML Element of the associated Credential.

Constructor Detail

CredentialDomain

public CredentialDomain(org.w3c.dom.Element credentialElement,
                        RTContext rtContext)
                 throws DomainSpecException
Constructor for CredentialDomain.

Method Detail

addPrincipal

public void addPrincipal(java.lang.String shortName,
                         Principal principal)
                  throws DomainSpecException
Method addPrincipal.

Parameters:
shortName -
principal -
Throws:
DomainSpecException

getPrincipal

public Principal getPrincipal(java.lang.String shortName)
Method getPrincipal.

Parameters:
shortName -
Returns:
Principal returns null if cannot find one.

setIssuer

public void setIssuer(Principal issuer)
Method setIssuer.

Parameters:
issuer -

getIssuer

public Principal getIssuer()
Returns the issuer.

Returns:
Principal

getValidityTime

public ValidityTime getValidityTime()
Returns the validityTime.

Returns:
ValidityTime

setValidityTime

public void setValidityTime(ValidityTime validityTime)
Method setValidityTime.

Parameters:
validityTime -

toString

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

Parameters:
indent -
Returns:
String

setHashID

public void setHashID(HashID hashID)
               throws DomainSpecException
Description copied from class: DomainSpecification
Sets the hashID.

Overrides:
setHashID in class DomainSpecification
Parameters:
hashID - The hashID to set
DomainSpecException

roleDefinitionIterator

public java.util.Iterator roleDefinitionIterator()
Method roleDefinitionIterator.

Returns:
Iterator

addRoleDefinition

public void addRoleDefinition(RoleDefinition roleDefinition)
Add a new role definition.

Parameters:
roleDefinition - The roleDefinition to set

lookupType

public DataType lookupType(java.lang.String typeName)
                    throws DomainSpecException
Method lookupType. Look up the DataType declaration by given typeName in the current domain. if cannot find one then look it up in system domain.

Overrides:
lookupType in class DomainSpecification
Parameters:
typeName -
Returns:
DataType
Throws:
DomainSpecException - if cannot find a DataType declaration by the given name.

lookupRoleDeclaration

public RoleDeclaration lookupRoleDeclaration(java.lang.String roleName)
                                      throws DomainSpecException
Method lookupRoleDeclaration. Look up the role declaration by given roleName in the current domain. If cannot find one then look it up in system domain.

Overrides:
lookupRoleDeclaration in class DomainSpecification
Parameters:
roleName -
Returns:
RoleDeclaration
Throws:
DomainSpecException - if cannot find one.