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 class
SaslMechanismSelector.AddMatchingSelector
(package private) static class
SaslMechanismSelector.AddSelector
(package private) static class
SaslMechanismSelector.EmptySelector
(package private) static class
SaslMechanismSelector.ForbidMatchingSelector
(package private) static class
SaslMechanismSelector.ForbidSelector
(package private) static class
SaslMechanismSelector.Tokenizer
-
Field Summary
Fields Modifier and Type Field Description static SaslMechanismSelector
ALL
static SaslMechanismSelector
DEFAULT
private int
hashCode
private static SaslMechanismPredicate[]
NO_PREDICATES
static SaslMechanismSelector
NONE
(package private) SaslMechanismSelector
prev
private static int
TOK_ALL
private static int
TOK_AND
private static int
TOK_COLON
private static int
TOK_END
private static int
TOK_EQ
private static int
TOK_FAMILY
private static int
TOK_HASH
private static int
TOK_INVALID
private static int
TOK_LPAREN
private static int
TOK_MINUS
private static int
TOK_MUTUAL
private static int
TOK_NAME
private static int
TOK_NOT
private static int
TOK_OR
private static int
TOK_PLUS
private static int
TOK_Q
private static int
TOK_RPAREN
private static int
TOK_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 SaslMechanismSelector
addAllRemaining()
(package private) boolean
addHalfEquals(SaslMechanismSelector selector)
(package private) int
addHashCode()
SaslMechanismSelector
addMatching(SaslMechanismPredicate predicate)
SaslMechanismSelector
addMechanism(String mechName)
SaslMechanismSelector
addMechanisms(String... mechNames)
(package private) boolean
adds(String mechName)
(package private) boolean
adds(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)
boolean
equals(Object obj)
boolean
equals(SaslMechanismSelector selector)
(package private) boolean
forbidHalfEquals(SaslMechanismSelector selector)
(package private) int
forbidHashCode()
SaslMechanismSelector
forbidMatching(SaslMechanismPredicate predicate)
SaslMechanismSelector
forbidMechanism(String mechName)
SaslMechanismSelector
forbidMechanisms(String... mechNames)
(package private) boolean
forbids(String mechName)
(package private) boolean
forbids(SaslMechanismPredicate predicate)
static SaslMechanismSelector
fromString(String string)
int
hashCode()
private static SaslMechanismPredicate
parseAndPredicate(SaslMechanismSelector.Tokenizer t, String string)
private static SaslMechanismPredicate
parseEqPredicate(SaslMechanismSelector.Tokenizer t, String string)
private static SaslMechanismPredicate
parseIfPredicate(SaslMechanismSelector.Tokenizer t, String string)
private static SaslMechanismPredicate
parseOrPredicate(SaslMechanismSelector.Tokenizer t, String string)
private static String
parseSpecialWithName(String string, SaslMechanismSelector.Tokenizer t)
private static SaslMechanismPredicate
parseTopLevelPredicate(SaslMechanismSelector.Tokenizer t, String string)
private static SaslMechanismPredicate
parseTopLevelPredicate(SaslMechanismSelector.Tokenizer t, String string, int tok)
(package private) void
preprocess(Set<String> mechNames, SSLSession sslSession)
(package private) static String
tokToString(SaslMechanismSelector.Tokenizer t)
String
toString()
(package private) abstract void
toString(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, ornull
if 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, ornull
if 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, ornull
if 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)
-
-