Class AuthorizationCodeFlow.Builder
- Enclosing class:
AuthorizationCodeFlow
Implementation is not thread-safe.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) StringAuthorization server encoded URL.(package private) com.google.api.client.http.HttpExecuteInterceptorClient authentication ornullfor none (seeTokenRequest.setClientAuthentication(HttpExecuteInterceptor)).(package private) StringClient identifier.(package private) com.google.api.client.util.ClockClock passed along to the Credential.(package private) AuthorizationCodeFlow.CredentialCreatedListenerCredential created listener ornullfor none.(package private) com.google.api.client.util.store.DataStore<StoredCredential> Stored credential data store ornullfor none.(package private) CredentialStoreDeprecated.(package private) com.google.api.client.json.JsonFactoryJSON factory.(package private) Credential.AccessMethodMethod of presenting the access token to the resource server (for exampleBearerToken.authorizationHeaderAccessMethod()).(package private) Collection<CredentialRefreshListener> Refresh listeners provided by the client.(package private) com.google.api.client.http.HttpRequestInitializerHTTP request initializer ornullfor none.(package private) Collection<String> Collection of scopes.(package private) com.google.api.client.http.GenericUrlToken server URL.(package private) com.google.api.client.http.HttpTransportHTTP transport. -
Constructor Summary
ConstructorsConstructorDescriptionBuilder(Credential.AccessMethod method, com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory, com.google.api.client.http.GenericUrl tokenServerUrl, com.google.api.client.http.HttpExecuteInterceptor clientAuthentication, String clientId, String authorizationServerEncodedUrl) -
Method Summary
Modifier and TypeMethodDescriptionaddRefreshListener(CredentialRefreshListener refreshListener) Adds a listener for refresh token results.build()Returns a new instance of an authorization code flow based on this builder.final StringReturns the authorization server encoded URL.final com.google.api.client.http.HttpExecuteInterceptorReturns the client authentication ornullfor none (seeTokenRequest.setClientAuthentication(HttpExecuteInterceptor)).final StringReturns the client identifier.final com.google.api.client.util.ClockgetClock()Returns the clock passed along to the Credential orClock.SYSTEMwhen system default is used.Returns the credential created listener ornullfor none.final com.google.api.client.util.store.DataStore<StoredCredential> Beta
Returns the stored credential data store ornullfor none.final CredentialStoreDeprecated.final com.google.api.client.json.JsonFactoryReturns the JSON factory.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 ornullfor none.final Collection<String> Returns a collection of scopes.final com.google.api.client.http.GenericUrlReturns the token server URL.final com.google.api.client.http.HttpTransportReturns the HTTP transport.setAuthorizationServerEncodedUrl(String authorizationServerEncodedUrl) Sets the authorization server encoded URL.setClientAuthentication(com.google.api.client.http.HttpExecuteInterceptor clientAuthentication) Sets the client authentication ornullfor none (seeTokenRequest.setClientAuthentication(HttpExecuteInterceptor)).setClientId(String clientId) Sets the client identifier.setClock(com.google.api.client.util.Clock clock) Sets the clock to pass to the Credential.setCredentialCreatedListener(AuthorizationCodeFlow.CredentialCreatedListener credentialCreatedListener) Sets the credential created listener ornullfor none.setCredentialDataStore(com.google.api.client.util.store.DataStore<StoredCredential> credentialDataStore) Beta
Sets the stored credential data store ornullfor none.setCredentialStore(CredentialStore credentialStore) Deprecated.(to be removed in the future) UsesetDataStoreFactory(DataStoreFactory)orsetCredentialDataStore(DataStore)instead.setDataStoreFactory(com.google.api.client.util.store.DataStoreFactory dataStoreFactory) Beta
Sets the data store factory ornullfor none.setJsonFactory(com.google.api.client.json.JsonFactory jsonFactory) Sets the JSON factory.setMethod(Credential.AccessMethod method) Sets the method of presenting the access token to the resource server (for exampleBearerToken.authorizationHeaderAccessMethod()).setRefreshListeners(Collection<CredentialRefreshListener> refreshListeners) Sets the listeners for refresh token results.setRequestInitializer(com.google.api.client.http.HttpRequestInitializer requestInitializer) Sets the HTTP request initializer ornullfor none.setScopes(Collection<String> scopes) Sets the collection of scopes.setTokenServerUrl(com.google.api.client.http.GenericUrl tokenServerUrl) Sets the token server URL.setTransport(com.google.api.client.http.HttpTransport transport) Sets the HTTP transport.
-
Field Details
-
method
Credential.AccessMethod methodMethod of presenting the access token to the resource server (for exampleBearerToken.authorizationHeaderAccessMethod()). -
transport
com.google.api.client.http.HttpTransport transportHTTP transport. -
jsonFactory
com.google.api.client.json.JsonFactory jsonFactoryJSON factory. -
tokenServerUrl
com.google.api.client.http.GenericUrl tokenServerUrlToken server URL. -
clientAuthentication
com.google.api.client.http.HttpExecuteInterceptor clientAuthenticationClient authentication ornullfor none (seeTokenRequest.setClientAuthentication(HttpExecuteInterceptor)). -
clientId
String clientIdClient identifier. -
authorizationServerEncodedUrl
String authorizationServerEncodedUrlAuthorization server encoded URL. -
credentialStore
Deprecated.Credential persistence store ornullfor none. -
credentialDataStore
Stored credential data store ornullfor none. -
requestInitializer
com.google.api.client.http.HttpRequestInitializer requestInitializerHTTP request initializer ornullfor none. -
scopes
Collection<String> scopesCollection of scopes. -
clock
com.google.api.client.util.Clock clockClock passed along to the Credential. -
credentialCreatedListener
AuthorizationCodeFlow.CredentialCreatedListener credentialCreatedListenerCredential created listener ornullfor none. -
refreshListeners
Collection<CredentialRefreshListener> refreshListenersRefresh listeners provided by the client.
-
-
Constructor Details
-
Builder
public Builder(Credential.AccessMethod method, com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory, com.google.api.client.http.GenericUrl tokenServerUrl, com.google.api.client.http.HttpExecuteInterceptor clientAuthentication, String clientId, String authorizationServerEncodedUrl) - Parameters:
method- method of presenting the access token to the resource server (for exampleBearerToken.authorizationHeaderAccessMethod())transport- HTTP transportjsonFactory- JSON factorytokenServerUrl- token server URLclientAuthentication- client authentication ornullfor none (seeTokenRequest.setClientAuthentication(HttpExecuteInterceptor))clientId- client identifierauthorizationServerEncodedUrl- authorization server encoded URL
-
-
Method Details
-
build
Returns a new instance of an authorization code flow based on this builder. -
getMethod
Returns the method of presenting the access token to the resource server (for exampleBearerToken.authorizationHeaderAccessMethod()). -
setMethod
Sets the method of presenting the access token to the resource server (for exampleBearerToken.authorizationHeaderAccessMethod()).Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Since:
- 1.11
-
getTransport
public final com.google.api.client.http.HttpTransport getTransport()Returns the HTTP transport. -
setTransport
public AuthorizationCodeFlow.Builder setTransport(com.google.api.client.http.HttpTransport transport) Sets the HTTP transport.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Since:
- 1.11
-
getJsonFactory
public final com.google.api.client.json.JsonFactory getJsonFactory()Returns the JSON factory. -
setJsonFactory
public AuthorizationCodeFlow.Builder setJsonFactory(com.google.api.client.json.JsonFactory jsonFactory) Sets the JSON factory.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Since:
- 1.11
-
getTokenServerUrl
public final com.google.api.client.http.GenericUrl getTokenServerUrl()Returns the token server URL. -
setTokenServerUrl
public AuthorizationCodeFlow.Builder setTokenServerUrl(com.google.api.client.http.GenericUrl tokenServerUrl) Sets the token server URL.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Since:
- 1.11
-
getClientAuthentication
public final com.google.api.client.http.HttpExecuteInterceptor getClientAuthentication()Returns the client authentication ornullfor none (seeTokenRequest.setClientAuthentication(HttpExecuteInterceptor)). -
setClientAuthentication
public AuthorizationCodeFlow.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.
- Since:
- 1.11
-
getClientId
Returns the client identifier. -
setClientId
Sets the client identifier.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Since:
- 1.11
-
getAuthorizationServerEncodedUrl
Returns the authorization server encoded URL. -
setAuthorizationServerEncodedUrl
public AuthorizationCodeFlow.Builder setAuthorizationServerEncodedUrl(String authorizationServerEncodedUrl) Sets the authorization server encoded URL.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Since:
- 1.11
-
getCredentialStore
Deprecated.(to be removed in the future) UsegetCredentialDataStore()instead.Beta
Returns the credential persistence store ornullfor none. -
getCredentialDataStore
@Beta public final com.google.api.client.util.store.DataStore<StoredCredential> getCredentialDataStore()Beta
Returns the stored credential data store ornullfor none.- Since:
- 1.16
-
getClock
public final com.google.api.client.util.Clock getClock()Returns the clock passed along to the Credential orClock.SYSTEMwhen system default is used.- Since:
- 1.9
-
setClock
Sets the clock to pass to the Credential.The default value for this parameter is
Clock.SYSTEMOverriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Since:
- 1.9
-
setCredentialStore
@Beta @Deprecated public AuthorizationCodeFlow.Builder setCredentialStore(CredentialStore credentialStore) Deprecated.(to be removed in the future) UsesetDataStoreFactory(DataStoreFactory)orsetCredentialDataStore(DataStore)instead.Beta
Sets the credential persistence store ornullfor none.Warning: not compatible with
setDataStoreFactory(com.google.api.client.util.store.DataStoreFactory)orsetCredentialDataStore(com.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>), and if either of those is called before this method is called, this method will throw anIllegalArgumentException.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
setDataStoreFactory
@Beta public AuthorizationCodeFlow.Builder setDataStoreFactory(com.google.api.client.util.store.DataStoreFactory dataStoreFactory) throws IOException Beta
Sets the data store factory ornullfor none.Warning: not compatible with
setCredentialStore(com.google.api.client.auth.oauth2.CredentialStore), and if it is called before this method is called, this method will throw anIllegalArgumentException.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Throws:
IOException- Since:
- 1.16
-
setCredentialDataStore
@Beta public AuthorizationCodeFlow.Builder setCredentialDataStore(com.google.api.client.util.store.DataStore<StoredCredential> credentialDataStore) Beta
Sets the stored credential data store ornullfor none.Warning: not compatible with
setCredentialStore(com.google.api.client.auth.oauth2.CredentialStore), and if it is called before this method is called, this method will throw anIllegalArgumentException.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Since:
- 1.16
-
getRequestInitializer
public final com.google.api.client.http.HttpRequestInitializer getRequestInitializer()Returns the HTTP request initializer ornullfor none. -
setRequestInitializer
public AuthorizationCodeFlow.Builder setRequestInitializer(com.google.api.client.http.HttpRequestInitializer requestInitializer) Sets the HTTP request initializer ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
setScopes
Sets the collection of scopes.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Parameters:
scopes- collection of scopes- Since:
- 1.15
-
getScopes
Returns a collection of scopes. -
setCredentialCreatedListener
public AuthorizationCodeFlow.Builder setCredentialCreatedListener(AuthorizationCodeFlow.CredentialCreatedListener credentialCreatedListener) Sets the credential created listener ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Since:
- 1.14
-
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- Since:
- 1.15
-
getRefreshListeners
Returns the listeners for refresh token results.- Since:
- 1.15
-
setRefreshListeners
public AuthorizationCodeFlow.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.
- Since:
- 1.15
-
getCredentialCreatedListener
Returns the credential created listener ornullfor none.- Since:
- 1.14
-
getCredentialDataStore()instead.