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