|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.stanford.rt.parser.RTParser
Field Summary | |
private org.apache.xerces.parsers.DOMParser |
parser
|
Fields inherited from interface edu.stanford.rt.util.Constants |
COLON, illegal_value_for, improper_sub_element_for, INDENT, ISSUER_TRACES_ALL, ISSUER_TRACES_DEF, ISSUER_TRACES_NONE, ISSUER_TRACES_RULE, missing_attr_value, no_support_for, SUBJECT_TRACES_ALL, SUBJECT_TRACES_FACT, SUBJECT_TRACES_NONE |
Constructor Summary | |
RTParser()
Constructor for RTParser. |
Method Summary | |
ApplicationDomain |
createSystemDomain()
Method createSystemDomain. |
static org.w3c.dom.Element[] |
getChildElements(org.w3c.dom.Element parent)
Method getChildElements. |
static org.w3c.dom.Element |
getFirstChildElement(org.w3c.dom.Element parent)
Method getFirstChildElement. |
static org.w3c.dom.Element |
getFirstChildElementByTagName(org.w3c.dom.Element parent,
java.lang.String tagName)
|
private ApplicationDomain |
locateDomain(java.lang.String idref,
java.lang.String uri,
RTContext rtContext)
Method locateDomain. |
void |
parseCredentialStore(java.io.InputStream in,
RTContext rtContext,
CredentialStore credentialStore)
Method parseCredentialStore. |
ApplicationDomain |
parseSystemDomain(java.io.InputStream in)
Method parseSystemDomain. |
CredentialDomain |
transformAccessRule(org.w3c.dom.Element ele,
RTContext rtContext)
|
private PrincipalExpression |
transformBody(Principal issuer,
CredentialDomain credDomain,
org.w3c.dom.Element ele)
Method transformBody. |
CredentialDomain |
transformCredential(org.w3c.dom.Element ele,
RTContext rtContext)
Method transformCredential. |
void |
transformCredentialStore(org.w3c.dom.Element root,
RTContext rtContext,
CredentialStore credentialStore)
Method transformCredentialStore. |
private java.util.Date |
transformDateTime(java.lang.String typeName,
java.lang.String dateTime)
Method transformDateTime. |
private DecimalType |
transformDecimalTypeDeclaration(org.w3c.dom.Element ele)
Method transformDecimalTypeDeclaration. |
private DecimalValue |
transformDecimalValue(DecimalType type,
org.w3c.dom.Element ele)
Method transformDecimalValue. |
private DelegationRole |
transformDelegation(Principal issuer,
CredentialDomain credDomain,
org.w3c.dom.Element delegationElement,
org.w3c.dom.Element controlElement)
Method transformDelegation. |
ApplicationDomain |
transformDomain(org.w3c.dom.Element ele,
RTContext rtContext)
Method parseDomain. |
private EnumType |
transformEnumTypeDeclaration(org.w3c.dom.Element ele,
DomainSpecification currentSpec)
Method transformEnumTypeDeclaration. |
private EnumValue |
transformEnumValue(EnumType type,
org.w3c.dom.Element ele)
Method transformEnumValue. |
private Role |
transformExternalRole(org.w3c.dom.Element ele,
CredentialDomain credDomain)
Method transformExternalRole. |
private IntegerType |
transformIntegerTypeDeclaration(org.w3c.dom.Element ele)
Method transformIntegerTypeDeclaration. |
private IntegerValue |
transformIntegerValue(IntegerType type,
org.w3c.dom.Element ele)
Method transformIntegerValue. |
private IntervalValueSet |
transformIntervalValue(OrderedType type,
org.w3c.dom.Element ele)
Method transformIntervalValue. |
private DataValue |
transformOrderedValue(OrderedType type,
org.w3c.dom.Element ele)
Method transformOrderedValue. |
private void |
transformParameter(org.w3c.dom.Element ele,
java.lang.StringBuffer prefix,
RoleTerm roleTerm,
CredentialDomain credDomain)
Method transformParameter. |
private OrderedMap |
transformParameters(org.w3c.dom.NodeList nodes,
DomainSpecification currentSpec)
Method parseParameters. |
private SimpleType |
transformPrincipalTypeDeclaration(org.w3c.dom.Element ele,
DomainSpecification currentSpec)
Method transformPrincipalTypeDeclaration. |
private PrincipalValue |
transformPrincipalValue(org.w3c.dom.Element ele,
CredentialDomain credDomain)
Method transformPrincipalValue. |
private RecordType |
transformRecordTypeDeclaration(org.w3c.dom.Element ele,
DomainSpecification currentSpec)
Method transformRecordTypeDeclaration. |
private RoleDeclaration |
transformRoleDeclaration(org.w3c.dom.Element ele,
DomainSpecification currentSpec)
Method transformRoleDeclaration. |
private RoleDefinition |
transformRoleDefinition(Principal issuer,
CredentialDomain credDomain,
org.w3c.dom.Element ele)
Method transformRoleDefinition. |
private RoleIntersection |
transformRoleIntersection(org.w3c.dom.Element ele,
CredentialDomain credDomain)
Method transformRoleIntersection. |
private RoleTerm |
transformRoleTerm(org.w3c.dom.Element ele,
CredentialDomain credDomain)
Method transformRoleTerm. |
private StringType |
transformStringTypeDeclaration(org.w3c.dom.Element ele)
Method transformStringTypeDeclaration. |
private StringValue |
transformStringValue(StringType type,
org.w3c.dom.Element ele)
Method transformStringValue. |
ApplicationDomain |
transformSystemDomain(org.w3c.dom.Element root)
Method transformSystemDomain. |
private TimeValue |
transformTimeValue(TimeType type,
org.w3c.dom.Element ele)
Method transformTimeValue. |
private TreeType |
transformTreeTypeDeclaration(org.w3c.dom.Element ele)
Method transformTreeTypeDeclaration. |
private TreeValueSet |
transformTreeValue(TreeType type,
org.w3c.dom.Element ele)
Method transformTreeValue. |
private void |
transformValueGroup(SimpleType type,
org.w3c.dom.Element ele,
java.lang.StringBuffer prefix,
RoleTerm roleTerm,
CredentialDomain credDomain)
Method transformValueGroup. |
private void |
transformValueSetGroup(DataType type,
org.w3c.dom.Element ele,
java.lang.StringBuffer prefix,
RoleTerm roleTerm,
CredentialDomain credDomain)
Method transformValueSetGroup. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private org.apache.xerces.parsers.DOMParser parser
Constructor Detail |
public RTParser() throws java.lang.Exception
Method Detail |
public ApplicationDomain createSystemDomain() throws java.lang.Exception
java.lang.Exception
public ApplicationDomain parseSystemDomain(java.io.InputStream in) throws java.lang.Exception
in
-
java.lang.Exception
public ApplicationDomain transformSystemDomain(org.w3c.dom.Element root) throws DomainSpecException
ApplicationDomain
.
root
- XML element of system domain.
DomainSpecException
public static org.w3c.dom.Element getFirstChildElement(org.w3c.dom.Element parent)
parent
-
public static org.w3c.dom.Element getFirstChildElementByTagName(org.w3c.dom.Element parent, java.lang.String tagName)
public static org.w3c.dom.Element[] getChildElements(org.w3c.dom.Element parent)
parent
-
public void parseCredentialStore(java.io.InputStream in, RTContext rtContext, CredentialStore credentialStore) throws java.lang.Exception
CredentialStore
element should be a
root element.
in
- rtContext
- the context in which the parsing occurs.credentialStore
- the credential store being constructed.
DomainSpecException
java.lang.Exception
public void transformCredentialStore(org.w3c.dom.Element root, RTContext rtContext, CredentialStore credentialStore) throws DomainSpecException, CredException
root
- the XML element of credential storertContext
- credentialStore
-
DomainSpecException
CredException
public ApplicationDomain transformDomain(org.w3c.dom.Element ele, RTContext rtContext) throws DomainSpecException
ApplicationDomain
.
ele
- the ApplicationDomain
elementrtContext
- the context in which the transformation occurs.
DomainSpecException
private ApplicationDomain locateDomain(java.lang.String idref, java.lang.String uri, RTContext rtContext) throws DomainSpecException
rtContext
- idref
- the hash value of the target
ApplicationDomainSpecification
object.uri
-
DomainSpecException
- if cannot find the domain by the given idref.private IntegerType transformIntegerTypeDeclaration(org.w3c.dom.Element ele) throws DomainSpecException
<IntegerType name="" min="" max=""/>
ele
-
DomainSpecException
private DecimalType transformDecimalTypeDeclaration(org.w3c.dom.Element ele) throws DomainSpecException
<DecimalType name="" min="" max=""/>
ele
-
DomainSpecException
private StringType transformStringTypeDeclaration(org.w3c.dom.Element ele) throws DomainSpecException
<StringType name="" ignoreCase="false" ordered="false"/>
ele
-
DomainSpecException
private EnumType transformEnumTypeDeclaration(org.w3c.dom.Element ele, DomainSpecification currentSpec) throws DomainSpecException
<EnumType name="" ignoreCase="false" ordered="false"/> <EnumValue>Monday</EnumValue> <EnumValue>Wednesday</EnumValue> <EnumValue>Friday</EnumValue> ... </EnumType>
ele
- currentSpec
-
DomainSpecException
private TreeType transformTreeTypeDeclaration(org.w3c.dom.Element ele) throws DomainSpecException
<TreeType name="DNSType" sparator="." order="rootLast"/>
ele
-
DomainSpecException
private RecordType transformRecordTypeDeclaration(org.w3c.dom.Element ele, DomainSpecification currentSpec) throws DomainSpecException
<RecordType name="record"> <Field name="field1"> <Type domain="" name=""/> </Field> <Field name="field2"> <Type domain="" name=""/> </Field> ... </RecordType>
ele
- currentSpec
-
DomainSpecException
private SimpleType transformPrincipalTypeDeclaration(org.w3c.dom.Element ele, DomainSpecification currentSpec) throws DomainSpecException
<PrincialType name="prinType"> <TypeRef domain="" name=""/> </PrincialType>
ele
- currentSpec
-
DomainSpecException
private RoleDeclaration transformRoleDeclaration(org.w3c.dom.Element ele, DomainSpecification currentSpec) throws DomainSpecException
<RoleDeclaration name="record"> <Parameter name="param1"> <Type domain="" name=""/> </Parameter> <Parameter name="param2"> <Type domain="" name=""/> </Parameter> ... </RoleDeclaration>
ele
- currentSpec
- the DomainSpecification in which the role is declared.
DomainSpecException
private OrderedMap transformParameters(org.w3c.dom.NodeList nodes, DomainSpecification currentSpec) throws DomainSpecException
Parameter
declarations in RoleDeclaration
element.
nodes
- the list of Parameter
elements
DomainSpecException
public CredentialDomain transformCredential(org.w3c.dom.Element ele, RTContext rtContext) throws DomainSpecException, CredException
CredentialDomain
object by parsing element:
<Credential> ... </Credential>
ele
- rtContext
-
DomainSpecException
CredException
public CredentialDomain transformAccessRule(org.w3c.dom.Element ele, RTContext rtContext) throws DomainSpecException, CredException
DomainSpecException
CredException
private PrincipalValue transformPrincipalValue(org.w3c.dom.Element ele, CredentialDomain credDomain) throws DomainSpecException
ele
- credDomain
-
DomainSpecException
private RoleDefinition transformRoleDefinition(Principal issuer, CredentialDomain credDomain, org.w3c.dom.Element ele) throws CredException, DomainSpecException
A role definition may be one the the following elements, i.e. SimpleMember, SimpleContainment, LinkedContainment, IntersectionContainment, ProductContainment, ExclusiveProductContainment, SimpleDelegation, or AdvancedDelegation. Each role definition has a head and a body. The head part is defined by a HeadRoleTerm. The difference between the above 8 elements lies in the body part.
The product role definition represented by ProductContainment and ExclusiveProductContainment has not been supported yet.
issuer
- credDomain
- ele
-
CredException
DomainSpecException
private PrincipalExpression transformBody(Principal issuer, CredentialDomain credDomain, org.w3c.dom.Element ele) throws CredException, DomainSpecException
The body can be one of the following: PrincipalValue, RoleTerm, ExternalRole, LinkedRole, Intersection, Product, or a Delegation. The method handles all types of the role definition body except the Delegation role body.
issuer
- credDomain
- ele
-
CredException
DomainSpecException
private DelegationRole transformDelegation(Principal issuer, CredentialDomain credDomain, org.w3c.dom.Element delegationElement, org.w3c.dom.Element controlElement) throws DomainSpecException, CredException
<SimpleDelegation> ... </SimpleDelegation> Or <AdvancedDelegation> ... </AdvancedDelegation>
issuer
- credDomain
- delegationElement
- controlElement
-
DomainSpecException
CredException
private Role transformExternalRole(org.w3c.dom.Element ele, CredentialDomain credDomain) throws CredException, DomainSpecException
<ExternalRole> ... </ExternalRole>
ele
- credDomain
-
CredException
DomainSpecException
private RoleIntersection transformRoleIntersection(org.w3c.dom.Element ele, CredentialDomain credDomain) throws CredException, DomainSpecException
<Intersection> ... </Intersection>
ele
- credDomain
-
CredException
DomainSpecException
private RoleTerm transformRoleTerm(org.w3c.dom.Element ele, CredentialDomain credDomain) throws CredException, DomainSpecException
<RoleTerm> ... </RoleTerm>
ele
- credDomain
-
CredException
DomainSpecException
private void transformParameter(org.w3c.dom.Element ele, java.lang.StringBuffer prefix, RoleTerm roleTerm, CredentialDomain credDomain) throws DomainSpecException
<Parameter name="aa" id="s"> ... </Parameter>
ele
- prefix
- roleTerm
- credDomain
-
DomainSpecException
private void transformValueSetGroup(DataType type, org.w3c.dom.Element ele, java.lang.StringBuffer prefix, RoleTerm roleTerm, CredentialDomain credDomain) throws DomainSpecException
type
- ele
- prefix
- roleTerm
- credDomain
-
DomainSpecException
private void transformValueGroup(SimpleType type, org.w3c.dom.Element ele, java.lang.StringBuffer prefix, RoleTerm roleTerm, CredentialDomain credDomain) throws DomainSpecException
type
- ele
- prefix
- roleTerm
- credDomain
-
DomainSpecException
private IntervalValueSet transformIntervalValue(OrderedType type, org.w3c.dom.Element ele) throws DomainSpecException
<Interval includeMin="true" includeMax="true"> <min> ... </min> <max> ... </max> </Interval>
type
- ele
-
DomainSpecException
private DataValue transformOrderedValue(OrderedType type, org.w3c.dom.Element ele) throws DomainSpecException
<IntegerValue> ... </IntegerValue> or <DecimalValue> ... </DecimalValue> or <StirngValue> ... </StringValue> or <EnumValue> ... </EnumValue> or <TimeValue> ... </timeValue>
type
- ele
-
DomainSpecException
private IntegerValue transformIntegerValue(IntegerType type, org.w3c.dom.Element ele) throws DomainSpecException
<IntegerValue> 123 </IntegerValue>
type
- ele
-
DomainSpecException
private DecimalValue transformDecimalValue(DecimalType type, org.w3c.dom.Element ele) throws DomainSpecException
<DecimalValue> 123 </DecimalValue>
type
- ele
-
DomainSpecException
private StringValue transformStringValue(StringType type, org.w3c.dom.Element ele) throws DomainSpecException
<StringValue> 123 </StringValue>
type
- ele
-
DomainSpecException
private EnumValue transformEnumValue(EnumType type, org.w3c.dom.Element ele) throws DomainSpecException
<EnumValue> 123 </EnumValue>
type
- ele
-
DomainSpecException
private TreeValueSet transformTreeValue(TreeType type, org.w3c.dom.Element ele) throws DomainSpecException
<TreeValue includeCurrent="true" includeChildren="true" includeDescendents="false"> cs.stanford.edu </TreeValue>
type
- ele
-
DomainSpecException
private TimeValue transformTimeValue(TimeType type, org.w3c.dom.Element ele) throws DomainSpecException
<TimeValue> 2002-08-29T09:31:32 </TimeValue>
type
- ele
-
DomainSpecException
private java.util.Date transformDateTime(java.lang.String typeName, java.lang.String dateTime) throws DomainSpecException
typeName
- dateTime
-
DomainSpecException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |