org.systinet.security.perm
Class WSBManagePermission

java.lang.Object
  extended byjava.security.Permission
      extended byorg.systinet.security.perm.WSBManagePermission
All Implemented Interfaces:
java.security.Guard, java.io.Serializable

public class WSBManagePermission
extends java.security.Permission

This class is a base for all WASP management permissions focused on web service bindings.

The name of this permission is application specific. The name is required, but if you set it to "*".

The actions to be granted are passed to the constructor in a string containing a list of zero or more comma-separated keywords. The possible keywords are "get", "set". The action string is optional, if it is not present, all actions are granted. Their meanings are application specific.

The actions string is converted to lowercase before processing.

Since:
4.0
See Also:
Serialized Form
Component:
Security-Specific

Field Summary
static int ALL
          All actions (get, set).
static java.lang.String ALL_NAMES
          Match string for all names("*" by default)
static int GET
          Enable action.
static int SET
          Disable action.
 
Constructor Summary
protected WSBManagePermission()
          Creates a new WSBManagePermission object with null name and null actions.
  WSBManagePermission(java.lang.String name)
          Creates a new WSVManagePermission object with the specified name.
  WSBManagePermission(java.lang.String name, int actionMask)
          Creates a new WSBManagePermission object with the specified name.
  WSBManagePermission(java.lang.String name, java.lang.String actions)
          Creates a new WSBManagePermission object with the specified name and actions.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Checks two WSBManagePermission objects for equality.
 java.lang.String getActions()
          Returns the "canonical string representation" of the actions.
 int hashCode()
          Returns the hash code value for this object.
 boolean implies(java.security.Permission p)
          Checks if this WSBManagePermission object "implies" the specified permission.
 java.security.PermissionCollection newPermissionCollection()
          Returns a new PermissionCollection object for storing WSBManagePermission objects.
 
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
 

Field Detail

ALL_NAMES

public static final java.lang.String ALL_NAMES
Match string for all names("*" by default)

See Also:
Constant Field Values

GET

public static final int GET
Enable action.

See Also:
Constant Field Values

SET

public static final int SET
Disable action.

See Also:
Constant Field Values

ALL

public static final int ALL
All actions (get, set).

See Also:
Constant Field Values
Constructor Detail

WSBManagePermission

protected WSBManagePermission()
Creates a new WSBManagePermission object with null name and null actions.


WSBManagePermission

public WSBManagePermission(java.lang.String name)
Creates a new WSVManagePermission object with the specified name. The name is the name of the service binding, and actions are implicitelly WSManagePermission.ALL.

Parameters:
name - the name of the WSManagePermission, cannot be null (, but can be ALL_NAMES).

WSBManagePermission

public WSBManagePermission(java.lang.String name,
                           java.lang.String actions)
Creates a new WSBManagePermission object with the specified name and actions. The name is application specific, and actions contains a comma-separated list of possible "get","set" tokens.

Parameters:
name - the name of the WSBManagePermission (name of the service binding), cannot be null (, but can be ALL_NAMES).
actions - the actions string, can be null or empty string , then it means "all actions possible".

WSBManagePermission

public WSBManagePermission(java.lang.String name,
                           int actionMask)
Creates a new WSBManagePermission object with the specified name. The name is the name of the service binding, and actionsNask is a or-ed flag of public static final int values present herein.

Parameters:
name - the name of the WSBManagePermission , cannot be null (, but can be ALL_NAMES).
actionMask - composed out of
Method Detail

implies

public boolean implies(java.security.Permission p)
Checks if this WSBManagePermission object "implies" the specified permission.

More specifically, this method returns true if:

Parameters:
p - the permission to check against.
Returns:
true if the specified permission is implied by this object, false if not.

equals

public boolean equals(java.lang.Object obj)
Checks two WSBManagePermission objects for equality. Checks that obj is a WSBManagePermission, and has the same name and actions as this object.

Parameters:
obj - the object we are testing for equality with this object.
Returns:
true if obj is a WSBManagePermission, and has the same name and actions as this WSBManagePermission object.

hashCode

public int hashCode()
Returns the hash code value for this object. The hash code used is the hash code of this permissions name, that is, getName().hashCode(), where getName is from the Permission superclass.

Returns:
a hash code value for this object.

getActions

public java.lang.String getActions()
Returns the "canonical string representation" of the actions. That is, this method always returns present actions in the following order: get, set. For example, if this WSBManagePermission object allows both set and get actions, a call to getActions will return the string "get,set".

Returns:
the canonical string representation of the actions.

newPermissionCollection

public java.security.PermissionCollection newPermissionCollection()
Returns a new PermissionCollection object for storing WSBManagePermission objects.

Returns:
a new PermissionCollection object suitable for storing of WSBManagePermissions.