public static class Credential.Builder
Credential builder.
Implementation is not thread-safe.
Constructors
Builder(Credential.AccessMethod method)
public Builder(Credential.AccessMethod method)
Name | Description |
method | Credential.AccessMethod method of presenting the access token to the resource server (for example BearerToken.AuthorizationHeaderAccessMethod) |
Methods
addRefreshListener(CredentialRefreshListener refreshListener)
public Credential.Builder addRefreshListener(CredentialRefreshListener refreshListener)
Adds a listener for refresh token results.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
refreshListener | CredentialRefreshListener refresh listener |
Type | Description |
Credential.Builder |
build()
public Credential build()
Returns a new credential instance.
Type | Description |
Credential |
getClientAuthentication()
public final HttpExecuteInterceptor getClientAuthentication()
Returns the client authentication or null
for none (see TokenRequest#setClientAuthentication(HttpExecuteInterceptor)).
Type | Description |
com.google.api.client.http.HttpExecuteInterceptor |
getClock()
public final Clock getClock()
Returns the clock to use for expiration checks or Clock#SYSTEM as default.
Type | Description |
com.google.api.client.util.Clock |
getJsonFactory()
public final JsonFactory getJsonFactory()
Returns the JSON factory to use for parsing response for refresh token request or
null
if not refreshing tokens.
Type | Description |
com.google.api.client.json.JsonFactory |
getMethod()
public final Credential.AccessMethod getMethod()
Returns the method of presenting the access token to the resource server (for example BearerToken.AuthorizationHeaderAccessMethod).
Type | Description |
Credential.AccessMethod |
getRefreshListeners()
public final Collection<CredentialRefreshListener> getRefreshListeners()
Returns the listeners for refresh token results.
Type | Description |
Collection<CredentialRefreshListener> |
getRequestInitializer()
public final HttpRequestInitializer getRequestInitializer()
Returns the HTTP request initializer for refresh token requests to the token server or
null
for none.
Type | Description |
com.google.api.client.http.HttpRequestInitializer |
getTokenServerUrl()
public final GenericUrl getTokenServerUrl()
Returns the token server URL or null
if not refreshing tokens.
Type | Description |
com.google.api.client.http.GenericUrl |
getTransport()
public final HttpTransport getTransport()
Returns the HTTP transport for executing refresh token request or null
if not
refreshing tokens.
Type | Description |
com.google.api.client.http.HttpTransport |
setClientAuthentication(HttpExecuteInterceptor clientAuthentication)
public Credential.Builder setClientAuthentication(HttpExecuteInterceptor clientAuthentication)
Sets the client authentication or null
for none (see TokenRequest#setClientAuthentication(HttpExecuteInterceptor)).
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
clientAuthentication | com.google.api.client.http.HttpExecuteInterceptor |
Type | Description |
Credential.Builder |
setClock(Clock clock)
public Credential.Builder setClock(Clock clock)
Sets the clock to use for expiration checks.
The default value is Clock.SYSTEM.
Name | Description |
clock | com.google.api.client.util.Clock |
Type | Description |
Credential.Builder |
setJsonFactory(JsonFactory jsonFactory)
public Credential.Builder setJsonFactory(JsonFactory jsonFactory)
Sets the JSON factory to use for parsing response for refresh token request or null
if not refreshing tokens.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
jsonFactory | com.google.api.client.json.JsonFactory |
Type | Description |
Credential.Builder |
setRefreshListeners(Collection<CredentialRefreshListener> refreshListeners)
public Credential.Builder setRefreshListeners(Collection<CredentialRefreshListener> refreshListeners)
Sets the listeners for refresh token results.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
refreshListeners | Collection<CredentialRefreshListener> |
Type | Description |
Credential.Builder |
setRequestInitializer(HttpRequestInitializer requestInitializer)
public Credential.Builder setRequestInitializer(HttpRequestInitializer requestInitializer)
Sets the HTTP request initializer for refresh token requests to the token server or
null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
requestInitializer | com.google.api.client.http.HttpRequestInitializer |
Type | Description |
Credential.Builder |
setTokenServerEncodedUrl(String tokenServerEncodedUrl)
public Credential.Builder setTokenServerEncodedUrl(String tokenServerEncodedUrl)
Sets the encoded token server URL or null
if not refreshing tokens.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
tokenServerEncodedUrl | String |
Type | Description |
Credential.Builder |
setTokenServerUrl(GenericUrl tokenServerUrl)
public Credential.Builder setTokenServerUrl(GenericUrl tokenServerUrl)
Sets the token server URL or null
if not refreshing tokens.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
tokenServerUrl | com.google.api.client.http.GenericUrl |
Type | Description |
Credential.Builder |
setTransport(HttpTransport transport)
public Credential.Builder setTransport(HttpTransport transport)
Sets the HTTP transport for executing refresh token request or null
if not refreshing
tokens.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
transport | com.google.api.client.http.HttpTransport |
Type | Description |
Credential.Builder |