public class AlertPermission extends Permission
AlertPermission
has a target string which controls the principal
names where alerts can be sent. A wildcard is allowed at the end of the
target string, to allow sending alerts to any principal with a name matching
the given prefix. The "*" target means that alerts can be sent to
any destination.
Constructor and Description |
---|
AlertPermission(String target)
Creates a new
AlertPermission object with its name set to the
target string. |
AlertPermission(String target,
String actions)
Creates a new
AlertPermission object using the 'canonical' two
argument constructor. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Checks whether the given object is equal to this AlertPermission
instance.
|
String |
getActions()
Returns the action list (always
* in the current version). |
int |
hashCode()
Returns the hash code for this permission object.
|
boolean |
implies(Permission p)
Checks if this AlertPermission object implies the specified permission.
|
PermissionCollection |
newPermissionCollection()
Returns a new PermissionCollection object for storing AlertPermission
objects.
|
checkGuard, getName, toString
public AlertPermission(String target)
AlertPermission
object with its name set to the
target string. Name must be non-null and non-empty.target
- the name of a principal, can end with *
to match
any principal identifier with the given prefixNullPointerException
- if name
is null
IllegalArgumentException
- if name
is emptypublic AlertPermission(String target, String actions)
AlertPermission
object using the 'canonical' two
argument constructor. In this version this class does not define any
actions, the second argument of this constructor must be "*" so that this
class can later be extended in a backward compatible way.target
- the name of the server, can end with *
to match any
server identifier with the given prefixactions
- no actions defined, must be "*" for forward compatibilityNullPointerException
- if name
or actions
is
null
IllegalArgumentException
- if name
is empty or
actions
is not "*"public boolean equals(Object obj)
equals
in class Permission
obj
- the object to compare to this AlertPermission instancetrue
if the parameter represents the same permissions as
this instancepublic String getActions()
*
in the current version).getActions
in class Permission
public int hashCode()
equals(Object)
method, then
calling this method on each of the two AlertPermission objects must
produce the same integer result.hashCode
in class Permission
public boolean implies(Permission p)
implies
in class Permission
p
- the permission to check for implicationpublic PermissionCollection newPermissionCollection()
newPermissionCollection
in class Permission
Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0