Top Description Fields Constructors Methods
org.apache.http.auth

public Class AuthState

extends Object
Class Inheritance
Imports
java.util.Queue, org.apache.http.util.Args

This class provides detailed information about the state of the authentication process.
Since
4.0

Field Summary

Modifier and TypeField and Description
private Queue<AuthOption>
authOptions

Available auth options

private AuthScheme
authScheme

Actual authentication scheme

private AuthScope
authScope

Actual authentication scope

private Credentials
credentials

Credentials selected for authentication

private AuthProtocolState
state

Actual state of authentication protocol

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Queue<AuthOption>
getAuthOptions()

Returns available AuthOptions.

public AuthScheme
getAuthScheme()

Returns actual AuthScheme.

public AuthScope

Returns:

actual authentication scope if available, null otherwise
getAuthScope
()

Deprecated (4.2) do not use.
Returns actual AuthScope if available
public Credentials
getCredentials()

Returns actual Credentials.

public AuthProtocolState
public boolean
hasAuthOptions()

Returns true if AuthOptions are available, false otherwise.

public void
invalidate()

Deprecated (4.2) use reset()
Invalidates the authentication state by resetting its parameters.
public boolean
isConnectionBased()

Returns true if the actual authentication scheme is connection based.

public boolean
isValid()

Deprecated (4.2) do not use
public void
reset()

Resets the auth state.

public void
setAuthScheme(final AuthScheme authScheme)

Deprecated (4.2) use update(AuthScheme, Credentials)
Assigns the given authentication scheme.
public void
setAuthScope(final AuthScope
Authentication scope
authScope
)

Deprecated (4.2) do not use.
Sets actual AuthScope.
public void
setCredentials(final Credentials
User credentials
credentials
)

Deprecated (4.2) use update(AuthScheme, Credentials)
Sets user Credentials to be used for authentication
public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
update(final AuthScheme
auth scheme. May not be null.
authScheme
,
final Credentials
user crednetials. May not be null.
credentials
)

Updates the auth state with AuthScheme and Credentials.

public void
update(final Queue<AuthOption>
a queue of auth options. May not be null or empty.
authOptions
)

Updates the auth state with a queue of AuthOptions.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

authOptionsback to summary
private Queue<AuthOption> authOptions

Available auth options

authSchemeback to summary
private AuthScheme authScheme

Actual authentication scheme

authScopeback to summary
private AuthScope authScope

Actual authentication scope

credentialsback to summary
private Credentials credentials

Credentials selected for authentication

stateback to summary
private AuthProtocolState state

Actual state of authentication protocol

Constructor Detail

AuthStateback to summary
public AuthState()

Method Detail

getAuthOptionsback to summary
public Queue<AuthOption> getAuthOptions()

Returns available AuthOptions. May be null.

Since
4.2
getAuthSchemeback to summary
public AuthScheme getAuthScheme()

Returns actual AuthScheme. May be null.

getAuthScopeback to summary
public AuthScope getAuthScope()

Deprecated

(4.2) do not use.

Returns actual AuthScope if available

Returns:AuthScope

actual authentication scope if available, null otherwise

Annotations
@Deprecated
getCredentialsback to summary
public Credentials getCredentials()

Returns actual Credentials. May be null.

getStateback to summary
public AuthProtocolState getState()
Since
4.2
hasAuthOptionsback to summary
public boolean hasAuthOptions()

Returns true if AuthOptions are available, false otherwise.

Since
4.2
invalidateback to summary
public void invalidate()

Deprecated

(4.2) use reset()

Invalidates the authentication state by resetting its parameters.

Annotations
@Deprecated
isConnectionBasedback to summary
public boolean isConnectionBased()

Returns true if the actual authentication scheme is connection based.

Since
4.5.6
isValidback to summary
public boolean isValid()

Deprecated

(4.2) do not use

Annotations
@Deprecated
resetback to summary
public void reset()

Resets the auth state.

Since
4.2
setAuthSchemeback to summary
public void setAuthScheme(final AuthScheme authScheme)

Deprecated

(4.2) use update(AuthScheme, Credentials)

Assigns the given authentication scheme.

Parameters
authScheme:AuthScheme

the authentication scheme

Annotations
@Deprecated
setAuthScopeback to summary
public void setAuthScope(final AuthScope authScope)

Deprecated

(4.2) do not use.

Sets actual AuthScope.

Parameters
authScope:AuthScope

Authentication scope

Annotations
@Deprecated
setCredentialsback to summary
public void setCredentials(final Credentials credentials)

Deprecated

(4.2) use update(AuthScheme, Credentials)

Sets user Credentials to be used for authentication

Parameters
credentials:Credentials

User credentials

Annotations
@Deprecated
setStateback to summary
public void setState(final AuthProtocolState state)
Since
4.2
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
updateback to summary
public void update(final AuthScheme authScheme, final Credentials credentials)

Updates the auth state with AuthScheme and Credentials.

Parameters
authScheme:AuthScheme

auth scheme. May not be null.

credentials:Credentials

user crednetials. May not be null.

Since
4.2
updateback to summary
public void update(final Queue<AuthOption> authOptions)

Updates the auth state with a queue of AuthOptions.

Parameters
authOptions:Queue<AuthOption>

a queue of auth options. May not be null or empty.

Since
4.2