Package interlok.http.apache.credentials
Class UsernamePassword
java.lang.Object
interlok.http.apache.credentials.UsernamePassword
- All Implemented Interfaces:
CredentialsBuilder
@ComponentProfile(summary="Providers username+password credentials")
public class UsernamePassword
extends Object
implements CredentialsBuilder
Adds support for
org.apache.http.client.CredentialsProvider
for username and password in a configuration
friendly way.
This builds a UsernamePasswordCredentials
under the covers, interestingly it allows you to have a non null
blank username; there should be no reason why you would want to do that, so validation on the username field is set
to be NotBlank
.
In the adapter configuration file this class is aliased as apache-http-username-password-credentials which is the preferred alternative to the fully qualified classname when building your configuration.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.http.auth.Credentials
build()
Build theCredentials
object.The password.The username.void
setPassword
(String password) The password.void
setUsername
(String username) The username.withCredentials
(String user, String password)
-
Constructor Details
-
UsernamePassword
public UsernamePassword()
-
-
Method Details
-
build
public org.apache.http.auth.Credentials build()Description copied from interface:CredentialsBuilder
Build theCredentials
object.- Specified by:
build
in interfaceCredentialsBuilder
-
withCredentials
-
getUsername
The username. -
setUsername
The username. -
getPassword
The password.The password may be encoded and/or resolved from system properties / environment variables.
-
setPassword
The password.The password may be encoded and/or resolved from system properties / environment variables.
-