Package com.mongodb
Enum AuthenticationMechanism
- java.lang.Object
-
- java.lang.Enum<AuthenticationMechanism>
-
- com.mongodb.AuthenticationMechanism
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<AuthenticationMechanism>
public enum AuthenticationMechanism extends java.lang.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_CR
Deprecated.This mechanism was replaced bySCRAM_SHA_1
in MongoDB 3.0, and is now deprecatedMONGODB_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(java.lang.String mechanismName)
Gets the mechanism by its name.java.lang.String
getMechanismName()
Get the mechanism name.java.lang.String
toString()
static AuthenticationMechanism
valueOf(java.lang.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.
-
PLAIN
public static final AuthenticationMechanism PLAIN
The PLAIN mechanism. See the RFC.
-
MONGODB_X509
public static final AuthenticationMechanism MONGODB_X509
The MongoDB X.509 mechanism. This mechanism is available only with client certificates over SSL.
-
MONGODB_CR
@Deprecated public static final AuthenticationMechanism 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
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(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
-
getMechanismName
public java.lang.String getMechanismName()
Get the mechanism name.- Returns:
- the mechanism name
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<AuthenticationMechanism>
-
fromMechanismName
public static AuthenticationMechanism fromMechanismName(java.lang.String mechanismName)
Gets the mechanism by its name.- Parameters:
mechanismName
- the mechanism name- Returns:
- the mechanism
- See Also:
getMechanismName()
-
-