Package com.isode.dsapi
Enum SASLMechanism
- java.lang.Object
-
- java.lang.Enum<SASLMechanism>
-
- com.isode.dsapi.SASLMechanism
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<SASLMechanism>
public enum SASLMechanism extends java.lang.Enum<SASLMechanism>
Enum for holding various types of SASL mechanisms.- Since:
- 16.1
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ANONYMOUS
CRAM_MD5
DIGEST_MD5
EXTERNAL
GSS_SPNEGO
GSSAPI
LOGIN
NTLM
PLAIN
SCRAM_SHA_1
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SASLMechanism
getForSaslName(java.lang.String saslName)
Get the enumerated value corresponding to the mechanism name.static java.util.EnumSet<SASLMechanism>
getForSaslNames(java.lang.String saslNames)
Returns set of known SASLMechanisms listed in space separated list of mechanism names (unknown names are ignored).static java.util.EnumSet<SASLMechanism>
getForSaslNames(java.lang.String saslNames, boolean ignoreUnknown)
Returns set of known SASLMechanisms listed in space separated list of mechanism names.static java.util.EnumSet<SASLMechanism>
getSaslIdBasedMechanisms(java.lang.Iterable<SASLMechanism> mechanisms)
Filters given mechanism to return SASL ID based only.java.lang.String
getSaslName()
Returns mechanism's SASL name.boolean
isSaslIDBased()
Returns true when mechanism is based on SASL ID, false in other cases.java.lang.String
toString()
static java.lang.String
toString(java.lang.Iterable<SASLMechanism> mechanisms)
Returns string representation of SASLMechanismsstatic SASLMechanism
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static SASLMechanism[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ANONYMOUS
public static final SASLMechanism ANONYMOUS
-
CRAM_MD5
public static final SASLMechanism CRAM_MD5
-
DIGEST_MD5
public static final SASLMechanism DIGEST_MD5
-
EXTERNAL
public static final SASLMechanism EXTERNAL
-
GSSAPI
public static final SASLMechanism GSSAPI
-
GSS_SPNEGO
public static final SASLMechanism GSS_SPNEGO
-
LOGIN
public static final SASLMechanism LOGIN
-
NTLM
public static final SASLMechanism NTLM
-
PLAIN
public static final SASLMechanism PLAIN
-
SCRAM_SHA_1
public static final SASLMechanism SCRAM_SHA_1
-
-
Method Detail
-
values
public static SASLMechanism[] 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 (SASLMechanism c : SASLMechanism.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SASLMechanism valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getSaslName
public java.lang.String 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
public static SASLMechanism getForSaslName(java.lang.String saslName)
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 java.util.EnumSet<SASLMechanism> getForSaslNames(java.lang.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
public static java.util.EnumSet<SASLMechanism> getForSaslNames(java.lang.String saslNames)
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
public static java.util.EnumSet<SASLMechanism> getSaslIdBasedMechanisms(java.lang.Iterable<SASLMechanism> mechanisms)
Filters given mechanism to return SASL ID based only.- Parameters:
mechanisms
- to be filtered (notnull
)- Returns:
- SASL ID based only mechanisms (not
null
)
-
toString
public static java.lang.String toString(java.lang.Iterable<SASLMechanism> mechanisms)
Returns string representation of SASLMechanisms- Parameters:
mechanisms
- (notnull
)- Returns:
- string representation of SASLMechanisms (not
null
)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<SASLMechanism>
-
-