Class ClusterPermission
- All Implemented Interfaces:
Serializable
,Guard
Target name is a string containing a list of one or more comma-separated target attributes. The valid target attributes are:
- "service=<service-name>"
- "service=<service-prefix*>"
- "cache=<cache-name>"
- "cache=<cache-prefix*>"
- "*"
CacheService
(e.g. InvocationService
).
A target name string consisting of a single "*" indicates all clustered
resources.
The actions to be granted are passed to the constructor in a string
containing a list of one or more comma-separated keywords. The possible
keywords are: "create", "destroy", "join", "all".
An action string "all" indicates a combination of all valid actions.
Note: the actions string is converted to lowercase before processing.
- Since:
- Coherence 2.5
- Author:
- gg 2004.05.28
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionClusterPermission
(String sTarget, String sAction) Construct a ClusterPermission object.ClusterPermission
(String sClusterName, String sTarget, String sAction) Construct a ClusterPermission object. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks two Permission objects for equality.static String
formatAction
(int nAction) Format the action string.Return the actions as a String in a canonical form.Return the cache name for this permission object or null if the permission applies to any cache.Return the cluster name.Return the service name for this permission object or null if the permission applies to any service.int
hashCode()
Return the hash code value for this ClusterPermission object.boolean
implies
(Permission permission) Check if the specified permission's actions are "implied by" this object's actions.static void
Unit test allows to compare the specified permissions.protected void
parseAction
(String sAction) Parse the action string and set the action flag.protected void
parseTarget
(String sTarget) Parse the target string.Methods inherited from class java.security.Permission
checkGuard, getName, newPermissionCollection, toString
-
Field Details
-
CREATE
public static final int CREATECreate action.- See Also:
-
DESTROY
public static final int DESTROYCreate action.- See Also:
-
JOIN
public static final int JOINJoin action.- See Also:
-
ALL
public static final int ALLAll actions.- See Also:
-
NONE
public static final int NONENo actions.- See Also:
-
-
Constructor Details
-
ClusterPermission
Construct a ClusterPermission object.- Parameters:
sTarget
- the clustered resource name; must be specifiedsAction
- the action(s) name; must be specified
-
ClusterPermission
Construct a ClusterPermission object.- Parameters:
sClusterName
- the cluster namesTarget
- the clustered resource name; must be specifiedsAction
- the action(s) name; must be specified
-
-
Method Details
-
implies
Check if the specified permission's actions are "implied by" this object's actions.There is a slight difference in semantics of the wild card ("*") in "this" and passed-in Permission's target. The specified permission for cache-less services will not contain any "cache=" attribute in the target string, while cache services will always specify a "cache=" attribute.
- Specified by:
implies
in classPermission
- Parameters:
permission
- the permission to check against- Returns:
- true if the specified permission is implied by this object, false if not
-
equals
Checks two Permission objects for equality.- Specified by:
equals
in classPermission
- Parameters:
obj
- the object we are testing for equality with this object- Returns:
- true if both Permission objects are equivalent
-
hashCode
public int hashCode()Return the hash code value for this ClusterPermission object.- Specified by:
hashCode
in classPermission
- Returns:
- a hash code value for this object
-
getActions
Return the actions as a String in a canonical form.- Specified by:
getActions
in classPermission
- Returns:
- the actions of this Permission
-
getClusterName
Return the cluster name.- Returns:
- the cluster name
-
getServiceName
Return the service name for this permission object or null if the permission applies to any service.- Returns:
- the service name for this permission object
-
getCacheName
Return the cache name for this permission object or null if the permission applies to any cache.- Returns:
- the cache name for this permission object
-
parseTarget
Parse the target string.- Parameters:
sTarget
- the target string
-
parseAction
Parse the action string and set the action flag.- Parameters:
sAction
- the action string
-
formatAction
Format the action string.- Parameters:
nAction
- the action mask- Returns:
- the action string
-
main
Unit test allows to compare the specified permissions.java com.tangosol.net.ClusterPermission <target1> <action1> <target2> <action2>
-