Package com.isode.dsapi
Enum Class SASLMechanism
- All Implemented Interfaces:
Serializable
,Comparable<SASLMechanism>
,Constable
Enum for holding various types of SASL mechanisms.
- Since:
- 16.1
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic SASLMechanism
getForSaslName
(String saslName) Get the enumerated value corresponding to the mechanism name.static EnumSet<SASLMechanism>
getForSaslNames
(String saslNames) Returns set of known SASLMechanisms listed in space separated list of mechanism names (unknown names are ignored).static EnumSet<SASLMechanism>
getForSaslNames
(String saslNames, boolean ignoreUnknown) Returns set of known SASLMechanisms listed in space separated list of mechanism names.static EnumSet<SASLMechanism>
getSaslIdBasedMechanisms
(Iterable<SASLMechanism> mechanisms) Filters given mechanism to return SASL ID based only.Returns mechanism's SASL name.boolean
Returns true when mechanism is based on SASL ID, false in other cases.toString()
static String
toString
(Iterable<SASLMechanism> mechanisms) Returns string representation of SASLMechanismsstatic SASLMechanism
Returns the enum constant of this class with the specified name.static SASLMechanism[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ANONYMOUS
-
CRAM_MD5
-
DIGEST_MD5
-
EXTERNAL
-
GSSAPI
-
GSS_SPNEGO
-
LOGIN
-
NTLM
-
PLAIN
-
SCRAM_SHA_1
-
SCRAM_SHA_256
-
OAUTHBEARER
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
getSaslName
Returns mechanism's SASL name.- Returns:
- mechanism's SASL name (not
null
)
-
isSaslIDBased
public boolean isSaslIDBased()Returns true when mechanism is based on SASL ID, false in other cases.- Returns:
- true when mechanism is based on SASL ID.
-
getForSaslName
Get the enumerated value corresponding to the mechanism name.- Parameters:
saslName
- (null
allowed - will returnnull
)- Returns:
- the enumeration corresponding to the first of the
mechanisms in sp, or
null if there is no match
-
getForSaslNames
public static EnumSet<SASLMechanism> getForSaslNames(String saslNames, boolean ignoreUnknown) throws BadValueException Returns set of known SASLMechanisms listed in space separated list of mechanism names.- Parameters:
saslNames
- space separated list of mechanism names (null
allowed will return empty set).ignoreUnknown
- set totrue
will cause ignoring unknown mechanism names,false
will cause throwing exception.- Returns:
- set of SASLMechanisms (not
null
but may be empty) - Throws:
BadValueException
- on unknown SASL mechanism name when ignoreUnknown is set tofalse
-
getForSaslNames
Returns set of known SASLMechanisms listed in space separated list of mechanism names (unknown names are ignored).- Parameters:
saslNames
- space separated list of mechanism names (null
allowed will return empty set).- Returns:
- set of SASLMechanisms (not
null
but may be empty)
-
getSaslIdBasedMechanisms
Filters given mechanism to return SASL ID based only.- Parameters:
mechanisms
- to be filtered (notnull
)- Returns:
- SASL ID based only mechanisms (not
null
)
-
toString
Returns string representation of SASLMechanisms- Parameters:
mechanisms
- (notnull
)- Returns:
- string representation of SASLMechanisms (not
null
)
-
toString
- Overrides:
toString
in classEnum<SASLMechanism>
-