Package com.mongodb
Enum AuthenticationMechanism
- All Implemented Interfaces:
Serializable
,Comparable<AuthenticationMechanism>
,java.lang.constant.Constable
An enumeration of the MongodDB-supported authentication mechanisms.
- Since:
- 3.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe GSSAPI mechanism.Deprecated.The MongoDB X.509 mechanism.The PLAIN mechanism.The SCRAM-SHA-1 mechanism.The SCRAM-SHA-256 mechanism. -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthenticationMechanism
fromMechanismName
(String mechanismName) Gets the mechanism by its name.Get the mechanism name.toString()
static AuthenticationMechanism
Returns the enum constant of this type with the specified name.static AuthenticationMechanism[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
-
Enum Constant Details
-
GSSAPI
The GSSAPI mechanism. See the RFC. -
PLAIN
The PLAIN mechanism. See the RFC. -
MONGODB_X509
The MongoDB X.509 mechanism. This mechanism is available only with client certificates over SSL. -
MONGODB_CR
Deprecated.This mechanism was replaced bySCRAM_SHA_1
in MongoDB 3.0, and is now deprecatedThe MongoDB Challenge Response mechanism. -
SCRAM_SHA_1
The SCRAM-SHA-1 mechanism. See the RFC. -
SCRAM_SHA_256
The SCRAM-SHA-256 mechanism. See the RFC.- Since:
- 3.8
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getMechanismName
Get the mechanism name.- Returns:
- the mechanism name
-
toString
- Overrides:
toString
in classEnum<AuthenticationMechanism>
-
fromMechanismName
Gets the mechanism by its name.- Parameters:
mechanismName
- the mechanism name- Returns:
- the mechanism
- See Also:
-
SCRAM_SHA_1
in MongoDB 3.0, and is now deprecated