|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nbi.xmlsec.xacml.profile.rbac.RBACPolicyElement nbi.xmlsec.xacml.profile.rbac.RBACPolicy
Base class for all RBACPolicies
Field Summary | |
protected HashSet |
elements
Set of assigments administered in this role assignment policy |
(package private) static Logger |
logger
|
protected boolean |
permitRule
true sets the combining algorithm to
PermitOverridesRuleAlg ,
false to DenyOverridesRuleAlg . |
Fields inherited from class nbi.xmlsec.xacml.profile.rbac.RBACPolicyElement |
|
Constructor Summary | |
protected |
RBACPolicy()
|
|
RBACPolicy(Identifier id)
Create an RBACPolicy. |
|
RBACPolicy(URI id)
Create an RBACPolicy. |
Method Summary | |
boolean |
add(RBACPolicyElement element)
Adds an policy element to this policy. |
void |
encode(File path)
Encodes this Policy into its XML representation and writes this encoding to the file path using the path parameter as parent
directory and the identifier's file representation as file name. |
void |
encode(OutputStream out)
Encodes this Policy into its XML representation and writes this encoding to the given OutputStream with no indentation |
boolean |
equals(Object obj)
Compares the specified object with this RBAC policy. |
Set |
getElements()
Gets the set of elements of this policy. |
boolean |
isPermitRule()
Gets the default CombiningAlgorithm of this policy used within #toPolicyTreeElement() . |
void |
parse(PolicyTreeElement element)
Not implemented. |
protected void |
parse(PolicyTreeElement element,
Class ruleClass)
Default method to parse policies. |
boolean |
remove(RBACPolicyElement element)
Removes an policy element from this policy. |
RBACPolicyElement |
search(Identifier id)
Retrieves an element from this policy. |
RBACPolicyElement |
search(RBACPolicyElement element)
Retrieves an element from this policy. |
void |
setPermitRule(boolean defaultPermit)
Sets the default CombiningAlgorithm of this policy used within #toPolicyTreeElement() . |
PolicyReference |
toPolicyRerence()
Returns the PolicyReference representation of
this policy element. |
protected PolicyReference |
toPolicyRerence(int type)
Returns the PolicyReference representation of
this policy element. |
PolicyTreeElement |
toPolicyTreeElement()
Default implementation for RBACPolicies. |
protected PolicyTreeElement |
toPolicyTreeElement(CombiningAlgorithm combAlg)
Returns the Policy representation of this
RBACPolicy . |
Methods inherited from class nbi.xmlsec.xacml.profile.rbac.RBACPolicyElement |
getIdentifier, getTarget, hashCode, parse, setIdentifier, setIdentifier, setTarget, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
static Logger logger
protected HashSet elements
protected boolean permitRule
true
sets the combining algorithm to
PermitOverridesRuleAlg
,
false
to DenyOverridesRuleAlg
.
Constructor Detail |
protected RBACPolicy()
public RBACPolicy(Identifier id)
id
- Identifier of this element (domain:assignment:label).
ParsingException
- Indicates a malformed identifier representation.public RBACPolicy(URI id) throws ParsingException
id
- Identifier of this element (domain:assignment:label).
ParsingException
- Indicates a malformed identifier representation.Method Detail |
protected void parse(PolicyTreeElement element, Class ruleClass) throws ParsingException
parse(Target)
.Rule
.ruleClass
is created with the child
element as single parameter. This instance is added to the set of policy
elements. If the related class parameter is null
, then a
ParsingException
is thrown when the related
child element type is parsed.
element
- The policy (reference) to parse.ruleClass
- Class to be instantiated for child elements instances of the
(@link Policy Policy} class.
ParsingException
- If some parsing error occurs.public void parse(PolicyTreeElement element) throws ParsingException
parse
in class RBACPolicyElement
ParsingException
protected PolicyTreeElement toPolicyTreeElement(CombiningAlgorithm combAlg)
Policy
representation of this
RBACPolicy
. It generates a policy consisting of the
rule representation of all elements of this policy and the given
RuleCombiningAlgorithm
.
combAlg
- The RuleCombiningAlgorithm
of
this policy.
Policy
representation of this
RBACPolicy
.RBACPolicyElement.toPolicyTreeElement()
public PolicyTreeElement toPolicyTreeElement()
isDefaultPermit()
.
toPolicyTreeElement
in class RBACPolicyElement
Policy
representation of this
RBACPolicy
.RBACPolicyElement.toPolicyTreeElement()
protected PolicyReference toPolicyRerence(int type)
PolicyReference
representation of
this policy element.
type
- type of the policy reference (
PolicyReference.POLICYSET_REFERENCE
or
PolicyReference.POLICY_REFERENCE
).
PolicyReference
representation.public PolicyReference toPolicyRerence()
PolicyReference
representation of
this policy element. The default type of the policy reference is set to
PolicyReference.POLICY_REFERENCE
).
Overwrite this method to set another reference type.
PolicyReference
representation with type set to
PolicyReference.POLICY_REFERENCE
).public void encode(File path) throws IOException
path
parameter as parent
directory and the identifier's file representation as file name. Creates
directories if missing.
path
- Base directory path to the policies.
IOException
public void encode(OutputStream out) throws IOException
out
- a stream into which the XML-encoded data is written.
IOException
public RBACPolicyElement search(RBACPolicyElement element)
element
- The element to search for.
null
.CollectionUtil.search(Collection, Object)
public RBACPolicyElement search(Identifier id)
id
- The identifier of the element to search for.
null
.public boolean add(RBACPolicyElement element)
RBACPolicyElement.add(RBACPolicyElement)
method of the current element.
add
in class RBACPolicyElement
element
- The element to be added.
true
, if the element was succesfully added or
successfully updates an existing element, false
otherwise.public boolean remove(RBACPolicyElement element)
remove
in class RBACPolicyElement
element
- The element to remove.
true
, if the element was succesfully removed ,
false
otherwise.public boolean equals(Object obj)
equals
in class RBACPolicyElement
obj
- Object to be compared for equality with this RBACPolicy.
true
if the specified Object is equal to this
RBACPolicy.public Set getElements()
public boolean isPermitRule()
#toPolicyTreeElement()
.
true
the combining algorithm is set to
PermitOverridesRuleAlg
, if
false
it is set to
DenyOverridesRuleAlg
..public void setPermitRule(boolean defaultPermit)
#toPolicyTreeElement()
.
defaultPermit
- true
sets the combining algorithm to
PermitOverridesRuleAlg
,
false
to
DenyOverridesRuleAlg
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |