org.systinet.security.perm
Class WSMonitoringPermission

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

public final class WSMonitoringPermission
extends WSManagePermission

This class is for service monitoring permissions.

The name is the name of the service. The name is required, but if you set it to "*", it is handled as a permission all services.

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 "disable", "enable", "get", "clean". The action string is optional, if it is not present, all actions are granted. Their meaning is defined as follows:

enable
allows to enable monitoring of a service
disable
allows to disable monitoring of a service
get
allows to get monitor state
clean
allows to clean monitoring log of the service

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 (disable, enable, get, clean).
static int CLEAR
          Start action.
static int DISABLE
          Disable action.
static int ENABLE
          Enable action.
static int GET
          Stop action.
 
Fields inherited from class org.systinet.security.perm.WSManagePermission
ALL_NAMES, SET
 
Constructor Summary
WSMonitoringPermission(java.lang.String name, int actionMask)
          Creates a new WSMonitoringPermission object with the specified name.
WSMonitoringPermission(java.lang.String name, java.lang.String actions)
          Creates a new WSMonitoringPermission object with the specified name.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Checks two WSMonitoringPermission 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 WSMonitoringPermission object "implies" the specified permission.
 java.security.PermissionCollection newPermissionCollection()
          Returns a new PermissionCollection object for storing WSMonitoringPermission objects.
 
Methods inherited from class org.systinet.security.perm.WSManagePermission
toString
 
Methods inherited from class java.security.Permission
checkGuard, getName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ENABLE

public static final int ENABLE
Enable action.

See Also:
Constant Field Values

DISABLE

public static final int DISABLE
Disable action.

See Also:
Constant Field Values

GET

public static final int GET
Stop action.

See Also:
Constant Field Values

CLEAR

public static final int CLEAR
Start action.

See Also:
Constant Field Values

ALL

public static final int ALL
All actions (disable, enable, get, clean).

See Also:
Constant Field Values
Constructor Detail

WSMonitoringPermission

public WSMonitoringPermission(java.lang.String name,
                              java.lang.String actions)
Creates a new WSMonitoringPermission object with the specified name. The name is the name of the service, and actions contains a comma-separated list of the desired actions granted on the service management of monitoring. Possible actions are "enable","disable","get","clean".

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

WSMonitoringPermission

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

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

implies

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

More specifically, this method returns true if:

Overrides:
implies in class WSManagePermission
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 WSMonitoringPermission objects for equality. Checks that obj is a WSMonitoringPermission, and has the same name and actions as this object.

Overrides:
equals in class WSManagePermission
Parameters:
obj - the object we are testing for equality with this object.
Returns:
true if obj is a WSMonitoringPermission, and has the same name and actions as this WSMonitoringPermission 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.

Overrides:
hashCode in class WSManagePermission
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: enable, disable, get, clean. For example, if this WSMonitoringPermission object allows both get and disable actions, a call to getActions will return the string "disable,get".

Overrides:
getActions in class WSManagePermission
Returns:
the canonical string representation of the actions.

newPermissionCollection

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

Overrides:
newPermissionCollection in class WSManagePermission
Returns:
a new PermissionCollection object suitable for storing WSMonitoringPermissions.