Package org.wildfly.security.permission
Class PermissionActions
java.lang.Object
org.wildfly.security.permission.PermissionActions
Deprecated.
A helper class for defining permissions which use a finite list of actions. Define custom permissions using
an
enum of actions, where the string representation (via toString()) of each enum is one possible
action name. Typically the enum should be non-public, and the constant names should be lowercase. If
an action name contains a character which is not a valid Java identifier, then the toString() method of
such constants should be overridden to report the correct string. The actions may be stored on the permission as
an EnumSet, an int, or a long. The field should be marked transient, and
the actions represented by a (possibly synthetic) field of type String which uses the canonical representation
of the actions.- Author:
- David M. Lloyd
-
Method Summary
Modifier and TypeMethodDescriptiongetCanonicalActionString(Class<E> type, int set) Deprecated.Get the canonical action string representation for the given action set.static <E extends Enum<E>>
voidgetCanonicalActionString(Class<E> type, int set, StringBuilder b) Deprecated.Get the canonical action string representation for the given action set, appending it to the given string builder.getCanonicalActionString(Class<E> type, long set) Deprecated.Get the canonical action string representation for the given action set.static <E extends Enum<E>>
voidgetCanonicalActionString(Class<E> type, long set, StringBuilder b) Deprecated.Get the canonical action string representation for the given action set, appending it to the given string builder.getCanonicalActionString(EnumSet<E> set) Deprecated.Get the canonical action string representation for the given action set.static <E extends Enum<E>>
voidgetCanonicalActionString(EnumSet<E> set, StringBuilder b) Deprecated.Get the canonical action string representation for the given action set, appending it to the given string builder.static <E extends Enum<E>>
intparseActionStringToInt(Class<E> actionType, String actionString) Deprecated.Parse an action string using the given action type to anint.static <E extends Enum<E>>
longparseActionStringToLong(Class<E> actionType, String actionString) Deprecated.Parse an action string using the given action type to along.parseActionStringToSet(Class<E> actionType, String actionString) Deprecated.Parse an action string using the given action type to anEnumSet.
-
Method Details
-
parseActionStringToSet
public static <E extends Enum<E>> EnumSet<E> parseActionStringToSet(Class<E> actionType, String actionString) throws IllegalArgumentException Deprecated.Parse an action string using the given action type to anEnumSet.- Type Parameters:
E- the actionenumtype- Parameters:
actionType- the actionenumtype classactionString- the string to parse- Returns:
- the set of actions from the string
- Throws:
IllegalArgumentException- if the string contained an invalid action
-
parseActionStringToInt
public static <E extends Enum<E>> int parseActionStringToInt(Class<E> actionType, String actionString) throws IllegalArgumentException Deprecated.Parse an action string using the given action type to anint. The givenenumtype must have 32 or fewer constant values.- Type Parameters:
E- the actionenumtype- Parameters:
actionType- the actionenumtype classactionString- the string to parse- Returns:
- the set of actions from the string
- Throws:
IllegalArgumentException- if the string contained an invalid action
-
parseActionStringToLong
public static <E extends Enum<E>> long parseActionStringToLong(Class<E> actionType, String actionString) throws IllegalArgumentException Deprecated.Parse an action string using the given action type to along. The givenenumtype must have 64 or fewer constant values.- Type Parameters:
E- the actionenumtype- Parameters:
actionType- the actionenumtype classactionString- the string to parse- Returns:
- the set of actions from the string
- Throws:
IllegalArgumentException- if the string contained an invalid action
-
getCanonicalActionString
Deprecated.Get the canonical action string representation for the given action set.- Type Parameters:
E- the action type- Parameters:
set- the action set- Returns:
- the canonical representation
-
getCanonicalActionString
Deprecated.Get the canonical action string representation for the given action set, appending it to the given string builder.- Type Parameters:
E- the action type- Parameters:
set- the action setb- the string builder
-
getCanonicalActionString
Deprecated.Get the canonical action string representation for the given action set.- Type Parameters:
E- the action type- Parameters:
type- the actionenumtype classset- the action set- Returns:
- the canonical representation
-
getCanonicalActionString
public static <E extends Enum<E>> void getCanonicalActionString(Class<E> type, int set, StringBuilder b) Deprecated.Get the canonical action string representation for the given action set, appending it to the given string builder.- Type Parameters:
E- the action type- Parameters:
type- the actionenumtype classset- the action setb- the string builder
-
getCanonicalActionString
Deprecated.Get the canonical action string representation for the given action set.- Type Parameters:
E- the action type- Parameters:
type- the actionenumtype classset- the action set- Returns:
- the canonical representation
-
getCanonicalActionString
public static <E extends Enum<E>> void getCanonicalActionString(Class<E> type, long set, StringBuilder b) Deprecated.Get the canonical action string representation for the given action set, appending it to the given string builder.- Type Parameters:
E- the action type- Parameters:
type- the actionenumtype classset- the action setb- the string builder
-
org.wildfly.security.permission.AbstractActionSetPermissioninstead.