|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.stanford.rt.credential.RoleDeclaration
RoleDeclaration
element in a
ApplicationDomainSpecification
document.
Issue: Do not support identity yet.Field Summary | |
private RoleDeclaration |
baseRole
BaseRole Element for Restriction, Extension, Projection. |
private DomainSpecification |
context
Role declaration context. |
private int |
declarationType
Declaration type: Restriction, Extension, Projection or Plain. |
static int |
DEFAULT_ISSUER_TYPE
Default issuer traces type: rule |
static int |
DEFAULT_SUBJECT_TYPE
Defualt issuer traces type: fact. |
private int |
dimension
Default is 1 In RTML: attribute dimension . |
private static int |
EXTENSION
|
private boolean |
isIdentity
Default is false. |
private int |
issuerTracesType
Default is DEFAULT_ISSUER_TYPE In RTML: attribute issuerTracesType . |
static java.util.HashMap |
issuerTracesTypes
Issuer traces types |
private java.lang.String |
name
Role name. |
private OrderedMap |
parameterDeclarations
Maps String (parameter name) to DataType (parameter type). |
private static int |
PLAIN
|
private java.util.HashMap |
positionToPrefixes
|
private java.util.HashMap |
prefixToPositions
This map keeps track of the ordersing of the flattend name-prefixes. |
private static int |
PROJECTION
|
private static int |
RESTRICTION
|
private int |
subjectTracesType
Default is DEFAULT_SUBJECT_TYPE In RTML: attribute subjectTracesType . |
static java.util.HashMap |
subjectTracesTypes
Subject traces types |
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 | |
private |
RoleDeclaration(DomainSpecification context,
java.lang.String name,
int issuerTracesType,
int subjectTracesType,
int dimension,
boolean isIdentity,
int declarationType,
RoleDeclaration baseRole,
OrderedMap parameterDeclarations)
Private contructor ensures that no one else can contruct a RoleDeclaration object and the state of a RoleDeclaration object is complete (unmodifiable) once it is created. |
Method Summary | |
private void |
calculatePrefixPositions(java.lang.StringBuffer prefix,
int position,
OrderedMap paramDeclarations,
java.util.HashMap prefixToPositionMap,
java.util.HashMap positionToPrefixMap)
Method calculatePrefixPositions. |
static RoleDeclaration |
createExtensionRole(DomainSpecification context,
java.lang.String name,
boolean isIdentity,
RoleDeclaration baseRole,
OrderedMap newParameters)
Method createExtensionRole. |
static RoleDeclaration |
createPlainRole(DomainSpecification context,
java.lang.String name,
int issuerTracesType,
int subjectTracesType,
int dimension,
boolean isIdentity,
OrderedMap newParameters)
Method createPlainRole. |
static RoleDeclaration |
createProjectionRole(DomainSpecification context,
java.lang.String name,
boolean isIdentity,
RoleDeclaration baseRole,
java.lang.String[] parameterNames)
Method createProjectionRole. |
static RoleDeclaration |
createRestrictionRole(DomainSpecification context,
java.lang.String name,
boolean isIdentity,
RoleDeclaration baseRole,
OrderedMap newParameters)
Method createRestrictionRole. |
RoleDeclaration |
getBaseRole()
Returns the base role object. |
DomainSpecification |
getContext()
Returns the role declaration context. |
int |
getDimension()
Returns the value for dimension . |
int |
getIssuerTracesType()
Returns the value for issuerTracesType . |
private java.lang.String |
getIssuerTracesTypeString(int issuerTracesType)
|
java.lang.String |
getName()
Returns the role name. |
OrderedMap |
getParameterDeclarations()
Method getParameterDeclarations. |
DataType |
getParameterType(java.lang.String paramName)
Method getParameterType. |
int |
getPosition(java.lang.String prefix)
Method getPosition. |
java.util.Map |
getPositionToPrefixes()
Returns a unmodifiable view of position-to-prefix map. |
java.lang.String |
getPrefix(int position)
Method getPrefix. |
java.util.Map |
getPrefixToPositions()
Returns a unmodifiable view of prefix-to-position map. |
int |
getSubjectTracesType()
Returns the value for subjectTracesType . |
private java.lang.String |
getSubjectTracesTypeString(int subjectTracesType)
|
int |
getTotalPrefixes()
Returns the total number of the prefixes in the map. |
boolean |
isIdentity()
Checks whether this role is an identity-based role. |
java.lang.String |
toString(java.lang.String indent)
Method toString. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.util.HashMap issuerTracesTypes
public static java.util.HashMap subjectTracesTypes
public static int DEFAULT_ISSUER_TYPE
public static int DEFAULT_SUBJECT_TYPE
private DomainSpecification context
DomainSpecification
in which the current role
is declared.
private java.lang.String name
name
.
private int issuerTracesType
issuerTracesType
.
private int subjectTracesType
subjectTracesType
.
private int dimension
dimension
.
private boolean isIdentity
isIdentity
.
private OrderedMap parameterDeclarations
private int declarationType
private RoleDeclaration baseRole
private java.util.HashMap prefixToPositions
private java.util.HashMap positionToPrefixes
private static final int RESTRICTION
private static final int EXTENSION
private static final int PROJECTION
private static final int PLAIN
Constructor Detail |
private RoleDeclaration(DomainSpecification context, java.lang.String name, int issuerTracesType, int subjectTracesType, int dimension, boolean isIdentity, int declarationType, RoleDeclaration baseRole, OrderedMap parameterDeclarations) throws DomainSpecException
context
- name
- issuerTracesType
- subjectTracesType
- dimension
- isIdentity
- declarationType
- baseRole
- parameterDeclarations
-
DomainSpecException
Method Detail |
public static RoleDeclaration createRestrictionRole(DomainSpecification context, java.lang.String name, boolean isIdentity, RoleDeclaration baseRole, OrderedMap newParameters) throws DomainSpecException
Restriction
type
RoleDeclaration
object.
name
- isIdentity
- baseRole
- newParameters
-
DomainSpecException
public static RoleDeclaration createExtensionRole(DomainSpecification context, java.lang.String name, boolean isIdentity, RoleDeclaration baseRole, OrderedMap newParameters) throws DomainSpecException
Extension
type
RoleDeclaration
object.
name
- isIdentity
- baseRole
- newParameters
-
DomainSpecException
public static RoleDeclaration createProjectionRole(DomainSpecification context, java.lang.String name, boolean isIdentity, RoleDeclaration baseRole, java.lang.String[] parameterNames) throws DomainSpecException
Projection
type
RoleDeclaration
object.
name
- isIdentity
- baseRole
- parameterNames
-
DomainSpecException
public static RoleDeclaration createPlainRole(DomainSpecification context, java.lang.String name, int issuerTracesType, int subjectTracesType, int dimension, boolean isIdentity, OrderedMap newParameters) throws DomainSpecException
Plain
type of
RoleDeclaration
object. Identity
is not supported.
name
- issuerTracesType
- subjectTracesType
- dimension
- isIdentity
- newParameters
-
DomainSpecException
public DomainSpecification getContext()
public java.lang.String getName()
public int getIssuerTracesType()
issuerTracesType
.
public int getSubjectTracesType()
subjectTracesType
.
public int getDimension()
dimension
.
public RoleDeclaration getBaseRole()
public boolean isIdentity()
public OrderedMap getParameterDeclarations() throws DomainSpecException
RoleDeclaration
,
the map contains parameters declared both in base role and this role.
For Projection type RoleDeclaration
,
the map contains only those paraeters declared in base role with
matching names with this role's declared parameters.
DomainSpecException
public DataType getParameterType(java.lang.String paramName) throws DomainSpecException
paramName
- name of the declared parameter.
DomainSpecException
public java.util.Map getPrefixToPositions()
public java.util.Map getPositionToPrefixes()
public int getTotalPrefixes()
public int getPosition(java.lang.String prefix)
prefix
- the prefix to get the position with.
public java.lang.String getPrefix(int position)
position
- the position to get prefix with.
public java.lang.String toString(java.lang.String indent)
indent
-
private void calculatePrefixPositions(java.lang.StringBuffer prefix, int position, OrderedMap paramDeclarations, java.util.HashMap prefixToPositionMap, java.util.HashMap positionToPrefixMap) throws DomainSpecException
prefix
- current prefix. Prefix is a lolon-saparated string, which
is the concatenation of role name and parameter names.position
- the current position of the prefix.paramDeclarations
- all parameters declared in this role.prefixToPositionMap
- a HashMap which maps a prefix to its position.positionToPrefixMap
- a HashMap which maps a position to its prefix
DomainSpecException
private java.lang.String getIssuerTracesTypeString(int issuerTracesType)
private java.lang.String getSubjectTracesTypeString(int subjectTracesType)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |