FileDocCategorySizeDatePackage
AuthState.javaAPI DocAndroid 1.5 API4245Wed May 06 22:41:10 BST 2009org.apache.http.auth

AuthState

public class AuthState extends Object
This class provides detailed information about the state of the authentication process.
author
Oleg Kalnichevski
since
4.0

Fields Summary
private AuthScheme
authScheme
Actual authentication scheme
private AuthScope
authScope
Actual authentication scope
private Credentials
credentials
Credentials selected for authentication
Constructors Summary
public AuthState()
Default constructor.

        super();
    
Methods Summary
public org.apache.http.auth.AuthSchemegetAuthScheme()
Returns the {@link AuthScheme authentication scheme}.

return
{@link AuthScheme authentication scheme}

        return this.authScheme;
    
public org.apache.http.auth.AuthScopegetAuthScope()
Returns actual {@link AuthScope} if available

return
actual authentication scope if available, null

        return this.authScope;
     
public org.apache.http.auth.CredentialsgetCredentials()
Returns user {@link Credentials} selected for authentication if available

return
user credentials if available, null

        return this.credentials;
    
public voidinvalidate()
Invalidates the authentication state by resetting its parameters.

        this.authScheme = null;
        this.authScope = null;
        this.credentials = null;
    
public booleanisValid()

        return this.authScheme != null;
    
public voidsetAuthScheme(org.apache.http.auth.AuthScheme authScheme)
Assigns the given {@link AuthScheme authentication scheme}.

param
authScheme the {@link AuthScheme authentication scheme}

        if (authScheme == null) {
            invalidate();
            return;
        }
        this.authScheme = authScheme;
    
public voidsetAuthScope(org.apache.http.auth.AuthScope authScope)
Sets actual {@link AuthScope}.

param
authScope Authentication scope

        this.authScope = authScope;
     
public voidsetCredentials(org.apache.http.auth.Credentials credentials)
Sets user {@link Credentials} to be used for authentication

param
credentials User credentials

        this.credentials = credentials;
    
public java.lang.StringtoString()

        StringBuilder buffer = new StringBuilder();
        buffer.append("auth scope [");
        buffer.append(this.authScope);
        buffer.append("]; credentials set [");
        buffer.append(this.credentials != null ? "true" : "false");
        buffer.append("]");
        return buffer.toString();