Package org.apache.iceberg.rest.auth
Class OAuth2Util.AuthSession
- java.lang.Object
- 
- org.apache.iceberg.rest.auth.OAuth2Util.AuthSession
 
- 
- Enclosing class:
- OAuth2Util
 
 public static class OAuth2Util.AuthSession extends java.lang.ObjectClass to handle authorization headers and token refresh.
- 
- 
Constructor SummaryConstructors Constructor Description AuthSession(java.util.Map<java.lang.String,java.lang.String> baseHeaders, java.lang.String token, java.lang.String tokenType)Deprecated.will be removed in 1.3.0; useAuthSession(Map, String, String, String, String)instead.AuthSession(java.util.Map<java.lang.String,java.lang.String> baseHeaders, java.lang.String token, java.lang.String tokenType, java.lang.String credential, java.lang.String scope)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringcredential()static OAuth2Util.AuthSessionempty()A newOAuth2Util.AuthSessionwith empty headers.java.lang.LongexpiresAtMillis()static OAuth2Util.AuthSessionfromAccessToken(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, java.lang.String token, java.lang.Long defaultExpiresAtMillis, OAuth2Util.AuthSession parent)static OAuth2Util.AuthSessionfromCredential(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, java.lang.String credential, OAuth2Util.AuthSession parent)static OAuth2Util.AuthSessionfromTokenExchange(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, java.lang.String token, java.lang.String tokenType, OAuth2Util.AuthSession parent)static OAuth2Util.AuthSessionfromTokenResponse(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, OAuthTokenResponse response, long startTimeMillis, OAuth2Util.AuthSession parent)java.util.Map<java.lang.String,java.lang.String>headers()Pair<java.lang.Integer,java.util.concurrent.TimeUnit>refresh(RESTClient client)Attempt to refresh the session token using the token exchange flow.java.lang.Stringscope()voidstopRefreshing()java.lang.Stringtoken()java.lang.StringtokenType()
 
- 
- 
- 
Constructor Detail- 
AuthSession@Deprecated public AuthSession(java.util.Map<java.lang.String,java.lang.String> baseHeaders, java.lang.String token, java.lang.String tokenType)Deprecated.will be removed in 1.3.0; useAuthSession(Map, String, String, String, String)instead.
 - 
AuthSessionpublic AuthSession(java.util.Map<java.lang.String,java.lang.String> baseHeaders, java.lang.String token, java.lang.String tokenType, java.lang.String credential, java.lang.String scope)
 
- 
 - 
Method Detail- 
headerspublic java.util.Map<java.lang.String,java.lang.String> headers() 
 - 
tokenpublic java.lang.String token() 
 - 
tokenTypepublic java.lang.String tokenType() 
 - 
expiresAtMillispublic java.lang.Long expiresAtMillis() 
 - 
scopepublic java.lang.String scope() 
 - 
stopRefreshingpublic void stopRefreshing() 
 - 
credentialpublic java.lang.String credential() 
 - 
emptypublic static OAuth2Util.AuthSession empty() A newOAuth2Util.AuthSessionwith empty headers.- Returns:
- A new OAuth2Util.AuthSessionwith empty headers.
 
 - 
refreshpublic Pair<java.lang.Integer,java.util.concurrent.TimeUnit> refresh(RESTClient client) Attempt to refresh the session token using the token exchange flow.- Parameters:
- client- a RESTClient
- Returns:
- interval to wait before calling refresh again, or null if no refresh is needed
 
 - 
fromAccessTokenpublic static OAuth2Util.AuthSession fromAccessToken(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, java.lang.String token, java.lang.Long defaultExpiresAtMillis, OAuth2Util.AuthSession parent) 
 - 
fromCredentialpublic static OAuth2Util.AuthSession fromCredential(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, java.lang.String credential, OAuth2Util.AuthSession parent) 
 - 
fromTokenResponsepublic static OAuth2Util.AuthSession fromTokenResponse(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, OAuthTokenResponse response, long startTimeMillis, OAuth2Util.AuthSession parent) 
 - 
fromTokenExchangepublic static OAuth2Util.AuthSession fromTokenExchange(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, java.lang.String token, java.lang.String tokenType, OAuth2Util.AuthSession parent) 
 
- 
 
-