jawiro
Class RoleChecker

java.lang.Object
  extended by jawiro.RoleChecker
All Implemented Interfaces:
java.io.Serializable, jawiro.ConstraintStrategy

public class RoleChecker
extends java.lang.Object
implements jawiro.ConstraintStrategy, java.io.Serializable

A simple constraint manager class. Such classes implement the ConstraintStrategy interface and enforce the domain-specific rules to prevent role binding anomalies.


Constructor Summary
RoleChecker()
          The default constructor.
 
Method Summary
 void addRuleForAddingRoles(java.lang.String parent, java.lang.String child, boolean allow)
          Adds a rule for adding roles.
 void addRuleForResigningRoles(java.lang.String parent, java.lang.String child, boolean allow)
          Adds a rule for resigning roles.
 void addRuleForResumingRoles(java.lang.String parent, java.lang.String child, boolean allow)
          Adds a rule for resuming roles.
 void addRuleForSuspendingRoles(java.lang.String parent, java.lang.String child, boolean allow)
          Adds a rule for suspending roles.
 void allowUnlistedAdding(boolean allow)
          Determines whether role adding operations uncovered by the available rules are allowed or not.
 void allowUnlistedResigning(boolean allow)
          Determines whether role resigning operations uncovered by the available rules are allowed or not.
 void allowUnlistedResuming(boolean allow)
          Determines whether role resuming operations uncovered by the available rules are allowed or not.
 void allowUnlistedRules(boolean allow)
          Determines whether any kind of operation uncovered by the available rules are allowed or not.
 void allowUnlistedSuspending(boolean allow)
          Determines whether role suspending operations uncovered by the available rules are allowed or not.
 boolean approveAddRole(java.lang.String parent, java.lang.String child)
           
 boolean approveResign(java.lang.String parent, java.lang.String child)
           
 boolean approveResume(java.lang.String parent, java.lang.String child)
           
 boolean approveSuspend(java.lang.String parent, java.lang.String child)
           
 void deleteRuleForAddingRoles(java.lang.String parent, java.lang.String child)
          Removes a rule for adding roles.
 void deleteRuleForResigningRoles(java.lang.String parent, java.lang.String child)
          Removes a rule for resigning roles.
 void deleteRuleForResumingRoles(java.lang.String parent, java.lang.String child)
          Removes a rule for resuming roles.
 void deleteRuleForSuspendingRoles(java.lang.String parent, java.lang.String child)
          Removes a rule for suspending roles.
 void setActor(jawiro.Actor anActor)
          Obtain the root of the role hierarchy which is to be managed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoleChecker

public RoleChecker()
The default constructor. It allows all operations ungoverned by the available rules.

Method Detail

allowUnlistedRules

public void allowUnlistedRules(boolean allow)
Determines whether any kind of operation uncovered by the available rules are allowed or not.

Parameters:
allow - true if the operations are allowed

allowUnlistedAdding

public void allowUnlistedAdding(boolean allow)
Determines whether role adding operations uncovered by the available rules are allowed or not.

Parameters:
allow - true if the operations are allowed

allowUnlistedResigning

public void allowUnlistedResigning(boolean allow)
Determines whether role resigning operations uncovered by the available rules are allowed or not.

Parameters:
allow - true if the operations are allowed

allowUnlistedSuspending

public void allowUnlistedSuspending(boolean allow)
Determines whether role suspending operations uncovered by the available rules are allowed or not.

Parameters:
allow - true if the operations are allowed

allowUnlistedResuming

public void allowUnlistedResuming(boolean allow)
Determines whether role resuming operations uncovered by the available rules are allowed or not.

Parameters:
allow - true if the operations are allowed

approveAddRole

public boolean approveAddRole(java.lang.String parent,
                              java.lang.String child)
Specified by:
approveAddRole in interface jawiro.ConstraintStrategy
See Also:
ConstraintStrategy.approveAddRole(java.lang.String, java.lang.String)

addRuleForAddingRoles

public void addRuleForAddingRoles(java.lang.String parent,
                                  java.lang.String child,
                                  boolean allow)
Adds a rule for adding roles.

Parameters:
parent - Type name of the object which will play the role instance to be added.
child - Type name of the role instance which is to be played by an owner.
allow -

deleteRuleForAddingRoles

public void deleteRuleForAddingRoles(java.lang.String parent,
                                     java.lang.String child)
Removes a rule for adding roles.

Parameters:
parent - Type name of the object which will play the role instance to be added.
child - Type name of the role instance which is to be played by an owner.

approveResign

public boolean approveResign(java.lang.String parent,
                             java.lang.String child)
Specified by:
approveResign in interface jawiro.ConstraintStrategy
See Also:
ConstraintStrategy.approveResign(java.lang.String, java.lang.String)

addRuleForResigningRoles

public void addRuleForResigningRoles(java.lang.String parent,
                                     java.lang.String child,
                                     boolean allow)
Adds a rule for resigning roles.

Parameters:
parent - Type name of the object which plays the role to be resigned.
child - Type name of the role instance which is to be resigned.

deleteRuleForResigningRoles

public void deleteRuleForResigningRoles(java.lang.String parent,
                                        java.lang.String child)
Removes a rule for resigning roles.

Parameters:
parent - Type name of the object which plays the role to be resigned.
child - Type name of the role instance which is to be resigned.

approveSuspend

public boolean approveSuspend(java.lang.String parent,
                              java.lang.String child)
Specified by:
approveSuspend in interface jawiro.ConstraintStrategy
See Also:
ConstraintStrategy.approveSuspend(java.lang.String, java.lang.String)

addRuleForSuspendingRoles

public void addRuleForSuspendingRoles(java.lang.String parent,
                                      java.lang.String child,
                                      boolean allow)
Adds a rule for suspending roles.

Parameters:
parent - Type name of the object which plays the role to be suspended.
child - Type name of the role instance which is to be suspended.

deleteRuleForSuspendingRoles

public void deleteRuleForSuspendingRoles(java.lang.String parent,
                                         java.lang.String child)
Removes a rule for suspending roles.

Parameters:
parent - Type name of the object which plays the role to be suspended.
child - Type name of the role instance which is to be suspended.

approveResume

public boolean approveResume(java.lang.String parent,
                             java.lang.String child)
Specified by:
approveResume in interface jawiro.ConstraintStrategy
See Also:
ConstraintStrategy.approveResume(java.lang.String, java.lang.String)

addRuleForResumingRoles

public void addRuleForResumingRoles(java.lang.String parent,
                                    java.lang.String child,
                                    boolean allow)
Adds a rule for resuming roles.

Parameters:
parent - Type name of the object which was playing the role to be resumed.
child - Type name of the role instance which is to be resumed.

deleteRuleForResumingRoles

public void deleteRuleForResumingRoles(java.lang.String parent,
                                       java.lang.String child)
Removes a rule for resuming roles.

Parameters:
parent - Type name of the object which was playing the role to be resumed.
child - Type name of the role instance which is to be resumed.

setActor

public void setActor(jawiro.Actor anActor)
Obtain the root of the role hierarchy which is to be managed.

Specified by:
setActor in interface jawiro.ConstraintStrategy
Parameters:
anActor - The root of the hierarchy to be managed.