com.google.cloud.bigtable.grpc.io
Class CredentialInterceptorCache
- java.lang.Object
-
- com.google.cloud.bigtable.grpc.io.CredentialInterceptorCache
-
public class CredentialInterceptorCache extends Object
CachesRefreshingOAuth2CredentialsInterceptor
for default authorization cases. In other types of authorization, such as file based Credentials, it will create a new one.- Version:
- $Id: $Id
- Author:
- sduskis
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description io.grpc.ClientInterceptor
getCredentialsInterceptor(CredentialOptions credentialOptions, RetryOptions retryOptions)
GivenCredentialOptions
that define how to look up credentials, do the following: Look up the credentials If there are credentials, create a gRPC interceptor that gets OAuth2 security tokens and add that token as a header on all calls.static CredentialInterceptorCache
getInstance()
Getter for the fieldinstance
.
-
-
-
Method Detail
-
getInstance
public static CredentialInterceptorCache getInstance()
Getter for the fieldinstance
.- Returns:
- a
CredentialInterceptorCache
object.
-
getCredentialsInterceptor
public io.grpc.ClientInterceptor getCredentialsInterceptor(CredentialOptions credentialOptions, RetryOptions retryOptions) throws IOException, GeneralSecurityException
GivenCredentialOptions
that define how to look up credentials, do the following:- Look up the credentials
- If there are credentials, create a gRPC interceptor that gets OAuth2 security tokens and
add that token as a header on all calls.
NOTE:RefreshingOAuth2CredentialsInterceptor
ensures that the token stays fresh. It does token lookups asynchronously so that the calls themselves take as little performance penalty as possible. - Cache the interceptor in step #2 if the
CredentialOptions
uses default application credentials
- Parameters:
credentialOptions
- Defines how credentials should be achievedretryOptions
- aRetryOptions
object.- Returns:
- a HeaderInterceptor
- Throws:
IOException
- if any.GeneralSecurityException
- if any.
-
-