Package com.mongodb
Enum Class 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 ConstantDescriptionThe GSSAPI mechanism.The MONGODB-AWS mechanism.The MONGODB-OIDC mechanism.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 class with the specified name.static AuthenticationMechanism[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
GSSAPI
The GSSAPI mechanism. See the RFC. -
MONGODB_AWS
The MONGODB-AWS mechanism.- Since:
- 4.1
- Since server release
- 4.4
-
MONGODB_OIDC
The MONGODB-OIDC mechanism.- Since:
- 4.10
- Since server release
- 7.0
-
MONGODB_X509
The MongoDB X.509 mechanism. This mechanism is available only with client certificates over SSL. -
PLAIN
The PLAIN mechanism. See the RFC. -
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 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
-
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:
-