com.dtolabs.client.utils
Interface HttpAuthenticator

All Known Implementing Classes:
BaseFormAuthenticator, WebserviceFormAuthenticator

public interface HttpAuthenticator

ColonyHttpAuthenticator is the interface for an authentication module for use by a CommanderHttpClient instance.


Method Summary
 boolean authenticate(java.net.URL reqUrl, org.apache.commons.httpclient.HttpClient client)
          Authenticate the client http state so that the colony requests can be made.
 java.lang.String getUsername()
          Gets the user login name used when instantiating the authenticator
 boolean needsReAuthentication(int resultCode, org.apache.commons.httpclient.HttpMethod method)
          Return true if the result from the get method indicates re-authentication is needed
 

Method Detail

authenticate

boolean authenticate(java.net.URL reqUrl,
                     org.apache.commons.httpclient.HttpClient client)
                     throws HttpClientException
Authenticate the client http state so that the colony requests can be made.

Parameters:
reqUrl - URL requested for colony
client - HttpClient instance
Returns:
true if authentication succeeded.
Throws:
HttpClientException

getUsername

java.lang.String getUsername()
Gets the user login name used when instantiating the authenticator

Returns:
Login name

needsReAuthentication

boolean needsReAuthentication(int resultCode,
                              org.apache.commons.httpclient.HttpMethod method)
Return true if the result from the get method indicates re-authentication is needed

Parameters:
resultCode - result code
method - request
Returns:
true if re-authentication is needed