|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.security.Permission
org.apache.commons.daemon.DaemonPermission
public final class DaemonPermission
Represents the permissions to control and query the status of
a Daemon
. A DaemonPermission
consists of a
target name and a list of actions associated with it.
In this specification version the only available target name for this permission is "control", but further releases may add more target names to fine-tune the access that needs to be granted to the caller.
Actions are defined by a string of comma-separated values, as shown in the table below. The empty string implies no permission at all, while the special "*" value implies all permissions for the given name:
Target"Name | Action | Description |
---|---|---|
"control" | "start" |
The permission to call the start() method in an instance
of a DaemonController interface.
|
"stop" |
The permission to call the stop() method in an instance
of a DaemonController interface.
|
|
"shutdown" |
The permission to call the shutdown() method in an instance
of a DaemonController interface.
|
|
"reload" |
The permission to call the reload() method in an instance
of a DaemonController interface.
|
|
"*" | The special wildcard action implies all above-mentioned action. This is equal to construct a permission with the "start, stop, shutdown, reload" list of actions. |
Field Summary | |
---|---|
protected static java.lang.String |
CONTROL
The target name when associated with control actions ("control"). |
protected static java.lang.String |
CONTROL_RELOAD
The action name associated with the permission to call the DaemonController.reload() method. |
protected static java.lang.String |
CONTROL_SHUTDOWN
The action name associated with the permission to call the DaemonController.shutdown() method. |
protected static java.lang.String |
CONTROL_START
The action name associated with the permission to call the DaemonController.start() method. |
protected static java.lang.String |
CONTROL_STOP
The action name associated with the permission to call the DaemonController.stop() method. |
protected static int |
MASK_CONTROL_RELOAD
The action mask associated with the permission to call the DaemonController.reload() method. |
protected static int |
MASK_CONTROL_SHUTDOWN
The action mask associated with the permission to call the DaemonController.shutdown() method. |
protected static int |
MASK_CONTROL_START
The action mask associated with the permission to call the DaemonController.start() method. |
protected static int |
MASK_CONTROL_STOP
The action mask associated with the permission to call the DaemonController.stop() method. |
protected static int |
TYPE_CONTROL
The target type when associated with control actions. |
protected static java.lang.String |
WILDCARD
The "wildcard" action implying all actions for the given target name. |
Constructor Summary | |
---|---|
DaemonPermission(java.lang.String target)
Creates a new DaemonPermission instance with a specified
permission name. |
|
DaemonPermission(java.lang.String target,
java.lang.String actions)
Creates a new DaemonPermission instance with a specified
permission name and a specified list of actions. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object object)
Checks if a specified object equals DaemonPermission . |
java.lang.String |
getActions()
Returns the list of actions permitted by this instance of DaemonPermission in its canonical form. |
int |
hashCode()
Returns the hash code for this DaemonPermission instance. |
boolean |
implies(java.security.Permission permission)
Checks if this DaemonPermission implies another
Permission . |
java.lang.String |
toString()
Returns a String representation of this instance. |
Methods inherited from class java.security.Permission |
---|
checkGuard, getName, newPermissionCollection |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String CONTROL
protected static final int TYPE_CONTROL
protected static final java.lang.String CONTROL_START
DaemonController.start()
method.
protected static final java.lang.String CONTROL_STOP
DaemonController.stop()
method.
protected static final java.lang.String CONTROL_SHUTDOWN
DaemonController.shutdown()
method.
protected static final java.lang.String CONTROL_RELOAD
DaemonController.reload()
method.
protected static final int MASK_CONTROL_START
DaemonController.start()
method.
protected static final int MASK_CONTROL_STOP
DaemonController.stop()
method.
protected static final int MASK_CONTROL_SHUTDOWN
DaemonController.shutdown()
method.
protected static final int MASK_CONTROL_RELOAD
DaemonController.reload()
method.
protected static final java.lang.String WILDCARD
Constructor Detail |
---|
public DaemonPermission(java.lang.String target) throws java.lang.IllegalArgumentException
DaemonPermission
instance with a specified
permission name.
This constructor will create a new DaemonPermission
instance that will not grant any permission to the caller.
target
- The target name of this permission.
java.lang.IllegalArgumentException
- If the specified target name is not
supported.public DaemonPermission(java.lang.String target, java.lang.String actions) throws java.lang.IllegalArgumentException
DaemonPermission
instance with a specified
permission name and a specified list of actions.
target
- The target name of this permission.actions
- The list of actions permitted by this permission.
java.lang.IllegalArgumentException
- If the specified target name is not
supported, or the specified list of actions includes an
invalid value.Method Detail |
---|
public java.lang.String getActions()
DaemonPermission
in its canonical form.
getActions
in class java.security.Permission
public int hashCode()
DaemonPermission
instance.
hashCode
in class java.security.Permission
public boolean equals(java.lang.Object object)
DaemonPermission
.
equals
in class java.security.Permission
DaemonPermission
instance or not.public boolean implies(java.security.Permission permission)
DaemonPermission
implies another
Permission
.
implies
in class java.security.Permission
DaemonPermission
instance or
not.public java.lang.String toString()
String
representation of this instance.
toString
in class java.security.Permission
String
representing this
DaemonPermission
instance.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |