org.norther.tammi.core.security
Class RegexPermission

java.lang.Object
  extended by java.security.Permission
      extended by org.norther.tammi.core.security.DefaultPermission
          extended by org.norther.tammi.core.security.ResourcePermission
              extended by org.norther.tammi.core.security.RegexPermission
All Implemented Interfaces:
Serializable, Guard

public class RegexPermission
extends ResourcePermission

RegexpPermission represents access to server resources. A RegexPermission consists of a regular expression and a set of actions valid for that expression. The regular expression is a pattern to be matched to the name of the resource granted the specified actions.

Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.norther.tammi.core.security.DefaultPermission
ALL, ALL_ACTION, ANY_ROLE, DELETE, DELETE_ACTION, EXECUTE, EXECUTE_ACTION, GROUP, GROUP_ACTION, NO_ACTION, NONE, OVERRIDE, OVERRIDE_ACTION, READ, READ_ACTION, READ_WRITE, READ_WRITE_ACTION, WRITE, WRITE_ACTION
 
Constructor Summary
RegexPermission(String regex, int mask)
          Constructs a new permission with a mask.
RegexPermission(String regex, int mask, int options)
          Constructs a new permission with a mask and compiler options.
RegexPermission(String regex, String actions)
          Constructs a new permission with actions.
RegexPermission(String regex, String actions, int options)
          Constructs a new permission with actions and compiler options.
 
Method Summary
 int getOptions()
          Gets the compiler options.
protected  boolean impliesIgnoreMask(ResourcePermission p)
          Checks if this permission object implies the specified permission when actions are ignored.
 
Methods inherited from class org.norther.tammi.core.security.ResourcePermission
equals, getActions, hashCode, implies, newPermissionCollection
 
Methods inherited from class org.norther.tammi.core.security.DefaultPermission
toActionMask, toActionString
 
Methods inherited from class java.security.Permission
checkGuard, getName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegexPermission

public RegexPermission(String regex,
                       String actions)
Constructs a new permission with actions.

Parameters:
regex - the regular expression of the resource.
actions - the action string.
Throws:
IllegalArgumentException - for an invalid expression.

RegexPermission

public RegexPermission(String regex,
                       String actions,
                       int options)
Constructs a new permission with actions and compiler options.

Parameters:
regex - the regular expression of the resource.
actions - the action string.
options - compiler options.
Throws:
IllegalArgumentException - for an invalid expression.

RegexPermission

public RegexPermission(String regex,
                       int mask)
Constructs a new permission with a mask.

Parameters:
regex - the regular expression of the resource.
mask - the action mask to use.
Throws:
IllegalArgumentException - for an invalid expression.

RegexPermission

public RegexPermission(String regex,
                       int mask,
                       int options)
Constructs a new permission with a mask and compiler options.

Parameters:
regex - the regular expression of the resource.
mask - the action mask to use.
options - the option mask to use.
Throws:
IllegalArgumentException - for an invalid expression.
Method Detail

getOptions

public int getOptions()
Gets the compiler options.

Returns:
the option mask.

impliesIgnoreMask

protected boolean impliesIgnoreMask(ResourcePermission p)
Checks if this permission object implies the specified permission when actions are ignored.

Overrides:
impliesIgnoreMask in class ResourcePermission
Parameters:
p - the permission to check against.
Returns:
true if the specified permission is implied by this object.


Copyright © 2004 The Norther Organization. All rights reserved.