public static class AuthorizationCodeFlow.Builder extends Object
Implementation is not thread-safe.
Constructor and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
AuthorizationCodeFlow.Builder |
addRefreshListener(CredentialRefreshListener refreshListener)
Adds a listener for refresh token results.
|
AuthorizationCodeFlow |
build()
Returns a new instance of an authorization code flow based on this builder.
|
String |
getAuthorizationServerEncodedUrl()
Returns the authorization server encoded URL.
|
com.google.api.client.http.HttpExecuteInterceptor |
getClientAuthentication()
Returns the client authentication or
null for none (see
TokenRequest.setClientAuthentication(HttpExecuteInterceptor) ). |
String |
getClientId()
Returns the client identifier.
|
com.google.api.client.util.Clock |
getClock()
Returns the clock passed along to the Credential or
Clock.SYSTEM when system default
is used. |
AuthorizationCodeFlow.CredentialCreatedListener |
getCredentialCreatedListener()
Returns the credential created listener or
null for none. |
com.google.api.client.util.store.DataStore<StoredCredential> |
getCredentialDataStore()
Beta Returns the stored credential data store or null for none. |
CredentialStore |
getCredentialStore()
Deprecated.
(to be removed in the future) Use
getCredentialDataStore() instead. |
com.google.api.client.json.JsonFactory |
getJsonFactory()
Returns the JSON factory.
|
Credential.AccessMethod |
getMethod()
Returns the method of presenting the access token to the resource server (for example
BearerToken.authorizationHeaderAccessMethod() ). |
Collection<CredentialRefreshListener> |
getRefreshListeners()
Returns the listeners for refresh token results.
|
com.google.api.client.http.HttpRequestInitializer |
getRequestInitializer()
Returns the HTTP request initializer or
null for none. |
Collection<String> |
getScopes()
Returns a collection of scopes.
|
com.google.api.client.http.GenericUrl |
getTokenServerUrl()
Returns the token server URL.
|
com.google.api.client.http.HttpTransport |
getTransport()
Returns the HTTP transport.
|
AuthorizationCodeFlow.Builder |
setAuthorizationServerEncodedUrl(String authorizationServerEncodedUrl)
Sets the authorization server encoded URL.
|
AuthorizationCodeFlow.Builder |
setClientAuthentication(com.google.api.client.http.HttpExecuteInterceptor clientAuthentication)
Sets the client authentication or
null for none (see
TokenRequest.setClientAuthentication(HttpExecuteInterceptor) ). |
AuthorizationCodeFlow.Builder |
setClientId(String clientId)
Sets the client identifier.
|
AuthorizationCodeFlow.Builder |
setClock(com.google.api.client.util.Clock clock)
Sets the clock to pass to the Credential.
|
AuthorizationCodeFlow.Builder |
setCredentialCreatedListener(AuthorizationCodeFlow.CredentialCreatedListener credentialCreatedListener)
Sets the credential created listener or
null for none. |
AuthorizationCodeFlow.Builder |
setCredentialDataStore(com.google.api.client.util.store.DataStore<StoredCredential> credentialDataStore)
Beta Sets the stored credential data store or null for none. |
AuthorizationCodeFlow.Builder |
setCredentialStore(CredentialStore credentialStore)
Deprecated.
(to be removed in the future) Use
setDataStoreFactory(DataStoreFactory) or
setCredentialDataStore(DataStore) instead. |
AuthorizationCodeFlow.Builder |
setDataStoreFactory(com.google.api.client.util.store.DataStoreFactory dataStoreFactory)
Beta Sets the data store factory or null for none. |
AuthorizationCodeFlow.Builder |
setJsonFactory(com.google.api.client.json.JsonFactory jsonFactory)
Sets the JSON factory.
|
AuthorizationCodeFlow.Builder |
setMethod(Credential.AccessMethod method)
Sets the method of presenting the access token to the resource server (for example
BearerToken.authorizationHeaderAccessMethod() ). |
AuthorizationCodeFlow.Builder |
setRefreshListeners(Collection<CredentialRefreshListener> refreshListeners)
Sets the listeners for refresh token results.
|
AuthorizationCodeFlow.Builder |
setRequestInitializer(com.google.api.client.http.HttpRequestInitializer requestInitializer)
Sets the HTTP request initializer or
null for none. |
AuthorizationCodeFlow.Builder |
setScopes(Collection<String> scopes)
Sets the collection of scopes.
|
AuthorizationCodeFlow.Builder |
setTokenServerUrl(com.google.api.client.http.GenericUrl tokenServerUrl)
Sets the token server URL.
|
AuthorizationCodeFlow.Builder |
setTransport(com.google.api.client.http.HttpTransport transport)
Sets the HTTP transport.
|
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)
method
- method of presenting the access token to the resource server (for example
BearerToken.authorizationHeaderAccessMethod()
)transport
- HTTP transportjsonFactory
- JSON factorytokenServerUrl
- token server URLclientAuthentication
- client authentication or null
for none (see
TokenRequest.setClientAuthentication(HttpExecuteInterceptor)
)clientId
- client identifierauthorizationServerEncodedUrl
- authorization server encoded URLpublic AuthorizationCodeFlow build()
public final Credential.AccessMethod getMethod()
BearerToken.authorizationHeaderAccessMethod()
).public AuthorizationCodeFlow.Builder setMethod(Credential.AccessMethod method)
BearerToken.authorizationHeaderAccessMethod()
).
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final com.google.api.client.http.HttpTransport getTransport()
public AuthorizationCodeFlow.Builder setTransport(com.google.api.client.http.HttpTransport transport)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final com.google.api.client.json.JsonFactory getJsonFactory()
public AuthorizationCodeFlow.Builder setJsonFactory(com.google.api.client.json.JsonFactory jsonFactory)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final com.google.api.client.http.GenericUrl getTokenServerUrl()
public AuthorizationCodeFlow.Builder setTokenServerUrl(com.google.api.client.http.GenericUrl tokenServerUrl)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final com.google.api.client.http.HttpExecuteInterceptor getClientAuthentication()
null
for none (see
TokenRequest.setClientAuthentication(HttpExecuteInterceptor)
).public AuthorizationCodeFlow.Builder setClientAuthentication(com.google.api.client.http.HttpExecuteInterceptor clientAuthentication)
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.
public final String getClientId()
public AuthorizationCodeFlow.Builder setClientId(String clientId)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final String getAuthorizationServerEncodedUrl()
public AuthorizationCodeFlow.Builder setAuthorizationServerEncodedUrl(String authorizationServerEncodedUrl)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
@Beta @Deprecated public final CredentialStore getCredentialStore()
getCredentialDataStore()
instead.Beta
null
for none.@Beta public final com.google.api.client.util.store.DataStore<StoredCredential> getCredentialDataStore()
Beta
null
for none.public final com.google.api.client.util.Clock getClock()
Clock.SYSTEM
when system default
is used.public AuthorizationCodeFlow.Builder setClock(com.google.api.client.util.Clock clock)
The default value for this parameter is Clock.SYSTEM
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
@Beta @Deprecated public AuthorizationCodeFlow.Builder setCredentialStore(CredentialStore credentialStore)
setDataStoreFactory(DataStoreFactory)
or
setCredentialDataStore(DataStore)
instead.Beta
null
for none.
Warning: not compatible with setDataStoreFactory(com.google.api.client.util.store.DataStoreFactory)
or setCredentialDataStore(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 an
IllegalArgumentException
.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
@Beta public AuthorizationCodeFlow.Builder setDataStoreFactory(com.google.api.client.util.store.DataStoreFactory dataStoreFactory) throws IOException
Beta
null
for 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 an IllegalArgumentException
.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
IOException
@Beta public AuthorizationCodeFlow.Builder setCredentialDataStore(com.google.api.client.util.store.DataStore<StoredCredential> credentialDataStore)
Beta
null
for 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 an IllegalArgumentException
.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final com.google.api.client.http.HttpRequestInitializer getRequestInitializer()
null
for none.public AuthorizationCodeFlow.Builder setRequestInitializer(com.google.api.client.http.HttpRequestInitializer requestInitializer)
null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public AuthorizationCodeFlow.Builder setScopes(Collection<String> scopes)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
scopes
- collection of scopespublic final Collection<String> getScopes()
public AuthorizationCodeFlow.Builder setCredentialCreatedListener(AuthorizationCodeFlow.CredentialCreatedListener credentialCreatedListener)
null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public AuthorizationCodeFlow.Builder addRefreshListener(CredentialRefreshListener refreshListener)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
refreshListener
- refresh listenerpublic final Collection<CredentialRefreshListener> getRefreshListeners()
public AuthorizationCodeFlow.Builder setRefreshListeners(Collection<CredentialRefreshListener> refreshListeners)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final AuthorizationCodeFlow.CredentialCreatedListener getCredentialCreatedListener()
null
for none.Copyright © 2011–2021 Google. All rights reserved.