ParameterType
- defining the parameter type for the authenticationTokenType
- defining the token type for the authenticationpublic abstract class BasicAuthentication<ParameterType,TokenType> extends AbstractAuthenticationHandler<ParameterType,TokenType>
Authenticator
.Modifier and Type | Field and Description |
---|---|
protected byte[] |
password
The current password.
|
protected java.lang.String |
user
The current user name.
|
done, params, proxy
Constructor and Description |
---|
BasicAuthentication(java.net.InetSocketAddress proxy,
java.lang.String initialUser,
char[] initialPassword)
Creates a new
BasicAuthentication to authenticate with the given
proxy . |
Modifier and Type | Method and Description |
---|---|
protected void |
askCredentials()
Asks for credentials via the global
Authenticator . |
protected void |
clearPassword()
Clears the
password . |
void |
close() |
private byte[] |
convert(char[] pass) |
void |
process()
Produces the next authentication token, if any.
|
void |
start()
Produces the initial authentication token that can be then retrieved via
AuthenticationHandler.getToken() . |
isDone, setParams
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getToken
protected java.lang.String user
protected byte[] password
public BasicAuthentication(java.net.InetSocketAddress proxy, java.lang.String initialUser, char[] initialPassword)
BasicAuthentication
to authenticate with the given
proxy
.proxy
- InetSocketAddress
of the proxy to connect toinitialUser
- initial user name to try; may be null
initialPassword
- initial password to try, may be null
private byte[] convert(char[] pass)
protected void clearPassword()
password
.public final void close()
public final void start() throws java.lang.Exception
AuthenticationHandler
AuthenticationHandler.getToken()
.java.lang.Exception
- if an error occurspublic void process() throws java.lang.Exception
AuthenticationHandler
java.lang.Exception
- if an error occursprotected void askCredentials()
Authenticator
.