@Immutable public final class MongoCredential extends Object
Modifier and Type | Field and Description |
---|---|
static String |
GSSAPI_MECHANISM
The GSSAPI mechanism.
|
static String |
MONGODB_CR_MECHANISM
The MongoDB Challenge Response mechanism.
|
Modifier and Type | Method and Description |
---|---|
static MongoCredential |
createGSSAPICredential(String userName)
Creates a MongoCredential instance for the GSSAPI SASL mechanism.
|
static MongoCredential |
createMongoCRCredential(String userName,
String database,
char[] password)
Creates a MongoCredential instance for the MongoDB Challenge Response protocol.
|
boolean |
equals(Object o) |
String |
getMechanism()
Gets the mechanism
|
char[] |
getPassword()
Gets the password.
|
String |
getSource()
Gets the source of the user name, typically the name of the database where the user is defined.
|
String |
getUserName()
Gets the user name
|
int |
hashCode() |
String |
toString() |
public static final String GSSAPI_MECHANISM
public static final String MONGODB_CR_MECHANISM
public static MongoCredential createMongoCRCredential(String userName, String database, char[] password)
userName
- the user namedatabase
- the database where the user is definedpassword
- the user's passwordpublic static MongoCredential createGSSAPICredential(String userName)
userName
- the user namepublic String getMechanism()
public String getUserName()
public String getSource()
public char[] getPassword()