public static class Credential.Builder extends Object
Credential
.Modifier and Type | Field and Description |
---|---|
protected String |
myAuthenticationType
The authentication type or mode that the credential should be used
with.
|
protected Authenticator |
myAuthenticator
The template authenticator for the credential.
|
protected String |
myDatabase
The database the credential are valid for.
|
protected File |
myFile
The file containing the full credentials.
|
protected char[] |
myPassword
The password for the credential set.
|
protected String |
myUserName
The user name for the credential set.
|
Constructor and Description |
---|
Credential.Builder()
Creates a new Builder.
|
Modifier and Type | Method and Description |
---|---|
Credential.Builder |
authenticationType(String authenticationType)
Sets the value of the authentication type or mode that the credential
should be used with.
|
Credential.Builder |
authenticator(Authenticator authenticator)
Sets the value of the template authenticator for the credential.
|
Credential |
build()
Creates the credential from this builder.
|
Credential.Builder |
database(String database)
Sets the value of the database the credential are valid for.
|
Credential.Builder |
file(File file)
Sets the value of the file containing the full credentials.
|
Credential.Builder |
kerberos()
Sets the value of the authentication type or mode that the credential
should be used with to Kerberos.
|
Credential.Builder |
mongodbCR()
Sets the value of the authentication type or mode that the credential
should be used with to MongoDB Challenge/Response.
|
Credential.Builder |
password(char[] password)
Sets the value of the password for the credential set.
|
Credential.Builder |
reset()
Resets the builder to a known state.
|
Credential.Builder |
setAuthenticationType(String authenticationType)
Sets the value of the authentication type or mode that the credential
should be used with.
|
Credential.Builder |
setAuthenticator(Authenticator authenticator)
Sets the value of the template authenticator for the credential.
|
Credential.Builder |
setDatabase(String database)
Sets the value of the database the credential are valid for.
|
Credential.Builder |
setFile(File file)
Sets the value of the file containing the full credentials.
|
Credential.Builder |
setPassword(char[] password)
Sets the value of the password for the credential set.
|
Credential.Builder |
setUserName(String userName)
Sets the value of the user name for the credential set.
|
Credential.Builder |
userName(String userName)
Sets the value of the user name for the credential set.
|
protected String myAuthenticationType
protected Authenticator myAuthenticator
protected String myDatabase
protected File myFile
protected char[] myPassword
protected String myUserName
public Credential.Builder authenticationType(String authenticationType)
This method delegates to setAuthenticationType(String)
.
authenticationType
- The new value for the authentication type or mode that the
credential should be used with.Credential.Builder
for method chaining.public Credential.Builder authenticator(Authenticator authenticator)
This method delegates to setAuthenticator(Authenticator)
.
authenticator
- The new value for the template authenticator for the
credential.Credential.Builder
for method chaining.public Credential build()
Credential
populated with the state of this
builder.public Credential.Builder database(String database)
This method delegates to setDatabase(String)
.
database
- The new value for the database the credential are valid
for.Credential.Builder
for method chaining.public Credential.Builder file(File file)
This method delegates to setFile(File)
.
file
- The new value for the file containing the full
credentials.Credential.Builder
for method chaining.public Credential.Builder kerberos()
This method delegates to setAuthenticationType(KERBEROS)
.
Note: Use of the Kerberos for authentication requires the driver's extensions. See the Kerberos Usage Guide for details.
Credential.Builder
for method chaining.public Credential.Builder mongodbCR()
This method delegates to setAuthenticationType(MONGODB_CR)
.
Credential.Builder
for method chaining.public Credential.Builder password(char[] password)
This method delegates to setPassword(char[])
.
password
- The new value for the password for the credential set.Credential.Builder
for method chaining.public Credential.Builder reset()
Credential.Builder
for method chaining.public Credential.Builder setAuthenticationType(String authenticationType)
authenticationType
- The new value for the authentication type or mode that the
credential should be used with.Credential.Builder
for method chaining.public Credential.Builder setAuthenticator(Authenticator authenticator)
authenticator
- The new value for the template authenticator for the
credential.Credential.Builder
for method chaining.public Credential.Builder setDatabase(String database)
database
- The new value for the database the credential are valid
for.Credential.Builder
for method chaining.public Credential.Builder setFile(File file)
file
- The new value for the file containing the full
credentials.Credential.Builder
for method chaining.public Credential.Builder setPassword(char[] password)
password
- The new value for the password for the credential set.Credential.Builder
for method chaining.public Credential.Builder setUserName(String userName)
userName
- The new value for the user name for the credential set.Credential.Builder
for method chaining.public Credential.Builder userName(String userName)
This method delegates to setUserName(String)
.
userName
- The new value for the user name for the credential set.Credential.Builder
for method chaining.Copyright © 2011-2013 Allanbank Consulting, Inc.. All Rights Reserved.