public static enum MongoDbDatabase.AuthenticationMechanism extends Enum<MongoDbDatabase.AuthenticationMechanism>
Enum Constant and Description |
---|
AUTO
Creates a MongoCredential instance with an unspecified mechanism.
|
PLAIN
The PLAIN mechanism.
|
SCRAM_SHA_1
The SCRAM-SHA-1 mechanism.
|
SCRAM_SHA_256
The SCRAM-SHA-256 mechanism.
|
Modifier and Type | Method and Description |
---|---|
static MongoDbDatabase.AuthenticationMechanism |
from(String str) |
static MongoDbDatabase.AuthenticationMechanism |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MongoDbDatabase.AuthenticationMechanism[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MongoDbDatabase.AuthenticationMechanism AUTO
If the server version is 4.0 or higher, the driver will negotiate with the server preferring the SCRAM-SHA-256 mechanism. 3.x servers will authenticate using SCRAM-SHA-1, older servers will authenticate using the MONGODB_CR mechanism.
public static final MongoDbDatabase.AuthenticationMechanism PLAIN
public static final MongoDbDatabase.AuthenticationMechanism SCRAM_SHA_1
public static final MongoDbDatabase.AuthenticationMechanism SCRAM_SHA_256
public static MongoDbDatabase.AuthenticationMechanism[] values()
for (MongoDbDatabase.AuthenticationMechanism c : MongoDbDatabase.AuthenticationMechanism.values()) System.out.println(c);
public static MongoDbDatabase.AuthenticationMechanism valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static MongoDbDatabase.AuthenticationMechanism from(String str)
Copyright © 2020. All rights reserved.