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 java.lang.Object implements CredentialsBuilder
Adds support fororg.apache.http.client.CredentialsProviderfor username and password in a configuration friendly way.This builds a
UsernamePasswordCredentialsunder 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 beNotBlank.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 Constructor Description UsernamePassword()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.http.auth.Credentialsbuild()Build theCredentialsobject.java.lang.StringgetPassword()The password.java.lang.StringgetUsername()The username.voidsetPassword(java.lang.String password)The password.voidsetUsername(java.lang.String username)The username.UsernamePasswordwithCredentials(java.lang.String user, java.lang.String password)
-
-
-
Method Detail
-
build
public org.apache.http.auth.Credentials build()
Description copied from interface:CredentialsBuilderBuild theCredentialsobject.- Specified by:
buildin interfaceCredentialsBuilder
-
withCredentials
public UsernamePassword withCredentials(java.lang.String user, java.lang.String password)
-
getUsername
public java.lang.String getUsername()
The username.
-
setUsername
public void setUsername(java.lang.String username)
The username.
-
getPassword
public java.lang.String getPassword()
The password.The password may be encoded and/or resolved from system properties / environment variables.
-
setPassword
public void setPassword(java.lang.String password)
The password.The password may be encoded and/or resolved from system properties / environment variables.
-
-