Top Description Fields Constructors Methods
org.wildfly.common.context

public final Class ContextPermission

extends Permission
Class Inheritance
Imports
java.security.Permission, .PermissionCollection, java.util.function.Supplier, org.wildfly.common.Assert, org.wildfly.common._private.CommonMessages, org.wildfly.common.annotation.NotNull

A permission object for operations on ContextManager instances.

This type of permission requires a name and an action. The name may be the name of a context manager, or the special * name which means the permission applies to all context managers.

The action may be one or more of the following (each action name being separated by a comma):

Additionally, the special * action name is allowed which implies all of the above actions.

The newPermissionCollection() method returns an optimized container for context permissions.

Author
David M. Lloyd

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private final transient int
private transient String
private static final long
pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final String

Constructor Summary

AccessConstructor and Description
public
ContextPermission(final String
name of the Permission object being created (must not be null)
name
,
final String
the actions string (must not be null)
actions
)

Constructs a permission with the specified name.

pack-priv
ContextPermission(final String name, final int actionBits)

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the object is a context permission that is exactly equal to this one; false otherwise
equals
(final Object
the other object
obj
)

Implements abstract java.security.Permission.equals.

Determine if this permission is equal to the given object.
public boolean

Returns:

true if the permission is a context permission that is exactly equal to this one; false otherwise
equals
(final ContextPermission
the other permission
permission
)

Determine if this permission is equal to the given permission.

pack-priv int
public String

Returns:

the actions string
getActions
()

Implements abstract java.security.Permission.getActions.

Get the actions string.
public int

Returns:

the hash code of this permission
hashCode
()

Implements abstract java.security.Permission.hashCode.

Get the hash code of this permission.
public boolean

Returns:

true if the other permission is not null and is a context permission which is implied by this permission instance; false otherwise
implies
(final Permission
the other permission
permission
)

Implements abstract java.security.Permission.implies.

Determine if the given permission is implied by this permission.
public boolean

Returns:

true if the other permission is not null and is a context permission which is implied by this permission instance; false otherwise
implies
(final ContextPermission
the other permission
permission
)

Determine if the given permission is implied by this permission.

private boolean
impliesName(String otherName)

pack-priv static boolean
isSet(int mask, int test)

public PermissionCollection

Returns:

a new permission collection instance (not null)
newPermissionCollection
()

Overrides java.security.Permission.newPermissionCollection.

Get a new permission collection instance which can hold this type of permissions.
private static int
parseAction(final String action)

private static int
parseActions(final String actions)

pack-priv ContextPermission
withActionBits(int actionBits)

public ContextPermission

Returns:

the new permission (not null)
withActions
(String
the additional actions (must not be null)
actions
)

Create a copy of this permission with the additional given actions.

pack-priv ContextPermission
withoutActionBits(final int actionBits)

public ContextPermission

Returns:

the new permission (not null)
withoutActions
(String
the actions to subtract (must not be null)
actions
)

Create a copy of this permission without any of the given actions.

Inherited from java.security.Permission:
checkGuardgetNametoString

Field Detail

ACTION_ALLback to summary
private static final int ACTION_ALL
ACTION_GETback to summary
private static final int ACTION_GET
ACTION_GET_CLASSLOADER_DEFback to summary
private static final int ACTION_GET_CLASSLOADER_DEF
ACTION_GET_GLOBAL_DEFback to summary
private static final int ACTION_GET_GLOBAL_DEF
ACTION_GET_PRIV_SUPback to summary
private static final int ACTION_GET_PRIV_SUP
ACTION_GET_THREAD_DEFback to summary
private static final int ACTION_GET_THREAD_DEF
ACTION_SET_CLASSLOADER_DEFback to summary
private static final int ACTION_SET_CLASSLOADER_DEF
ACTION_SET_CLASSLOADER_DEF_SUPback to summary
private static final int ACTION_SET_CLASSLOADER_DEF_SUP
ACTION_SET_GLOBAL_DEFback to summary
private static final int ACTION_SET_GLOBAL_DEF
ACTION_SET_GLOBAL_DEF_SUPback to summary
private static final int ACTION_SET_GLOBAL_DEF_SUP
ACTION_SET_THREAD_DEFback to summary
private static final int ACTION_SET_THREAD_DEF
ACTION_SET_THREAD_DEF_SUPback to summary
private static final int ACTION_SET_THREAD_DEF_SUP
actionBitsback to summary
private final transient int actionBits
actionStringback to summary
private transient String actionString
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.security.Permission.serialVersionUID.

