Package com.mongodb
Enum AuthenticationMechanism
- java.lang.Object
-
- java.lang.Enum<AuthenticationMechanism>
-
- com.mongodb.AuthenticationMechanism
-
- All Implemented Interfaces:
Serializable
,Comparable<AuthenticationMechanism>
public enum AuthenticationMechanism extends Enum<AuthenticationMechanism>
An enumeration of the MongodDB-supported authentication mechanisms.- Since:
- 3.0
-
-
Enum Constant Summary
Enum Constants Enum Constant Description GSSAPI
The GSSAPI mechanism.MONGODB_AWS
The MONGODB-AWS mechanism.MONGODB_X509
The MongoDB X.509 mechanism.PLAIN
The PLAIN mechanism.SCRAM_SHA_1
The SCRAM-SHA-1 mechanism.SCRAM_SHA_256
The SCRAM-SHA-256 mechanism.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AuthenticationMechanism
fromMechanismName(String mechanismName)
Gets the mechanism by its name.String
getMechanismName()
Get the mechanism name.String
toString()
static AuthenticationMechanism
valueOf(String name)
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.
-
-
-
Enum Constant Detail
-
GSSAPI
public static final AuthenticationMechanism GSSAPI
The GSSAPI mechanism. See the RFC.
-
MONGODB_AWS
public static final AuthenticationMechanism MONGODB_AWS
The MONGODB-AWS mechanism.- Since:
- 4.1
- Since server release
- 4.4
-
MONGODB_X509
public static final AuthenticationMechanism MONGODB_X509
The MongoDB X.509 mechanism. This mechanism is available only with client certificates over SSL.
-
PLAIN
public static final AuthenticationMechanism PLAIN
The PLAIN mechanism. See the RFC.
-
SCRAM_SHA_1
public static final AuthenticationMechanism SCRAM_SHA_1
The SCRAM-SHA-1 mechanism. See the RFC.
-
SCRAM_SHA_256
public static final AuthenticationMechanism SCRAM_SHA_256
The SCRAM-SHA-256 mechanism. See the RFC.- Since:
- 3.8
-
-
Method Detail
-
values
public static AuthenticationMechanism[] 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 (AuthenticationMechanism c : AuthenticationMechanism.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AuthenticationMechanism valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getMechanismName
public String getMechanismName()
Get the mechanism name.- Returns:
- the mechanism name
-
toString
public String toString()
- Overrides:
toString
in classEnum<AuthenticationMechanism>
-
fromMechanismName
public static AuthenticationMechanism fromMechanismName(String mechanismName)
Gets the mechanism by its name.- Parameters:
mechanismName
- the mechanism name- Returns:
- the mechanism
- See Also:
getMechanismName()
-
-