IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.security
Class ObjectGridPermission

java.lang.Object
  extended by java.security.Permission
      extended by com.ibm.websphere.objectgrid.security.ObjectGridPermission
All Implemented Interfaces:
Serializable, Guard

public final class ObjectGridPermission
extends Permission

This class represents permissions to the ObjectGrid. It has two different actions:

Since:
WAS XD 6.1
See Also:
Permission, ObjectGrid, Serialized Form

Field Summary
static int ALL
          All permission constant
static String ALL_PERMISSION
          All permissions String
static int DYNAMIC_MAP
          Dynamic map permission constant
static int NUMBER_PERMISSION
          The total number of possible Permissions
static String[] PERMISSIONS
          An array with the string representation of each permission.
static int QUERY
          Query permission constant
 
Constructor Summary
ObjectGridPermission(String name, int actions)
          Constructs a new ObjectPermission for the named ObjectGrid with the specified actions.
ObjectGridPermission(String name, String actions)
          Constructs a new ObjectPermission for the named ObjectGrid with the specified actions.
 
Method Summary
 boolean equals(Object o)
          Checks two ObjectGridPermission objects for equality.
 String getActions()
          Returns the actions as a String.
static String getActions(int m)
          Returns the actions as a String for the specified mask.
 int getActionsInInt()
          Returns an int mask value which represents the permission's actions.
 int hashCode()
          Returns the hash code value for this ObjectGridPermission object.
 boolean implies(Permission permission)
          Checks if the specified permission is "implied" by this object.
 
Methods inherited from class java.security.Permission
checkGuard, getName, newPermissionCollection, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERY

public static final int QUERY
Query permission constant

See Also:
Constant Field Values

DYNAMIC_MAP

public static final int DYNAMIC_MAP
Dynamic map permission constant

See Also:
Constant Field Values

PERMISSIONS

public static final String[] PERMISSIONS
An array with the string representation of each permission.

The indexes to the String representation are the int constants for each permission (i.e. QUERY, DYNAMIC_MAP)


ALL_PERMISSION

public static final String ALL_PERMISSION
All permissions String

See Also:
Constant Field Values

ALL

public static final int ALL
All permission constant

See Also:
Constant Field Values

NUMBER_PERMISSION

public static final int NUMBER_PERMISSION
The total number of possible Permissions

See Also:
Constant Field Values
Constructor Detail

ObjectGridPermission

public ObjectGridPermission(String name,
                            String actions)
Constructs a new ObjectPermission for the named ObjectGrid with the specified actions.

The ObjectGrid name for this permission should be in the format of , for example "og1". A special value of "*" is used to represent all objectgrids, for example "*".

Parameters:
name - the ObjectGrid name.
actions - the comma separated list of actions, such as "query", and "dynamicmap".
Throws:
IllegalArgumentException - if name is null or malformed or if actions is null or contains an invalidate action name

ObjectGridPermission

public ObjectGridPermission(String name,
                            int actions)
Constructs a new ObjectPermission for the named ObjectGrid with the specified actions.

The ObjectGrid name for this permission should be in the format of , for example "og1". A special value of "*" is used to represent all objectgrids, for example "*".

Parameters:
name - the ObjectGrid name
actions - the actions mask. For example, ObjectGridPermission.QUERY|ObjectGridPermission.DYNAMIC_MAP
Throws:
IllegalArgumentException - if name is null or malformed or if actions is less than 0 or greater than ALL
Method Detail

implies

public boolean implies(Permission permission)
Checks if the specified permission is "implied" by this object.

More specifically, this method returns true if:

Specified by:
implies in class Permission
Parameters:
permission - the permission to check against.
Returns:
true if the passed permission is equal to or implied by this permission, false otherwise.

equals

public boolean equals(Object o)
Checks two ObjectGridPermission objects for equality. Two ObjectGridPermission objects are equal if and only if their names and actions are equal.

Do not use the equals method for making access control decisions; use the implies method.

Specified by:
equals in class Permission
Parameters:
o - the object we are testing for equality with this object.
Returns:
true if both ObjectGridPermission objects are equivalent.

hashCode

public int hashCode()
Returns the hash code value for this ObjectGridPermission object.

Specified by:
hashCode in class Permission
Returns:
a hash code value for this object.

getActions

public String getActions()
Returns the actions as a String.

Specified by:
getActions in class Permission
Returns:
the actions of this Permission.

getActions

public static String getActions(int m)
Returns the actions as a String for the specified mask.

Parameters:
m - the mask
Returns:
the action string representation for the mask

getActionsInInt

public int getActionsInInt()
Returns an int mask value which represents the permission's actions.

For example, for a ObjectGridPermission which has "query" and "dynamicmap" permissions, the returned value will be 3 (ObjectGridPermission.QUERY|ObjectGridPermission.DYNAMIC_MAP).

Returns:
an int value which represents the permission.

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.