|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openpermis.policy.bean.basic.BasicPart
org.openpermis.policy.bean.basic.BasicPartBean
org.openpermis.policy.bean.basic.BasicTargetAccessRule
public class BasicTargetAccessRule
A target access rule defines a set of roles that are allowed to access a target.
Field Summary | |
---|---|
private Predicate |
condition
The condition of this access rule. |
private ObligationBeanCollection |
obligations
The obligations of this rule. |
private RoleCollection |
roles
The roles to which this rule grants access. |
private static long |
serialVersionUID
|
private TargetBeanCollection |
targets
The targets of this access rule. |
Constructor Summary | |
---|---|
protected |
BasicTargetAccessRule(SerialNumber serialNumber,
TargetBeanCollection targets,
Collection<Role> roles)
Creates a target access rule. |
protected |
BasicTargetAccessRule(SerialNumber serialNumber,
TargetBeanCollection targets,
Collection<Role> roles,
Predicate condition,
ObligationBeanCollection obligations)
Creates a target access rule. |
Method Summary | |
---|---|
protected void |
appendPartDetails(StringBuilder sb)
Appends the details of this extended part for the string representation of this part. |
protected boolean |
comparablePart(BasicPart part)
Check if the part specified is comparable to this part. |
protected boolean |
equalPart(BasicPart part)
Compares another part to this part. |
AuthorizedRoles |
findAuthorizedRoleSet(URI resourceUri,
String actionName,
List<?> arguments,
TimeStamp timeStamp)
Returns an authorized role set containing the set of roles that are needed to execute an action on a target by this rule using the clock, and the obligations for this set of roles. |
PartBean |
findBySerialNumber(SerialNumber partSerialNumber)
Returns the part bean corresponding to the specified serial number. The basic implementation returns this bean if its serial number matches the one passed in or null if not. |
Predicate |
getCondition()
Returns the condition of this access rule. |
ObligationBeanCollection |
getObligations()
Returns the obligations of this rule. |
RoleCollection |
getRoles()
Returns the roles to which this rule grants access. |
protected String |
getSimpleClassName()
Returns the simple implementation class name of this class. |
TargetBeanCollection |
getTargets()
Returns the targets of this access rule. |
private boolean |
isConditionMatchable()
Check for each action of all targets of this rule that they are matchable and won't throw a runtime exception. |
boolean |
isPartValid(PartProblemReporter reporter)
Checks if the extended state of this part is valid. |
protected int |
partHashCode()
Returns the hash code of the extended part state. |
void |
removeObligation(ObligationBean part)
Removes a obligation child element. |
void |
removeTarget(TargetBean part)
Removes a target child element. |
void |
setCondition(Predicate condition)
Sets the condition of this access rule. |
void |
setObligations(ObligationBeanCollection obligations)
Sets the obligations of this rule. |
void |
setRoles(RoleCollection roles)
Sets the roles to which this rule grants access. |
void |
setTargets(TargetBeanCollection targets)
Sets the targets of this access rule. |
Methods inherited from class org.openpermis.policy.bean.basic.BasicPartBean |
---|
addPropertyChangeListener, equalSerialNumber, firePropertyChange, getPartBeanType, getSerialNumber, getSerialNumberString, notifyIdentityChange, notifyNameChange, removePropertyChangeListener, toShortString |
Methods inherited from class org.openpermis.policy.bean.basic.BasicPart |
---|
appendDetails, equals, getIdentity, getName, hashCode, hasPartIdentity, hasPartName, isChildCollectionValid, isChildNotNull, isChildNullOrValid, isChildValid, isIdentityValid, isNameValid, isValid, reportProblem, setIdentity, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.openpermis.policy.Part |
---|
equals, hashCode, isValid, toString |
Methods inherited from interface org.openpermis.policy.bean.PartBean |
---|
addPropertyChangeListener, equalSerialNumber, getPartBeanType, getSerialNumber, removePropertyChangeListener, toShortString |
Methods inherited from interface org.openpermis.policy.Part |
---|
equals, hashCode, isValid, toString |
Field Detail |
---|
private static final long serialVersionUID
-3795054107954794737L
private TargetBeanCollection targets
private RoleCollection roles
private Predicate condition
private ObligationBeanCollection obligations
Constructor Detail |
---|
protected BasicTargetAccessRule(SerialNumber serialNumber, TargetBeanCollection targets, Collection<Role> roles)
serialNumber
- the serial number of this part.targets
- a TargetBeanCollection
to which this rule grants access.roles
- a Collection
of Role
s that are granted access.protected BasicTargetAccessRule(SerialNumber serialNumber, TargetBeanCollection targets, Collection<Role> roles, Predicate condition, ObligationBeanCollection obligations)
serialNumber
- the serial number of this part.targets
- a TargetBeanCollection
to which this rule grants access.roles
- a Collection
of Role
s that are granted access.condition
- a Predicate
of this rule.obligations
- an ObligationBeanCollection
.Method Detail |
---|
public AuthorizedRoles findAuthorizedRoleSet(URI resourceUri, String actionName, List<?> arguments, TimeStamp timeStamp)
TargetAccessRule
findAuthorizedRoleSet
in interface TargetAccessRule
resourceUri
- an URI
to identify a resource.actionName
- the name of an action.arguments
- an optional list of arguments for the action.timeStamp
- a TimeStamp
to determine the temporal time context.
AuthorizedRoles
containing the set of authorized roles and the set of
obligations if exists, null
otherwise.public TargetBeanCollection getTargets()
TargetAccessRuleBean
getTargets
in interface TargetAccessRuleBean
public void setTargets(TargetBeanCollection targets)
TargetAccessRuleBean
setTargets
in interface TargetAccessRuleBean
targets
- the new targets of this access rule.public Predicate getCondition()
TargetAccessRuleBean
getCondition
in interface TargetAccessRuleBean
Predicate
the condition of this access rule.public void setCondition(Predicate condition)
TargetAccessRuleBean
setCondition
in interface TargetAccessRuleBean
condition
- a Predicate
.public RoleCollection getRoles()
TargetAccessRuleBean
getRoles
in interface TargetAccessRuleBean
public void setRoles(RoleCollection roles)
TargetAccessRuleBean
setRoles
in interface TargetAccessRuleBean
roles
- the new roles to which this rule grants access.public ObligationBeanCollection getObligations()
TargetAccessRuleBean
getObligations
in interface TargetAccessRuleBean
public void setObligations(ObligationBeanCollection obligations)
TargetAccessRuleBean
setObligations
in interface TargetAccessRuleBean
obligations
- the new obligations of this rule.public void removeTarget(TargetBean part)
removeTarget
in interface TargetAccessRuleBean
part
- a TargetBean
.public void removeObligation(ObligationBean part)
removeObligation
in interface TargetAccessRuleBean
part
- a ObligationBean
.public boolean isPartValid(PartProblemReporter reporter)
BasicPart
isPartValid
in class BasicPart
reporter
- the problem reporter to use, may be null
.BasicPart
,
Part.isValid(PartProblemReporter)
,
BasicPart.reportProblem(org.openpermis.policy.PartProblemReporter, org.openpermis.policy.PartProblemReporter.ProblemMessage, java.lang.Object...)
private boolean isConditionMatchable()
true
if predicate is matchable.protected boolean comparablePart(BasicPart part)
BasicPart
comparablePart
in class BasicPart
part
- the part to check.
true
if the part supplied is comparable to this part.BasicPart
protected boolean equalPart(BasicPart part)
BasicPart
equalPart
in class BasicPart
part
- the part to compare to this part.
true
if the part supplied is considered equivalent to this part.BasicUtilities.equalObjects(Object, Object)
,
BasicPart
protected int partHashCode()
BasicPart
partHashCode
in class BasicPart
BasicPart
,
BasicUtilities.multiHashCode(int...)
protected String getSimpleClassName()
BasicPart
If your implementation represents an interface implementation return the interface
simple class name here. In short: return the instance you are checking against in
BasicPart.comparablePart(BasicPart)
.
getSimpleClassName
in class BasicPart
protected void appendPartDetails(StringBuilder sb)
BasicPart
appendPartDetails
in class BasicPart
sb
- the string builder to add the details to.BasicPart
,
BasicPart.appendDetails(StringBuilder, String, Object)
public PartBean findBySerialNumber(SerialNumber partSerialNumber)
BasicPartBean
If the part bean contains other part beans, it searches its child beans recursively.
The basic implementation returns this bean if its serial number matches
the one passed in or null
if not. Subclasses that contain other
parts must traverse their children.
findBySerialNumber
in interface PartBean
findBySerialNumber
in class BasicPartBean
partSerialNumber
- the SerialNumber
of the part bean to return.
PartBean
or null
if no
matching part bean is found.
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:14:59
Copyright (c) 2002-2007 Ergon Informatik AG