public final class AuthenticationBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<Authentication> |
authentications |
Constructor and Description |
---|
AuthenticationBuilder()
Creates a new authentication builder.
|
Modifier and Type | Method and Description |
---|---|
AuthenticationBuilder |
addCustom(Authentication authentication)
Adds custom authentication data to the authentication.
|
AuthenticationBuilder |
addHostnameVerifier(javax.net.ssl.HostnameVerifier verifier)
Adds a hostname verifier for SSL.
|
AuthenticationBuilder |
addNtlm(java.lang.String workstation,
java.lang.String domain)
Adds NTLM data to the authentication.
|
AuthenticationBuilder |
addPassword(char[] password)
Adds password data to the authentication.
|
AuthenticationBuilder |
addPassword(java.lang.String password)
Adds password data to the authentication.
|
AuthenticationBuilder |
addPrivateKey(java.lang.String pathname,
char[] passphrase)
Adds private key data to the authentication.
|
AuthenticationBuilder |
addPrivateKey(java.lang.String pathname,
java.lang.String passphrase)
Adds private key data to the authentication.
|
AuthenticationBuilder |
addSecret(java.lang.String key,
char[] value)
Adds sensitive custom string data to the authentication.
|
AuthenticationBuilder |
addSecret(java.lang.String key,
java.lang.String value)
Adds sensitive custom string data to the authentication.
|
AuthenticationBuilder |
addString(java.lang.String key,
java.lang.String value)
Adds custom string data to the authentication.
|
AuthenticationBuilder |
addUsername(java.lang.String username)
Adds username data to the authentication.
|
Authentication |
build()
Builds a new authentication object from the current data of this builder.
|
private final java.util.List<Authentication> authentications
public AuthenticationBuilder()
public Authentication build()
null
if no authentication data was supplied to the builder.public AuthenticationBuilder addUsername(java.lang.String username)
username
- The username, may be null
.null
.public AuthenticationBuilder addPassword(java.lang.String password)
password
- The password, may be null
.null
.public AuthenticationBuilder addPassword(char[] password)
password
- The password, may be null
.null
.public AuthenticationBuilder addNtlm(java.lang.String workstation, java.lang.String domain)
workstation
- The NTLM workstation name, may be null
.domain
- The NTLM domain name, may be null
.null
.public AuthenticationBuilder addPrivateKey(java.lang.String pathname, java.lang.String passphrase)
pathname
- The (absolute) path to the private key file, may be null
.passphrase
- The passphrase protecting the private key, may be null
.null
.public AuthenticationBuilder addPrivateKey(java.lang.String pathname, char[] passphrase)
pathname
- The (absolute) path to the private key file, may be null
.passphrase
- The passphrase protecting the private key, may be null
.null
.public AuthenticationBuilder addHostnameVerifier(javax.net.ssl.HostnameVerifier verifier)
addCustom(Authentication)
with a suitable implementation instead.verifier
- The hostname verifier, may be null
.null
.public AuthenticationBuilder addString(java.lang.String key, java.lang.String value)
addSecret(String, char[])
instead.key
- The key for the authentication data, must not be null
.value
- The value for the authentication data, may be null
.null
.public AuthenticationBuilder addSecret(java.lang.String key, java.lang.String value)
key
- The key for the authentication data, must not be null
.value
- The value for the authentication data, may be null
.null
.public AuthenticationBuilder addSecret(java.lang.String key, char[] value)
key
- The key for the authentication data, must not be null
.value
- The value for the authentication data, may be null
.null
.public AuthenticationBuilder addCustom(Authentication authentication)
authentication
- The authentication to add, may be null
.null
.