Package org.apache.hc.client5.http.auth
Class AuthExchange
- java.lang.Object
-
- org.apache.hc.client5.http.auth.AuthExchange
-
public class AuthExchange extends java.lang.Object
This class represents the actual state of authentication handshake including the currentAuthScheme
used for request authorization as well as a collection of backup authentication options if available.- Since:
- 4.5
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AuthExchange.State
-
Field Summary
Fields Modifier and Type Field Description private java.util.Queue<AuthScheme>
authOptions
private AuthScheme
authScheme
private java.lang.String
pathPrefix
private AuthExchange.State
state
-
Constructor Summary
Constructors Constructor Description AuthExchange()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Queue<AuthScheme>
getAuthOptions()
Returns available auth options.AuthScheme
getAuthScheme()
Returns actualAuthScheme
.java.lang.String
getPathPrefix()
AuthExchange.State
getState()
boolean
isConnectionBased()
Returnstrue
if the actual authentication scheme is connection based.void
reset()
void
select(AuthScheme authScheme)
Resets the auth state withAuthScheme
and clears auth options.void
setOptions(java.util.Queue<AuthScheme> authOptions)
Updates the auth state with a queue of auth options.void
setPathPrefix(java.lang.String pathPrefix)
void
setState(AuthExchange.State state)
java.lang.String
toString()
-
-
-
Field Detail
-
state
private AuthExchange.State state
-
authScheme
private AuthScheme authScheme
-
authOptions
private java.util.Queue<AuthScheme> authOptions
-
pathPrefix
private java.lang.String pathPrefix
-
-
Method Detail
-
reset
public void reset()
-
getState
public AuthExchange.State getState()
-
setState
public void setState(AuthExchange.State state)
-
getAuthScheme
public AuthScheme getAuthScheme()
Returns actualAuthScheme
. May be null.
-
isConnectionBased
public boolean isConnectionBased()
Returnstrue
if the actual authentication scheme is connection based.
-
getPathPrefix
public java.lang.String getPathPrefix()
- Since:
- 5.2
-
setPathPrefix
public void setPathPrefix(java.lang.String pathPrefix)
- Since:
- 5.2
-
select
public void select(AuthScheme authScheme)
Resets the auth state withAuthScheme
and clears auth options.- Parameters:
authScheme
- auth scheme. May not be null.
-
getAuthOptions
public java.util.Queue<AuthScheme> getAuthOptions()
Returns available auth options. May be null.
-
setOptions
public void setOptions(java.util.Queue<AuthScheme> authOptions)
Updates the auth state with a queue of auth options.- Parameters:
authOptions
- a queue of auth options. May not be null or empty.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-