org.objectweb.jac.aspects.user
Class Rule

java.lang.Object
  extended byorg.objectweb.jac.aspects.user.Rule

public class Rule
extends Object

Rules for profiles : allow/deny reading, allow/deny writing, etc ...

See Also:
Profile, UserAC

Field Summary
static boolean ALLOW
           
static boolean DENY
           
 
Constructor Summary
Rule(boolean allow, String resourceExpression)
           
 
Method Summary
 boolean getAllow()
          Get rule mode (allow or deny).
protected  gnu.regexp.RE getRegexp()
          Returns a regular expression object for the resource expression.
 String getResourceExpression()
           
protected  void invalidateCache()
          Invalidates the UserAC.controlAttribute's cache.
 boolean match(MetaItem item)
          Tells if a MetaItem matches the rule.
 void setAllow(boolean allow)
          Set rule mode (allow or deny).
 void setResourceExpression(String resourceExpression)
          Set regular expression indicating which fields to apply rule for.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALLOW

public static final boolean ALLOW
See Also:
Constant Field Values

DENY

public static final boolean DENY
See Also:
Constant Field Values
Constructor Detail

Rule

public Rule(boolean allow,
            String resourceExpression)
Parameters:
allow - if true : allowing rule, if false : denying rule
resourceExpression - regular expression indicating which fields or methods this rule aplies to.
Method Detail

getAllow

public boolean getAllow()
Get rule mode (allow or deny).

Returns:
the rule's mode.

setAllow

public void setAllow(boolean allow)
Set rule mode (allow or deny).

Parameters:
allow - mode (true for allow, false for deny).

setResourceExpression

public void setResourceExpression(String resourceExpression)
Set regular expression indicating which fields to apply rule for.

Parameters:
resourceExpression - the regular expression.

getResourceExpression

public String getResourceExpression()

getRegexp

protected gnu.regexp.RE getRegexp()
Returns a regular expression object for the resource expression.


match

public boolean match(MetaItem item)
Tells if a MetaItem matches the rule.

Parameters:
item - the MetaItem

invalidateCache

protected void invalidateCache()
Invalidates the UserAC.controlAttribute's cache.

It merely calls invalidateCache() on UserAC.

See Also:
UserAC.controlAttribute(Object,MetaItem,String,Object), UserAC.invalidateCache()