- java.lang.Object
-
- java.lang.Enum<CompositeProviderFlag>
-
- io.helidon.security.CompositeProviderFlag
-
- All Implemented Interfaces:
Serializable,Comparable<CompositeProviderFlag>
public enum CompositeProviderFlag extends Enum<CompositeProviderFlag>
Flag driving resolution of providers. If provider returns a FINISH state (eitherSecurityResponse.SecurityStatus.SUCCESS_FINISHorSecurityResponse.SecurityStatus.FAILURE_FINISH, the processing is finished with that status.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description FORBIDDENProvider must not be successful for this request (e.g.MAY_FAILProvider may fail, nothing happens if it does.MUST_FAILProvider must fail.OPTIONALProvider may succeed or abstain.REQUIREDProvider must succeed if called (if sufficient is before required, required is still ignored).SUFFICIENTIf succeeds, no further providers are called, otherwise same as optional.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisValid(SecurityResponse.SecurityStatus status)Check whether the status is valid for this flag.static CompositeProviderFlagvalueOf(String name)Returns the enum constant of this type with the specified name.static CompositeProviderFlag[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
MAY_FAIL
public static final CompositeProviderFlag MAY_FAIL
Provider may fail, nothing happens if it does.If succeeds, continues to the next provider. To create a provider that may fail, yet that is sufficient, please configure the flag to be
SUFFICIENT, and set the provider itself to be optional (most Helidon providers supportoptionalconfiguration option), so the provider abstains instead of fails when user cannot be authenticated using it.
-
SUFFICIENT
public static final CompositeProviderFlag SUFFICIENT
If succeeds, no further providers are called, otherwise same as optional.To create a provider that may fail, yet that is sufficient, use this flag, and set the provider itself to be optional (most Helidon providers support
optionalconfiguration option), so the provider abstains instead of fails when user cannot be authenticated using it.
-
OPTIONAL
public static final CompositeProviderFlag OPTIONAL
Provider may succeed or abstain. If fails, no further providers are called and request fails.
-
REQUIRED
public static final CompositeProviderFlag REQUIRED
Provider must succeed if called (if sufficient is before required, required is still ignored).
-
FORBIDDEN
public static final CompositeProviderFlag FORBIDDEN
Provider must not be successful for this request (e.g. either it does not apply to this request, or it fails)
-
MUST_FAIL
public static final CompositeProviderFlag MUST_FAIL
Provider must fail.
-
-
Method Detail
-
values
public static CompositeProviderFlag[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CompositeProviderFlag c : CompositeProviderFlag.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CompositeProviderFlag valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
isValid
public boolean isValid(SecurityResponse.SecurityStatus status)
Check whether the status is valid for this flag.- Parameters:
status- status as returned by a provider- Returns:
- true if the status is supported by this flag and the processing should continue
-
-