Class ServicePermission
java.lang.Object
java.security.Permission
javax.security.auth.kerberos.ServicePermission
- All Implemented Interfaces:
Serializable, Guard
@Deprecated(since="25",
forRemoval=true)
public final class ServicePermission
extends Permission
implements Serializable
Deprecated, for removal: This API element is subject to removal in a future version.
This permission cannot be used for controlling access to resources
as the Security Manager is no longer supported.
A ServicePermission contains a service principal name and
a list of actions which specify the context the credential can be
used within.
The service principal name is the canonical name of the
KerberosPrincipal
supplying the service, that is
the KerberosPrincipal represents a Kerberos service
principal. This name is treated in a case sensitive manner.
An asterisk may appear by itself, to signify any service principal.
The possible actions are:
initiate - allow the caller to use the credential to initiate a security context with a service principal. accept - allow the caller to use the credential to accept security context as a particular principal.
- Since:
- 1.4
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionServicePermission
(String servicePrincipal, String action) Deprecated, for removal: This API element is subject to removal in a future version.Create a newServicePermission
with the specifiedservicePrincipal
andaction
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated, for removal: This API element is subject to removal in a future version.Checks two ServicePermission objects for equality.Deprecated, for removal: This API element is subject to removal in a future version.Returns the canonical string representation of the actions.int
hashCode()
Deprecated, for removal: This API element is subject to removal in a future version.Returns the hash code value for this object.boolean
Deprecated, for removal: This API element is subject to removal in a future version.Checks if this Kerberos service permission object "implies" the specified permission.Deprecated, for removal: This API element is subject to removal in a future version.Returns a PermissionCollection object for storing ServicePermission objects.Methods declared in class Permission
checkGuard, getName, toString
-
Constructor Details
-
ServicePermission
Deprecated, for removal: This API element is subject to removal in a future version.Create a newServicePermission
with the specifiedservicePrincipal
andaction
.- Parameters:
servicePrincipal
- the name of the service principal. An asterisk may appear by itself, to signify any service principal.action
- the action string
-
-
Method Details
-
implies
Deprecated, for removal: This API element is subject to removal in a future version.Checks if this Kerberos service permission object "implies" the specified permission.More specifically, this method returns true if all the following are true (and returns false if any of them are not):
- p is an instanceof
ServicePermission
, - p's actions are a proper subset of this
ServicePermission
's actions, - p's name is equal to this
ServicePermission
's name or thisServicePermission
's name is "*".
- Specified by:
implies
in classPermission
- Parameters:
p
- the permission to check against.- Returns:
- true if the specified permission is implied by this object, false if not.
- p is an instanceof
-
equals
Deprecated, for removal: This API element is subject to removal in a future version.Checks two ServicePermission objects for equality.- Specified by:
equals
in classPermission
- Parameters:
obj
- the object to test for equality with this object.- Returns:
- true if
obj
is a ServicePermission, and has the same service principal, and actions as this ServicePermission object. - See Also:
-
hashCode
public int hashCode()Deprecated, for removal: This API element is subject to removal in a future version.Returns the hash code value for this object.- Specified by:
hashCode
in classPermission
- Returns:
- the hash code value for this object
- See Also:
-
getActions
Deprecated, for removal: This API element is subject to removal in a future version.Returns the canonical string representation of the actions. Always returns present actions in the following order: initiate, accept.- Specified by:
getActions
in classPermission
- Returns:
- the actions of this
Permission
.
-
newPermissionCollection
Deprecated, for removal: This API element is subject to removal in a future version.Returns a PermissionCollection object for storing ServicePermission objects.
ServicePermission objects must be stored in a manner that allows them to be inserted into the collection in any order, but that also enables the PermissionCollection implies method to be implemented in an efficient (and consistent) manner.- Overrides:
newPermissionCollection
in classPermission
- Returns:
- a new PermissionCollection object suitable for storing ServicePermissions.
-