com.day.cq.security.util
Class ActionSet

java.lang.Object
  extended by com.day.cq.security.util.ActionSet
All Implemented Interfaces:
com.day.crx.security.ActionSet

public class ActionSet
extends Object
implements com.day.crx.security.ActionSet

This action set implementation uses a bitwise representation of the individual actions. The action 'bits' are stored within a integer, thus limits the set to 32 different actions.


Field Summary
static int ACTION_ACL_MODIFY
           
static int ACTION_ACL_READ
           
static int ACTION_ADD_NODE
           
static String[] ACTION_NAMES
           
static int ACTION_READ
           
static int ACTION_REMOVE
           
static int ACTION_SET_PROPERTY
           
static int ACTION_SUDO
           
static int ACTION_WORKSPACE_ACCESS
           
static ActionSet ALL
          all action set
protected static String[] BIT_INDEX
          Build an index bits to name for conversion
protected static ActionSet[] CACHED_SETS
          cached action sets commonly used in crx
protected static Map<String,Integer> NAME_INDEX
          Build an index name to bit for conversion
static ActionSet NONE
          the empty action set
static ActionSet READ
          the 'read' action set
static ActionSet SUDO
          the 'sudo' action set
static ActionSet WORKSPACE_ACCESS
          the 'workspace_access' action set
static ActionSet WRITE
          the 'read' action set
 
Fields inherited from interface com.day.crx.security.ActionSet
ACTION_NAME_ACL_MODIFY, ACTION_NAME_ACL_READ, ACTION_NAME_ADD_NODE, ACTION_NAME_READ, ACTION_NAME_REMOVE, ACTION_NAME_SET_PROPERTY, ACTION_NAME_SUDO, ACTION_NAME_WORKSPACE_ACCESS, CVS_ID
 
Method Summary
 boolean contains(String action)
          
static ActionSet create(String[] actionNames)
          Creates a new ActionSet
 com.day.crx.security.ActionSet diff(com.day.crx.security.ActionSet other)
          
 boolean equals(Object obj)
          A set is considered equal if the set Actions are the same if (this.getActions() == other.getActions()) this.equals(other)
 String[] getActions()
          
static int getBitsForNames(String[] actionNames)
           
 int hashCode()
          calculate the hash-code based on the actions contained
 boolean includes(com.day.crx.security.ActionSet other)
          
 com.day.crx.security.ActionSet intersect(com.day.crx.security.ActionSet other)
          
 boolean intersects(com.day.crx.security.ActionSet other)
          
 boolean isEmpty()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_READ

public static final int ACTION_READ
See Also:
Constant Field Values

ACTION_SET_PROPERTY

public static final int ACTION_SET_PROPERTY
See Also:
Constant Field Values

ACTION_ADD_NODE

public static final int ACTION_ADD_NODE
See Also:
Constant Field Values

ACTION_REMOVE

public static final int ACTION_REMOVE
See Also:
Constant Field Values

ACTION_ACL_READ

public static final int ACTION_ACL_READ
See Also:
Constant Field Values

ACTION_ACL_MODIFY

public static final int ACTION_ACL_MODIFY
See Also:
Constant Field Values

ACTION_WORKSPACE_ACCESS

public static final int ACTION_WORKSPACE_ACCESS
See Also:
Constant Field Values

ACTION_SUDO

public static final int ACTION_SUDO
See Also:
Constant Field Values

ACTION_NAMES

public static final String[] ACTION_NAMES

BIT_INDEX

protected static String[] BIT_INDEX
Build an index bits to name for conversion


NAME_INDEX

protected static Map<String,Integer> NAME_INDEX
Build an index name to bit for conversion


CACHED_SETS

protected static ActionSet[] CACHED_SETS
cached action sets commonly used in crx


NONE

public static final ActionSet NONE
the empty action set


READ

public static final ActionSet READ
the 'read' action set


WRITE

public static final ActionSet WRITE
the 'read' action set


ALL

public static final ActionSet ALL
all action set


WORKSPACE_ACCESS

public static final ActionSet WORKSPACE_ACCESS
the 'workspace_access' action set


SUDO

public static final ActionSet SUDO
the 'sudo' action set

Method Detail

create

public static ActionSet create(String[] actionNames)
Creates a new ActionSet

Parameters:
actionNames - to be contained in this Set
Returns:
Set created for the given actionNames

intersects

public boolean intersects(com.day.crx.security.ActionSet other)

Specified by:
intersects in interface com.day.crx.security.ActionSet

includes

public boolean includes(com.day.crx.security.ActionSet other)

Specified by:
includes in interface com.day.crx.security.ActionSet

intersect

public com.day.crx.security.ActionSet intersect(com.day.crx.security.ActionSet other)

Specified by:
intersect in interface com.day.crx.security.ActionSet

diff

public com.day.crx.security.ActionSet diff(com.day.crx.security.ActionSet other)

Specified by:
diff in interface com.day.crx.security.ActionSet

getActions

public String[] getActions()

Specified by:
getActions in interface com.day.crx.security.ActionSet

contains

public boolean contains(String action)

Specified by:
contains in interface com.day.crx.security.ActionSet

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface com.day.crx.security.ActionSet

getBitsForNames

public static int getBitsForNames(String[] actionNames)
Parameters:
actionNames - to get the bit representation for
Returns:
bit representing the Action

hashCode

public int hashCode()
calculate the hash-code based on the actions contained

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.
See Also:
Object.equals(Object), Hashtable

equals

public boolean equals(Object obj)
A set is considered equal if the set Actions are the same if (this.getActions() == other.getActions()) this.equals(other)

Overrides:
equals in class Object


Copyright © 2008 Day Management AG. All Rights Reserved.