Package org.wildfly.security.sasl.util
Class LegacyRealmListSaslServerFactory
- java.lang.Object
-
- org.wildfly.security.sasl.util.AbstractDelegatingSaslServerFactory
-
- org.wildfly.security.sasl.util.LegacyRealmListSaslServerFactory
-
- All Implemented Interfaces:
SaslServerFactory
public final class LegacyRealmListSaslServerFactory extends AbstractDelegatingSaslServerFactory
ASaslServerFactory
which uses theAvailableRealmsCallback
to populate the legacyWildFlySasl.REALM_LIST
property, if needed by a mechanism.- Author:
- Farah Juma
-
-
Field Summary
Fields Modifier and Type Field Description static char
DEFAULT_DELIMITER
static char
DEFAULT_ESCAPE_CHARACTER
private int[]
delims
private int
escapeCharacter
-
Fields inherited from class org.wildfly.security.sasl.util.AbstractDelegatingSaslServerFactory
delegate
-
-
Constructor Summary
Constructors Constructor Description LegacyRealmListSaslServerFactory(SaslServerFactory delegate)
Construct a new instance.LegacyRealmListSaslServerFactory(SaslServerFactory delegate, char escapeCharacter, int... delims)
Construct a new instance.LegacyRealmListSaslServerFactory(SaslServerFactory delegate, char escapeCharacter, String delims)
Construct a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void
addDelims(StringBuilder realmList, int... delims)
(package private) static String
arrayToRealmListProperty(String[] realms)
(package private) static String
arrayToRealmListProperty(String[] realms, int escapeCharacter, int... delims)
SaslServer
createSaslServer(String mechanism, String protocol, String serverName, Map<String,?> props, CallbackHandler cbh)
-
Methods inherited from class org.wildfly.security.sasl.util.AbstractDelegatingSaslServerFactory
delegatesThrough, delegatesThroughNN, getMechanismNames, toString
-
-
-
-
Field Detail
-
DEFAULT_DELIMITER
public static final char DEFAULT_DELIMITER
- See Also:
- Constant Field Values
-
DEFAULT_ESCAPE_CHARACTER
public static final char DEFAULT_ESCAPE_CHARACTER
- See Also:
- Constant Field Values
-
escapeCharacter
private final int escapeCharacter
-
delims
private final int[] delims
-
-
Constructor Detail
-
LegacyRealmListSaslServerFactory
public LegacyRealmListSaslServerFactory(SaslServerFactory delegate)
Construct a new instance. The delimiter that should be used to separate the realm names when populating the list of realms is assumed to be 32. The escape character is assumed to be 92.- Parameters:
delegate
- the delegateSaslServerFactory
-
LegacyRealmListSaslServerFactory
public LegacyRealmListSaslServerFactory(SaslServerFactory delegate, char escapeCharacter, String delims)
Construct a new instance.- Parameters:
delegate
- the delegateSaslServerFactory
escapeCharacter
- the escape character to use when populating the list of realmsdelims
- the delimiters that should be used to separate the realm names when populating the list of realms
-
LegacyRealmListSaslServerFactory
public LegacyRealmListSaslServerFactory(SaslServerFactory delegate, char escapeCharacter, int... delims)
Construct a new instance.- Parameters:
delegate
- the delegateSaslServerFactory
escapeCharacter
- the escape character to use when populating the list of realmsdelims
- the delimiters that should be used to separate the realm names when populating the list of realms
-
-
Method Detail
-
createSaslServer
public SaslServer createSaslServer(String mechanism, String protocol, String serverName, Map<String,?> props, CallbackHandler cbh) throws SaslException
- Specified by:
createSaslServer
in interfaceSaslServerFactory
- Overrides:
createSaslServer
in classAbstractDelegatingSaslServerFactory
- Throws:
SaslException
-
arrayToRealmListProperty
static String arrayToRealmListProperty(String[] realms, int escapeCharacter, int... delims)
-
addDelims
private static void addDelims(StringBuilder realmList, int... delims)
-
-