IBM WebSphere Extended Deployment (XD)TM, Release 6.1
ObjectGrid API Specification

com.ibm.websphere.objectgrid.security
Class AgentPermission

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

public final class AgentPermission
extends java.security.Permission

This class represents permissions to the datagrid agents.

The name of the agent permission is the full map name. A full Map name is a concatenation of the ObjectGrid name, a period, and then the Map name. For example, if the object grid name is "myobjectgrid" and the map name is "mymap", then the full map name used in the permission is "myobjectgrid.mymap".

The action of the permission is a "," delimited string of agent implementation class names or package names. For example, if your agent implementation class name is "com.acme.agent.EntryAgentImpl", then the agent with implementation class com.acme.agent.EntryAgentImpl is authorized. If the permission action is "com.acme.agent.*", then all agents with implemention class belonging to the com.acme.agent package are authorized. You can use "," to separate classes or packages in the action string, for example, "com.acme.agent.EntryAgentImpl,com.acme.agent2.*".

Wildcards can be used in map name with some restrictions. A wild card "*" can be used to replace the map name or the object grid name, but not partially. For example, "myObjectGrid.*", "*.myMap", and "*.*" are valid names, but "myObject*.*" is not valid.

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

Constructor Summary
AgentPermission(java.lang.String name, java.lang.String actions)
          Constructs a new AgentPermission for the named map with the specified actions.
 
Method Summary
 boolean equals(java.lang.Object o)
          Checks two AgentPermission objects for equality.
 java.lang.String getActions()
          Returns the actions as a String.
 java.lang.String[] getParsedNames()
          Returns an array which contains the ObjectGrid name and map name.
 int hashCode()
          Returns the hash code value for this AgentPermission object.
 boolean implies(java.security.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
 

Constructor Detail

AgentPermission

public AgentPermission(java.lang.String name,
                       java.lang.String actions)
Constructs a new AgentPermission for the named map with the specified actions.

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

Parameters:
name - the map name.
actions - the comma separated list of agent classes or packages, such as "com.acme.EntryAgentImpl,com.acme.ReduceAgentImpl,com.acme.actions.*".
Throws:
java.lang.IllegalArgumentException - if name is null or malformed or if actions is null.
Method Detail

implies

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

More specifically, this method returns true if:

Specified by:
implies in class java.security.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(java.lang.Object o)
Checks two AgentPermission objects for equality. Two AgementPermission objects are equal if and only if their names and actions are all equal.

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

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

hashCode

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

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

getActions

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

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

getParsedNames

public java.lang.String[] getParsedNames()
Returns an array which contains the ObjectGrid name and map name.

Returns:
the parsed name array

IBM WebSphere Extended Deployment (XD)TM, Release 6.1
ObjectGrid API Specification

© Copyright International Business Machines Corp 2005-2007. All rights reserved.