Class MonitorPermission
- All Implemented Interfaces:
Serializable
,Guard
StatusVariable
s, to switch event sending on or off or to start
monitoring jobs. The target of the permission is the identifier of the
StatusVariable
, the action can be read
,
publish
, reset
, startjob
,
switchevents
, or the combination of these separated by commas.
Action names are interpreted case-insensitively, but the canonical action
string returned by getActions()
uses the forms defined by the action
constants.
If the wildcard *
appears in the actions field, all legal
monitoring commands are allowed on the designated target(s) by the owner of
the permission.
- Version:
- $Revision: 7941 $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Holders ofMonitorPermission
with thepublish
action present areMonitorable
services that are allowed to publish theStatusVariable
s specified in the permission's target field.static final String
Holders ofMonitorPermission
with theread
action present are allowed to read the value of theStatusVariable
s specified in the permission's target field.static final String
Holders ofMonitorPermission
with thereset
action present are allowed to reset the value of theStatusVariable
s specified in the permission's target field.static final String
Holders ofMonitorPermission
with thestartjob
action present are allowed to initiate monitoring jobs involving theStatusVariable
s specified in the permission's target field.static final String
Holders ofMonitorPermission
with theswitchevents
action present are allowed to switch event sending on or off for the value of theStatusVariable
s specified in the permission's target field. -
Constructor Summary
ConstructorsConstructorDescriptionMonitorPermission
(String statusVariable, String actions) Create aMonitorPermission
object, specifying the target and actions. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines the equality of twoMonitorPermission
objects.Get the action string associated with this permission.int
hashCode()
Create an integer hash of the object.boolean
Determines if the specified permission is implied by this permission.Methods inherited from class java.security.Permission
checkGuard, getName, newPermissionCollection, toString
-
Field Details
-
READ
Holders ofMonitorPermission
with theread
action present are allowed to read the value of theStatusVariable
s specified in the permission's target field.- See Also:
-
RESET
Holders ofMonitorPermission
with thereset
action present are allowed to reset the value of theStatusVariable
s specified in the permission's target field.- See Also:
-
PUBLISH
Holders ofMonitorPermission
with thepublish
action present areMonitorable
services that are allowed to publish theStatusVariable
s specified in the permission's target field. Note, that this permission cannot be enforced when aMonitorable
registers to the framework, because the Service Registry does not know about this permission. Instead, anyStatusVariable
s published by aMonitorable
without the correspondingpublish
permission are silently ignored byMonitorAdmin
, and are therefore invisible to the users of the monitoring service.- See Also:
-
STARTJOB
Holders ofMonitorPermission
with thestartjob
action present are allowed to initiate monitoring jobs involving theStatusVariable
s specified in the permission's target field.A minimal sampling interval can be optionally defined in the following form:
startjob:n
. This allows the holder of the permission to initiate time based jobs with a measurement interval of at leastn
seconds. Ifn
is not specified or 0 then the holder of this permission is allowed to start monitoring jobs specifying any frequency.- See Also:
-
SWITCHEVENTS
Holders ofMonitorPermission
with theswitchevents
action present are allowed to switch event sending on or off for the value of theStatusVariable
s specified in the permission's target field.- See Also:
-
-
Constructor Details
-
MonitorPermission
Create aMonitorPermission
object, specifying the target and actions.The
statusVariable
parameter is the target of the permission, defining one or more status variable names to which the specified actions apply. Multiple status variable names can be selected by using the wildcard*
in the target string. The wildcard is allowed in both fragments, but only at the end of the fragments.For example, the following targets are valid:
com.mycomp.myapp/queue_length
,com.mycomp.myapp/*
,com.mycomp.*/*
,*/*
,*/queue_length
,*/queue*
.The following targets are invalid:
*.myapp/queue_length
,com.*.myapp/*
,*
.The
actions
parameter specifies the allowed action(s):read
,publish
,startjob
,reset
,switchevents
, or the combination of these separated by commas. String constants are defined in this class for each valid action. Passing"*"
as the action string is equivalent to listing all actions.- Parameters:
statusVariable
- the identifier of theStatusVariable
in [Monitorable_id]/[StatusVariable_id] formatactions
- the list of allowed actions separated by commas, or*
for all actions- Throws:
IllegalArgumentException
- if either parameter isnull
, or invalid with regard to the constraints defined above and in the documentation of the used actions
-
-
Method Details
-
hashCode
public int hashCode()Create an integer hash of the object. The hash codes ofMonitorPermission
sp1
andp2
are the same ifp1.equals(p2)
.- Specified by:
hashCode
in classPermission
- Returns:
- the hash of the object
-
equals
Determines the equality of twoMonitorPermission
objects. TwoMonitorPermission
objects are equal if their target strings are equal and the same set of actions are listed in their action strings.- Specified by:
equals
in classPermission
- Parameters:
o
- the object being compared for equality with this object- Returns:
true
if the two permissions are equal
-
getActions
Get the action string associated with this permission. The actions are returned in the following order:read
,reset
,publish
,startjob
,switchevents
.- Specified by:
getActions
in classPermission
- Returns:
- the allowed actions separated by commas, cannot be
null
-
implies
Determines if the specified permission is implied by this permission.This method returns
false
if and only if at least one of the following conditions are fulfilled for the specified permission:- it is not a
MonitorPermission
- it has a broader set of actions allowed than this one
- it allows initiating time based monitoring jobs with a lower minimal sampling interval
- the target set of
Monitorable
s is not the same nor a subset of the target set ofMonitorable
s of this permission - the target set of
StatusVariable
s is not the same nor a subset of the target set ofStatusVariable
s of this permission
- Specified by:
implies
in classPermission
- Parameters:
p
- the permission to be checked- Returns:
true
if the given permission is implied by this permission
- it is not a
-