Class Credential.Builder
- Enclosing class:
Credential
Implementation is not thread-safe.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) com.google.api.client.http.HttpExecuteInterceptorClient authentication ornullfor none (seeTokenRequest.setClientAuthentication(HttpExecuteInterceptor)).(package private) com.google.api.client.util.ClockClock used for expiration checks.(package private) com.google.api.client.json.JsonFactoryJSON factory to use for parsing response for refresh token request ornullif not refreshing tokens.(package private) final Credential.AccessMethodMethod of presenting the access token to the resource server (for exampleBearerToken.AuthorizationHeaderAccessMethod).(package private) Collection<CredentialRefreshListener> Listeners for refresh token results.(package private) com.google.api.client.http.HttpRequestInitializerHTTP request initializer for refresh token requests to the token server ornullfor none.(package private) com.google.api.client.http.GenericUrlToken server URL ornullif not refreshing tokens.(package private) com.google.api.client.http.HttpTransportHTTP transport for executing refresh token request ornullif not refreshing tokens. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddRefreshListener(CredentialRefreshListener refreshListener) Adds a listener for refresh token results.build()Returns a new credential instance.final com.google.api.client.http.HttpExecuteInterceptorReturns the client authentication ornullfor none (seeTokenRequest.setClientAuthentication(HttpExecuteInterceptor)).final com.google.api.client.util.ClockgetClock()Returns the clock to use for expiration checks orClock.SYSTEMas default.final com.google.api.client.json.JsonFactoryReturns the JSON factory to use for parsing response for refresh token request ornullif not refreshing tokens.final Credential.AccessMethodReturns the method of presenting the access token to the resource server (for exampleBearerToken.AuthorizationHeaderAccessMethod).Returns the listeners for refresh token results.final com.google.api.client.http.HttpRequestInitializerReturns the HTTP request initializer for refresh token requests to the token server ornullfor none.final com.google.api.client.http.GenericUrlReturns the token server URL ornullif not refreshing tokens.final com.google.api.client.http.HttpTransportReturns the HTTP transport for executing refresh token request ornullif not refreshing tokens.setClientAuthentication(com.google.api.client.http.HttpExecuteInterceptor clientAuthentication) Sets the client authentication ornullfor none (seeTokenRequest.setClientAuthentication(HttpExecuteInterceptor)).setClock(com.google.api.client.util.Clock clock) Sets the clock to use for expiration checks.setJsonFactory(com.google.api.client.json.JsonFactory jsonFactory) Sets the JSON factory to use for parsing response for refresh token request ornullif not refreshing tokens.setRefreshListeners(Collection<CredentialRefreshListener> refreshListeners) Sets the listeners for refresh token results.setRequestInitializer(com.google.api.client.http.HttpRequestInitializer requestInitializer) Sets the HTTP request initializer for refresh token requests to the token server ornullfor none.setTokenServerEncodedUrl(String tokenServerEncodedUrl) Sets the encoded token server URL ornullif not refreshing tokens.setTokenServerUrl(com.google.api.client.http.GenericUrl tokenServerUrl) Sets the token server URL ornullif not refreshing tokens.setTransport(com.google.api.client.http.HttpTransport transport) Sets the HTTP transport for executing refresh token request ornullif not refreshing tokens.
-
Field Details
-
method
Method of presenting the access token to the resource server (for exampleBearerToken.AuthorizationHeaderAccessMethod). -
transport
com.google.api.client.http.HttpTransport transportHTTP transport for executing refresh token request ornullif not refreshing tokens. -
jsonFactory
com.google.api.client.json.JsonFactory jsonFactoryJSON factory to use for parsing response for refresh token request ornullif not refreshing tokens. -
tokenServerUrl
com.google.api.client.http.GenericUrl tokenServerUrlToken server URL ornullif not refreshing tokens. -
clock
com.google.api.client.util.Clock clockClock used for expiration checks. -
clientAuthentication
com.google.api.client.http.HttpExecuteInterceptor clientAuthenticationClient authentication ornullfor none (seeTokenRequest.setClientAuthentication(HttpExecuteInterceptor)). -
requestInitializer
com.google.api.client.http.HttpRequestInitializer requestInitializerHTTP request initializer for refresh token requests to the token server ornullfor none. -
refreshListeners
Collection<CredentialRefreshListener> refreshListenersListeners for refresh token results.
-
-
Constructor Details
-
Builder
- Parameters:
method- method of presenting the access token to the resource server (for exampleBearerToken.AuthorizationHeaderAccessMethod)
-
-
Method Details
-
build
Returns a new credential instance. -
getMethod
Returns the method of presenting the access token to the resource server (for exampleBearerToken.AuthorizationHeaderAccessMethod). -
getTransport
public final com.google.api.client.http.HttpTransport getTransport()Returns the HTTP transport for executing refresh token request ornullif not refreshing tokens. -
setTransport
Sets the HTTP transport for executing refresh token request ornullif not refreshing tokens.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getClock
public final com.google.api.client.util.Clock getClock()Returns the clock to use for expiration checks orClock.SYSTEMas default.- Since:
- 1.9
-
setClock
Sets the clock to use for expiration checks.The default value is Clock.SYSTEM.
- Since:
- 1.9
-
getJsonFactory
public final com.google.api.client.json.JsonFactory getJsonFactory()Returns the JSON factory to use for parsing response for refresh token request ornullif not refreshing tokens. -
setJsonFactory
Sets the JSON factory to use for parsing response for refresh token request ornullif not refreshing tokens.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getTokenServerUrl
public final com.google.api.client.http.GenericUrl getTokenServerUrl()Returns the token server URL ornullif not refreshing tokens. -
setTokenServerUrl
Sets the token server URL ornullif not refreshing tokens.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
setTokenServerEncodedUrl
Sets the encoded token server URL ornullif not refreshing tokens.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getClientAuthentication
public final com.google.api.client.http.HttpExecuteInterceptor getClientAuthentication()Returns the client authentication ornullfor none (seeTokenRequest.setClientAuthentication(HttpExecuteInterceptor)). -
setClientAuthentication
public Credential.Builder setClientAuthentication(com.google.api.client.http.HttpExecuteInterceptor clientAuthentication) Sets the client authentication ornullfor none (seeTokenRequest.setClientAuthentication(HttpExecuteInterceptor)).Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getRequestInitializer
public final com.google.api.client.http.HttpRequestInitializer getRequestInitializer()Returns the HTTP request initializer for refresh token requests to the token server ornullfor none. -
setRequestInitializer
public Credential.Builder setRequestInitializer(com.google.api.client.http.HttpRequestInitializer requestInitializer) Sets the HTTP request initializer for refresh token requests to the token server ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
addRefreshListener
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.
- Parameters:
refreshListener- refresh listener
-
getRefreshListeners
Returns the listeners for refresh token results. -
setRefreshListeners
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.
-