com.funambol.util
Interface HttpAuthentication

All Known Implementing Classes:
HttpDigestAuthentication

public interface HttpAuthentication

This interface represents a generic mechanism used by the HttpTransportAgent to get authenticated. Various authentication mechanism can be implemented, and each one must implement this interface which is then used by the transport agent.


Method Summary
 boolean getRetryWithAuth()
          Determines whether or not to retry sending a message, this time with authentication information.
 boolean handleAuthentication(HttpConnectionAdapter c)
          Handle the authentication by adding authentication headers to the given HttpConnection.
 boolean processHttpError(HttpConnectionAdapter c)
          Process any errors that the given HttpConnection has that are related to authentication.
 void setPassword(java.lang.String pass)
          Set the password to the given string.
 void setUri(java.lang.String uri)
          Set the authentication URI to the given string.
 void setUsername(java.lang.String user)
          Set the username to the given string.
 

Method Detail

handleAuthentication

boolean handleAuthentication(HttpConnectionAdapter c)
                             throws java.io.IOException
Handle the authentication by adding authentication headers to the given HttpConnection.

Parameters:
c - The HttpConnection to add authentication headers to.
Returns:
Whether or not authentication headers were added to the connection.
Throws:
java.io.IOException

processHttpError

boolean processHttpError(HttpConnectionAdapter c)
                         throws java.io.IOException
Process any errors that the given HttpConnection has that are related to authentication.

Parameters:
c - The HttpConnection to check for errors.
Returns:
Whether any errors were processed.
Throws:
java.io.IOException

getRetryWithAuth

boolean getRetryWithAuth()
Determines whether or not to retry sending a message, this time with authentication information.

Returns:
Whether or not to retry with authentication.

setUsername

void setUsername(java.lang.String user)
Set the username to the given string.

Parameters:
user - The new username.

setPassword

void setPassword(java.lang.String pass)
Set the password to the given string.

Parameters:
pass - The new password.

setUri

void setUri(java.lang.String uri)
Set the authentication URI to the given string.

Parameters:
uri - The new uri.


Copyright © 2001-2009 Funambol.