Package org.wildfly.security.sasl
Class SaslMechanismSelector
- java.lang.Object
-
- org.wildfly.security.sasl.SaslMechanismSelector
-
- Direct Known Subclasses:
SaslMechanismSelector.AddMatchingSelector,SaslMechanismSelector.AddSelector,SaslMechanismSelector.EmptySelector,SaslMechanismSelector.ForbidMatchingSelector,SaslMechanismSelector.ForbidSelector
public abstract class SaslMechanismSelector extends Object
A selection specification for SASL client or server mechanisms. The specification can be used to define the types, behavior, and order of SASL mechanisms.- Author:
- David M. Lloyd
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classSaslMechanismSelector.AddMatchingSelector(package private) static classSaslMechanismSelector.AddSelector(package private) static classSaslMechanismSelector.EmptySelector(package private) static classSaslMechanismSelector.ForbidMatchingSelector(package private) static classSaslMechanismSelector.ForbidSelector(package private) static classSaslMechanismSelector.Tokenizer
-
Field Summary
Fields Modifier and Type Field Description static SaslMechanismSelectorALLstatic SaslMechanismSelectorDEFAULTprivate inthashCodeprivate static SaslMechanismPredicate[]NO_PREDICATESstatic SaslMechanismSelectorNONE(package private) SaslMechanismSelectorprevprivate static intTOK_ALLprivate static intTOK_ANDprivate static intTOK_COLONprivate static intTOK_ENDprivate static intTOK_EQprivate static intTOK_FAMILYprivate static intTOK_HASHprivate static intTOK_INVALIDprivate static intTOK_LPARENprivate static intTOK_MINUSprivate static intTOK_MUTUALprivate static intTOK_NAMEprivate static intTOK_NOTprivate static intTOK_ORprivate static intTOK_PLUSprivate static intTOK_Qprivate static intTOK_RPARENprivate static intTOK_TLS
-
Constructor Summary
Constructors Constructor Description SaslMechanismSelector(SaslMechanismSelector prev)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description SaslMechanismSelectoraddAllRemaining()(package private) booleanaddHalfEquals(SaslMechanismSelector selector)(package private) intaddHashCode()SaslMechanismSelectoraddMatching(SaslMechanismPredicate predicate)SaslMechanismSelectoraddMechanism(String mechName)SaslMechanismSelectoraddMechanisms(String... mechNames)(package private) booleanadds(String mechName)(package private) booleanadds(SaslMechanismPredicate predicate)List<String>apply(Collection<String> mechNames, SSLSession sslSession)Get a list of mechanism names which are matched by this selector in the preferential order that the selector specifies.Supplier<String>createMechanismSupplier(String[] mechNames)Create a supplier of mechanism names that provides the names of the mechanisms which are matched by this selector in the preferential order that the selector specifies.Supplier<String>createMechanismSupplier(String[] mechNames, SSLSession sslSession)Create a supplier of mechanism names that provides the names of the mechanisms which are matched by this selector in the preferential order that the selector specifies.Supplier<String>createMechanismSupplier(Collection<String> mechNames)Create a supplier of mechanism names that provides the names of the mechanisms which are matched by this selector in the preferential order that the selector specifies.Supplier<String>createMechanismSupplier(Collection<String> mechNames, SSLSession sslSession)Create a supplier of mechanism names that provides the names of the mechanisms which are matched by this selector in the preferential order that the selector specifies.(package private) abstract Supplier<String>doCreateSupplier(LinkedHashSet<String> set, SSLSession sslSession)booleanequals(Object obj)booleanequals(SaslMechanismSelector selector)(package private) booleanforbidHalfEquals(SaslMechanismSelector selector)(package private) intforbidHashCode()SaslMechanismSelectorforbidMatching(SaslMechanismPredicate predicate)SaslMechanismSelectorforbidMechanism(String mechName)SaslMechanismSelectorforbidMechanisms(String... mechNames)(package private) booleanforbids(String mechName)(package private) booleanforbids(SaslMechanismPredicate predicate)static SaslMechanismSelectorfromString(String string)inthashCode()private static SaslMechanismPredicateparseAndPredicate(SaslMechanismSelector.Tokenizer t, String string)private static SaslMechanismPredicateparseEqPredicate(SaslMechanismSelector.Tokenizer t, String string)private static SaslMechanismPredicateparseIfPredicate(SaslMechanismSelector.Tokenizer t, String string)private static SaslMechanismPredicateparseOrPredicate(SaslMechanismSelector.Tokenizer t, String string)private static StringparseSpecialWithName(String string, SaslMechanismSelector.Tokenizer t)private static SaslMechanismPredicateparseTopLevelPredicate(SaslMechanismSelector.Tokenizer t, String string)private static SaslMechanismPredicateparseTopLevelPredicate(SaslMechanismSelector.Tokenizer t, String string, int tok)(package private) voidpreprocess(Set<String> mechNames, SSLSession sslSession)(package private) static StringtokToString(SaslMechanismSelector.Tokenizer t)StringtoString()(package private) abstract voidtoString(StringBuilder b)
-
-
-
Field Detail
-
NO_PREDICATES
private static final SaslMechanismPredicate[] NO_PREDICATES
-
prev
final SaslMechanismSelector prev
-
hashCode
private int hashCode
-
NONE
public static final SaslMechanismSelector NONE
-
ALL
public static final SaslMechanismSelector ALL
-
DEFAULT
public static final SaslMechanismSelector DEFAULT
-
TOK_INVALID
private static final int TOK_INVALID
- See Also:
- Constant Field Values
-
TOK_FAMILY
private static final int TOK_FAMILY
- See Also:
- Constant Field Values
-
TOK_TLS
private static final int TOK_TLS
- See Also:
- Constant Field Values
-
TOK_PLUS
private static final int TOK_PLUS
- See Also:
- Constant Field Values
-
TOK_MUTUAL
private static final int TOK_MUTUAL
- See Also:
- Constant Field Values
-
TOK_HASH
private static final int TOK_HASH
- See Also:
- Constant Field Values
-
TOK_MINUS
private static final int TOK_MINUS
- See Also:
- Constant Field Values
-
TOK_ALL
private static final int TOK_ALL
- See Also:
- Constant Field Values
-
TOK_LPAREN
private static final int TOK_LPAREN
- See Also:
- Constant Field Values
-
TOK_RPAREN
private static final int TOK_RPAREN
- See Also:
- Constant Field Values
-
TOK_OR
private static final int TOK_OR
- See Also:
- Constant Field Values
-
TOK_AND
private static final int TOK_AND
- See Also:
- Constant Field Values
-
TOK_EQ
private static final int TOK_EQ
- See Also:
- Constant Field Values
-
TOK_Q
private static final int TOK_Q
- See Also:
- Constant Field Values
-
TOK_COLON
private static final int TOK_COLON
- See Also:
- Constant Field Values
-
TOK_NOT
private static final int TOK_NOT
- See Also:
- Constant Field Values
-
TOK_NAME
private static final int TOK_NAME
- See Also:
- Constant Field Values
-
TOK_END
private static final int TOK_END
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SaslMechanismSelector
SaslMechanismSelector(SaslMechanismSelector prev)
-
-
Method Detail
-
createMechanismSupplier
public Supplier<String> createMechanismSupplier(String[] mechNames)
Create a supplier of mechanism names that provides the names of the mechanisms which are matched by this selector in the preferential order that the selector specifies. When no preference between two mechanisms is specified, the original order is used.- Parameters:
mechNames- the mechanism names (must not benull)- Returns:
- the supplier of mechanisms (not
null)
-
createMechanismSupplier
public Supplier<String> createMechanismSupplier(String[] mechNames, SSLSession sslSession)
Create a supplier of mechanism names that provides the names of the mechanisms which are matched by this selector in the preferential order that the selector specifies. When no preference between two mechanisms is specified, the original order is used.- Parameters:
mechNames- the mechanism names (must not benull)sslSession- the SSL session, if any is active, ornullif SSL is not active- Returns:
- the supplier of mechanisms (not
null)
-
createMechanismSupplier
public Supplier<String> createMechanismSupplier(Collection<String> mechNames)
Create a supplier of mechanism names that provides the names of the mechanisms which are matched by this selector in the preferential order that the selector specifies. When no preference between two mechanisms is specified, the original order is used.- Parameters:
mechNames- the mechanism names (must not benull)- Returns:
- the supplier of mechanisms (not
null)
-
createMechanismSupplier
public Supplier<String> createMechanismSupplier(Collection<String> mechNames, SSLSession sslSession)
Create a supplier of mechanism names that provides the names of the mechanisms which are matched by this selector in the preferential order that the selector specifies. When no preference between two mechanisms is specified, the original order is used.- Parameters:
mechNames- the mechanism names (must not benull)sslSession- the SSL session, if any is active, ornullif SSL is not active- Returns:
- the supplier of mechanisms (not
null)
-
apply
public List<String> apply(Collection<String> mechNames, SSLSession sslSession)
Get a list of mechanism names which are matched by this selector in the preferential order that the selector specifies. When no preference between two mechanisms is specified, the original order is used.- Parameters:
mechNames- the mechanism names (must not benull)sslSession- the SSL session, if any is active, ornullif SSL is not active- Returns:
- the list of mechanisms (not
null)
-
doCreateSupplier
abstract Supplier<String> doCreateSupplier(LinkedHashSet<String> set, SSLSession sslSession)
-
preprocess
void preprocess(Set<String> mechNames, SSLSession sslSession)
-
addMechanism
public SaslMechanismSelector addMechanism(String mechName)
-
addMechanisms
public SaslMechanismSelector addMechanisms(String... mechNames)
-
forbidMechanism
public SaslMechanismSelector forbidMechanism(String mechName)
-
forbidMechanisms
public SaslMechanismSelector forbidMechanisms(String... mechNames)
-
addMatching
public SaslMechanismSelector addMatching(SaslMechanismPredicate predicate)
-
forbidMatching
public SaslMechanismSelector forbidMatching(SaslMechanismPredicate predicate)
-
addAllRemaining
public SaslMechanismSelector addAllRemaining()
-
equals
public final boolean equals(SaslMechanismSelector selector)
-
tokToString
static String tokToString(SaslMechanismSelector.Tokenizer t)
-
fromString
public static SaslMechanismSelector fromString(String string)
-
parseTopLevelPredicate
private static SaslMechanismPredicate parseTopLevelPredicate(SaslMechanismSelector.Tokenizer t, String string, int tok)
-
parseIfPredicate
private static SaslMechanismPredicate parseIfPredicate(SaslMechanismSelector.Tokenizer t, String string)
-
parseEqPredicate
private static SaslMechanismPredicate parseEqPredicate(SaslMechanismSelector.Tokenizer t, String string)
-
parseOrPredicate
private static SaslMechanismPredicate parseOrPredicate(SaslMechanismSelector.Tokenizer t, String string)
-
parseAndPredicate
private static SaslMechanismPredicate parseAndPredicate(SaslMechanismSelector.Tokenizer t, String string)
-
parseTopLevelPredicate
private static SaslMechanismPredicate parseTopLevelPredicate(SaslMechanismSelector.Tokenizer t, String string)
-
parseSpecialWithName
private static String parseSpecialWithName(String string, SaslMechanismSelector.Tokenizer t)
-
addHashCode
int addHashCode()
-
forbidHashCode
int forbidHashCode()
-
forbidHalfEquals
boolean forbidHalfEquals(SaslMechanismSelector selector)
-
addHalfEquals
boolean addHalfEquals(SaslMechanismSelector selector)
-
toString
abstract void toString(StringBuilder b)
-
adds
boolean adds(String mechName)
-
adds
boolean adds(SaslMechanismPredicate predicate)
-
forbids
boolean forbids(String mechName)
-
forbids
boolean forbids(SaslMechanismPredicate predicate)
-
-