|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--spki.BaseObj
|
+--spki.Subject
SPKI Subject abstract class.
Formal definitions:
<integer>:: {<byte-string> representing an integer value in network byte-order} ;
<k-val>:: {<integer> that's always > 1} ;
<scheme-id>:: <byte-string> ;
<threshold>:: "(" "thresh" <k-val> <scheme-id> ")" ;
<subject>:: <subject-rule> | <subject-role> |
<subject-name> | <subject-transfer> | <subject-attr> ;
SubjObj| Field Summary | |
private static String |
__ME
This class's full name. |
(package private) boolean |
dirty
Do we need to re-build the SExpression? |
static int |
MIN_THRESHOLD
The minimum meaningful threshold value (2). |
private boolean |
reduceonly
Is this object created for threshold reduction only? Used by the Subject.toSExpression() method. |
static String |
SEXP_NAME
This class S-Expression type name, used by toSExpression() and other methods. |
private SubjObj |
subj_obj
The <subj-obj>. |
(package private) SList |
subj_obj_sexp
The <subj-obj>'s S-Expression, set by the Subject(SExpression) constructor to be parsed by the implementing subclass. |
private Object[] |
subj_objs
The list of subj-objs. |
private int |
thresh
The subject's threshold value (<k-val>), default to MIN_THRESHOLD-1. |
private Sexp |
thresh_scheme
The threshold scheme-id. |
static String |
THRESHOLD_SEXP_NAME
The threshold field S-Expression type name, used by toSExpression() and other methods. |
| Fields inherited from class spki.BaseObj |
__ME,
cache_sexp,
cached_sexp,
DEFAULT_HASH_ALG,
locked,
SEXP_NAME |
| Constructor Summary | |
protected |
Subject()
Don't use me. |
(package private) |
Subject(int threshold,
Sexp thresh_scheme,
Object[] subjects)
Create and immutalbe Subject object from the given threshold and list of subj-objs. |
protected |
Subject(int threshold,
Sexp thresh_scheme,
SubjObj subject)
Create an immutable Subject object from the given threshold and subj-obj. |
protected |
Subject(SExpression sexp)
Create an immutable Subject object from an S-Expression. |
| Method Summary | |
static SubjACL |
getSubjACL(SExpression sexp)
Get an instance of a SubjACL from given S-Expression. |
SubjObj |
getSubjObj()
Get this subject's subj-obj. |
(package private) Object[] |
getSubjObjs()
Get an array of this subject's subj-objs. |
(package private) int |
getSubjObjsLength()
Get the number of this subject's subj-objs. |
int |
getThreshold()
Get this subject's threshold value. |
Sexp |
getThresholdSchemeId()
Get this subject's threshold scheme-id, if available. |
private static void |
rSubjObjs2SExpression(SList list,
Object[] objs)
Recursively walk through the given array of subj-objs, which may contain n-level of sub-arrays, and construct the SExpression representation of them into the given SList. |
protected void |
setSubjObj(SubjObj subj_obj)
Set this subject's subj-obj. |
private void |
setThreshold(int thresh,
Sexp thresh_scheme)
Set this subject's threshold value. |
SExpression |
toSExpression()
Build an SExpression representing this object. |
| Methods inherited from class spki.BaseObj |
disableSExpressionCaching,
enableSExpressionCaching,
extractHashAlgId,
getCachedSExpression,
isLocked,
isSListOfType,
lock,
providerToSPKI,
setCachedSExpression,
spkiToProvider,
toString |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private static final String __ME
public static final String SEXP_NAME
toSExpression()public static final String THRESHOLD_SEXP_NAME
toSExpression()public static final int MIN_THRESHOLD
private int thresh
MIN_THRESHOLDprivate Sexp thresh_scheme
private SubjObj subj_obj
SubjObjSList subj_obj_sexp
Subject(SExpression)boolean dirty
toSExpression(),
setThreshold(int,Sexp),
setSubjObj(SubjObj)private Object[] subj_objs
Subject(int,Sexp,Object[])private boolean reduceonly
Subject(int,Sexp,Object[]),
toSExpression()| Constructor Detail |
protected Subject()
Subject(SExpression),
Subject(int,Sexp,SubjObj)
protected Subject(SExpression sexp)
throws SPKIException,
ParseException
The overriding constructor should first call this constructor, then verify the threshold value with the getThreshold() method, parse the subj_obj_sexp field and store the result using the setSubjObj() method, cache the S-Expression with the setCachedSExpression() method, set the dirty field to false, and finish by making the object immutable with the lock() method.
BaseObj.BaseObj(SExpression),
subj_obj_sexp,
getThreshold(),
setSubjObj(SubjObj),
BaseObj.setCachedSExpression(SExpression),
BaseObj.lock()
protected Subject(int threshold,
Sexp thresh_scheme,
SubjObj subject)
throws SPKIException
threshold - the optional threshold value,
ignored if < MIN_THRESHOLD.thresh_scheme - the threshold scheme-id,
ignored if the threshold argument is ignored.subject - the subj-obj.MIN_THRESHOLD,
SubjObj
Subject(int threshold,
Sexp thresh_scheme,
Object[] subjects)
throws SPKIException
threshold - the optional threshold value,
ignored if < MIN_THRESHOLD.thresh_scheme - the threshold scheme-id,
ignored if the threshold argument is ignored.subjects - the list of subj-objs.Tuple.SUnion(Subject,Subject),
Tuple.tEliminate(Subject)| Method Detail |
public SExpression toSExpression()
throws SPKIException
public int getThreshold()
public Sexp getThresholdSchemeId()
throws SPKIException
public SubjObj getSubjObj()
SubjObj,
Subject(int,Sexp,Object[])
public static final SubjACL getSubjACL(SExpression sexp)
throws ParseException,
SPKIException
sexp - the SExpression containing a SubjACL.
protected void setSubjObj(SubjObj subj_obj)
throws IllegalStateException,
SPKIException
subj_obj - the subj-obj.Subject(SExpression),
SubjObjfinal int getSubjObjsLength()
Subject(int,Sexp,Object[]),
Tuple.SUnion(Subject,Subject),
Tuple.tEliminate(Subject)final Object[] getSubjObjs()
Subject(int,Sexp,Object[]),
Tuple.SUnion(Subject,Subject),
Tuple.tEliminate(Subject)
private void setThreshold(int thresh,
Sexp thresh_scheme)
throws IllegalStateException,
SPKIException
thresh - the threshold value, ignored if < MIN_THRESHOLD.thresh_scheme - the threshold scheme-id, ignored of
threshold value is ignored.Subject(SExpression),
Subject(int,Sexp,SubjObj),
Subject(int,Sexp,Object[]),
MIN_THRESHOLD
private static void rSubjObjs2SExpression(SList list,
Object[] objs)
throws SPKIException
Subject(int,Sexp,Object[]),
toSExpression()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||