STR_GETback to summary
pack-priv static final String STR_GET
STR_GET_CLASSLOADER_DEFback to summary
pack-priv static final String STR_GET_CLASSLOADER_DEF
STR_GET_GLOBAL_DEFback to summary
pack-priv static final String STR_GET_GLOBAL_DEF
STR_GET_PRIV_SUPback to summary
pack-priv static final String STR_GET_PRIV_SUP
STR_GET_THREAD_DEFback to summary
pack-priv static final String STR_GET_THREAD_DEF
STR_SET_CLASSLOADER_DEFback to summary
pack-priv static final String STR_SET_CLASSLOADER_DEF
STR_SET_CLASSLOADER_DEF_SUPback to summary
pack-priv static final String STR_SET_CLASSLOADER_DEF_SUP
STR_SET_GLOBAL_DEFback to summary
pack-priv static final String STR_SET_GLOBAL_DEF
STR_SET_GLOBAL_DEF_SUPback to summary
pack-priv static final String STR_SET_GLOBAL_DEF_SUP
STR_SET_THREAD_DEFback to summary
pack-priv static final String STR_SET_THREAD_DEF
STR_SET_THREAD_DEF_SUPback to summary
pack-priv static final String STR_SET_THREAD_DEF_SUP

Constructor Detail

ContextPermissionback to summary
public ContextPermission(final String name, final String actions)

Constructs a permission with the specified name.

Parameters
name:String

name of the Permission object being created (must not be null)

actions:String

the actions string (must not be null)

ContextPermissionback to summary
pack-priv ContextPermission(final String name, final int actionBits)

Method Detail

equalsback to summary
public boolean equals(final Object obj)

Implements abstract java.security.Permission.equals.

Determine if this permission is equal to the given object.

Parameters
obj:Object

the other object

Returns:boolean

true if the object is a context permission that is exactly equal to this one; false otherwise

equalsback to summary
public boolean equals(final ContextPermission permission)

Determine if this permission is equal to the given permission.

Parameters
permission:ContextPermission

the other permission

Returns:boolean

true if the permission is a context permission that is exactly equal to this one; false otherwise

getActionBitsback to summary
pack-priv int getActionBits()
getActionsback to summary
public String getActions()

Implements abstract java.security.Permission.getActions.

Get the actions string. This string will be returned in a canonical format.

Returns:String

the actions string

hashCodeback to summary
public int hashCode()

Implements abstract java.security.Permission.hashCode.

Get the hash code of this permission.

Returns:int

the hash code of this permission

impliesback to summary
public boolean implies(final Permission permission)

Implements abstract java.security.Permission.implies.

Determine if the given permission is implied by this permission.

Parameters
permission:Permission

the other permission

Returns:boolean

true if the other permission is not null and is a context permission which is implied by this permission instance; false otherwise

impliesback to summary
public boolean implies(final ContextPermission permission)

Determine if the given permission is implied by this permission.

Parameters
permission:ContextPermission

the other permission

Returns:boolean

true if the other permission is not null and is a context permission which is implied by this permission instance; false otherwise

impliesNameback to summary
private boolean impliesName(String otherName)
isSetback to summary
pack-priv static boolean isSet(int mask, int test)
newPermissionCollectionback to summary
public PermissionCollection newPermissionCollection()

Overrides java.security.Permission.newPermissionCollection.

Get a new permission collection instance which can hold this type of permissions.

Returns:PermissionCollection

a new permission collection instance (not null)

parseActionback to summary
private static int parseAction(final String action)
parseActionsback to summary
private static int parseActions(final String actions) throws IllegalArgumentException
withActionBitsback to summary
pack-priv ContextPermission withActionBits(int actionBits)
withActionsback to summary
public ContextPermission withActions(String actions)

Create a copy of this permission with the additional given actions.

Parameters
actions:String

the additional actions (must not be null)

Returns:ContextPermission

the new permission (not null)

Annotations
@NotNull
withoutActionBitsback to summary
pack-priv ContextPermission withoutActionBits(final int actionBits)
withoutActionsback to summary
public ContextPermission withoutActions(String actions)

Create a copy of this permission without any of the given actions.

Parameters
actions:String

the actions to subtract (must not be null)

Returns:ContextPermission

the new permission (not null)

Annotations
@NotNull