Top Description Inners Fields Constructors Methods
org.apache.hc.client5.http.auth

public Class AuthExchange

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

This class represents the actual state of authentication handshake including the current AuthScheme used for request authorization as well as a collection of backup authentication options if available.
Since
4.5

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
private Queue<AuthScheme>
private AuthScheme
private String
private AuthExchange.State

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Returns available auth options.

public AuthScheme
getAuthScheme()

Returns actual AuthScheme.

public String
public AuthExchange.State
public boolean
isConnectionBased()

Returns true if the actual authentication scheme is connection based.

public void
public void
select(final AuthScheme
auth scheme. May not be null.
authScheme
)

Resets the auth state with AuthScheme and clears auth options.

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

Updates the auth state with a queue of auth options.

public void
setPathPrefix(final String pathPrefix)

public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

authOptionsback to summary
private Queue<AuthScheme> authOptions
authSchemeback to summary
private AuthScheme authScheme
pathPrefixback to summary
private String pathPrefix
stateback to summary
private AuthExchange.State state

Constructor Detail

AuthExchangeback to summary
public AuthExchange()

Method Detail

getAuthOptionsback to summary
public Queue<AuthScheme> getAuthOptions()

Returns available auth options. May be null.

getAuthSchemeback to summary
public AuthScheme getAuthScheme()

Returns actual AuthScheme. May be null.

getPathPrefixback to summary
public String getPathPrefix()
Since
5.2
getStateback to summary
public AuthExchange.State getState()
isConnectionBasedback to summary
public boolean isConnectionBased()

Returns true if the actual authentication scheme is connection based.

resetback to summary
public void reset()
selectback to summary
public void select(final AuthScheme authScheme)

Resets the auth state with AuthScheme and clears auth options.

Parameters
authScheme:AuthScheme

auth scheme. May not be null.

setOptionsback to summary
public void setOptions(final Queue<AuthScheme> authOptions)

Updates the auth state with a queue of auth options.

Parameters
authOptions:Queue<AuthScheme>

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

setPathPrefixback to summary
public void setPathPrefix(final String pathPrefix)
Since
5.2
setStateback to summary
public void setState(final AuthExchange.State state)
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
org.apache.hc.client5.http.auth back to summary

public final Enum AuthExchange.State

extends Enum<AuthExchange.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final AuthExchange.State
public static final AuthExchange.State
public static final AuthExchange.State
public static final AuthExchange.State
public static final AuthExchange.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static AuthExchange.State
public static AuthExchange.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CHALLENGEDback to summary
public static final AuthExchange.State CHALLENGED
FAILUREback to summary
public static final AuthExchange.State FAILURE
HANDSHAKEback to summary
public static final AuthExchange.State HANDSHAKE
SUCCESSback to summary
public static final AuthExchange.State SUCCESS
UNCHALLENGEDback to summary
public static final AuthExchange.State UNCHALLENGED

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static AuthExchange.State valueOf(String name)
valuesback to summary
public static AuthExchange.State[] values()