Class AuthorizationCodeFlow.Builder
- java.lang.Object
-
- com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
-
- Enclosing class:
- AuthorizationCodeFlow
public static class AuthorizationCodeFlow.Builder extends java.lang.ObjectAuthorization code flow builder.Implementation is not thread-safe.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.StringauthorizationServerEncodedUrlAuthorization server encoded URL.(package private) com.google.api.client.http.HttpExecuteInterceptorclientAuthenticationClient authentication ornullfor none (seeTokenRequest.setClientAuthentication(HttpExecuteInterceptor)).(package private) java.lang.StringclientIdClient identifier.(package private) com.google.api.client.util.ClockclockClock passed along to the Credential.(package private) AuthorizationCodeFlow.CredentialCreatedListenercredentialCreatedListenerCredential created listener ornullfor none.(package private) com.google.api.client.util.store.DataStore<StoredCredential>credentialDataStoreStored credential data store ornullfor none.(package private) CredentialStorecredentialStoreDeprecated.(package private) com.google.api.client.json.JsonFactoryjsonFactoryJSON factory.(package private) Credential.AccessMethodmethodMethod of presenting the access token to the resource server (for exampleBearerToken.authorizationHeaderAccessMethod()).(package private) java.util.Collection<CredentialRefreshListener>refreshListenersRefresh listeners provided by the client.(package private) com.google.api.client.http.HttpRequestInitializerrequestInitializerHTTP request initializer ornullfor none.(package private) java.util.Collection<java.lang.String>scopesCollection of scopes.(package private) com.google.api.client.http.GenericUrltokenServerUrlToken server URL.(package private) com.google.api.client.http.HttpTransporttransportHTTP transport.
-
Constructor Summary
Constructors Constructor 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, java.lang.String clientId, java.lang.String authorizationServerEncodedUrl)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AuthorizationCodeFlow.BuilderaddRefreshListener(CredentialRefreshListener refreshListener)Adds a listener for refresh token results.AuthorizationCodeFlowbuild()Returns a new instance of an authorization code flow based on this builder.java.lang.StringgetAuthorizationServerEncodedUrl()Returns the authorization server encoded URL.com.google.api.client.http.HttpExecuteInterceptorgetClientAuthentication()Returns the client authentication ornullfor none (seeTokenRequest.setClientAuthentication(HttpExecuteInterceptor)).java.lang.StringgetClientId()Returns the client identifier.com.google.api.client.util.ClockgetClock()Returns the clock passed along to the Credential orClock.SYSTEMwhen system default is used.AuthorizationCodeFlow.CredentialCreatedListenergetCredentialCreatedListener()Returns the credential created listener ornullfor none.com.google.api.client.util.store.DataStore<StoredCredential>getCredentialDataStore()Beta
Returns the stored credential data store ornullfor none.CredentialStoregetCredentialStore()Deprecated.(to be removed in the future) UsegetCredentialDataStore()instead.com.google.api.client.json.JsonFactorygetJsonFactory()Returns the JSON factory.Credential.AccessMethodgetMethod()Returns the method of presenting the access token to the resource server (for exampleBearerToken.authorizationHeaderAccessMethod()).java.util.Collection<CredentialRefreshListener>getRefreshListeners()Returns the listeners for refresh token results.com.google.api.client.http.HttpRequestInitializergetRequestInitializer()Returns the HTTP request initializer ornullfor none.java.util.Collection<java.lang.String>getScopes()Returns a collection of scopes.com.google.api.client.http.GenericUrlgetTokenServerUrl()Returns the token server URL.com.google.api.client.http.HttpTransportgetTransport()Returns the HTTP transport.AuthorizationCodeFlow.BuildersetAuthorizationServerEncodedUrl(java.lang.String authorizationServerEncodedUrl)Sets the authorization server encoded URL.AuthorizationCodeFlow.BuildersetClientAuthentication(com.google.api.client.http.HttpExecuteInterceptor clientAuthentication)Sets the client authentication ornullfor none (seeTokenRequest.setClientAuthentication(HttpExecuteInterceptor)).AuthorizationCodeFlow.BuildersetClientId(java.lang.String clientId)Sets the client identifier.AuthorizationCodeFlow.BuildersetClock(com.google.api.client.util.Clock clock)Sets the clock to pass to the Credential.AuthorizationCodeFlow.BuildersetCredentialCreatedListener(AuthorizationCodeFlow.CredentialCreatedListener credentialCreatedListener)Sets the credential created listener ornullfor none.AuthorizationCodeFlow.BuildersetCredentialDataStore(com.google.api.client.util.store.DataStore<StoredCredential> credentialDataStore)Beta
Sets the stored credential data store ornullfor none.AuthorizationCodeFlow.BuildersetCredentialStore(CredentialStore credentialStore)Deprecated.(to be removed in the future) UsesetDataStoreFactory(DataStoreFactory)orsetCredentialDataStore(DataStore)instead.AuthorizationCodeFlow.BuildersetDataStoreFactory(com.google.api.client.util.store.DataStoreFactory dataStoreFactory)Beta
Sets the data store factory ornullfor none.AuthorizationCodeFlow.BuildersetJsonFactory(com.google.api.client.json.JsonFactory jsonFactory)Sets the JSON factory.AuthorizationCodeFlow.BuildersetMethod(Credential.AccessMethod method)Sets the method of presenting the access token to the resource server (for exampleBearerToken.authorizationHeaderAccessMethod()).AuthorizationCodeFlow.BuildersetRefreshListeners(java.util.Collection<CredentialRefreshListener> refreshListeners)Sets the listeners for refresh token results.AuthorizationCodeFlow.BuildersetRequestInitializer(com.google.api.client.http.HttpRequestInitializer requestInitializer)Sets the HTTP request initializer ornullfor none.AuthorizationCodeFlow.BuildersetScopes(java.util.Collection<java.lang.String> scopes)Sets the collection of scopes.AuthorizationCodeFlow.BuildersetTokenServerUrl(com.google.api.client.http.GenericUrl tokenServerUrl)Sets the token server URL.AuthorizationCodeFlow.BuildersetTransport(com.google.api.client.http.HttpTransport transport)Sets the HTTP transport.
-
-
-
Field Detail
-
method
Credential.AccessMethod method
Method of presenting the access token to the resource server (for exampleBearerToken.authorizationHeaderAccessMethod()).
-
transport
com.google.api.client.http.HttpTransport transport
HTTP transport.
-
jsonFactory
com.google.api.client.json.JsonFactory jsonFactory
JSON factory.
-
tokenServerUrl
com.google.api.client.http.GenericUrl tokenServerUrl
Token server URL.
-
clientAuthentication
com.google.api.client.http.HttpExecuteInterceptor clientAuthentication
Client authentication ornullfor none (seeTokenRequest.setClientAuthentication(HttpExecuteInterceptor)).
-
clientId
java.lang.String clientId
Client identifier.
-
authorizationServerEncodedUrl
java.lang.String authorizationServerEncodedUrl
Authorization server encoded URL.
-
credentialStore
@Deprecated @Beta CredentialStore credentialStore
Deprecated.Credential persistence store ornullfor none.
-
credentialDataStore
@Beta com.google.api.client.util.store.DataStore<StoredCredential> credentialDataStore
Stored credential data store ornullfor none.
-
requestInitializer
com.google.api.client.http.HttpRequestInitializer requestInitializer
HTTP request initializer ornullfor none.
-
scopes
java.util.Collection<java.lang.String> scopes
Collection of scopes.
-
clock
com.google.api.client.util.Clock clock
Clock passed along to the Credential.
-
credentialCreatedListener
AuthorizationCodeFlow.CredentialCreatedListener credentialCreatedListener
Credential created listener ornullfor none.
-
refreshListeners
java.util.Collection<CredentialRefreshListener> refreshListeners
Refresh listeners provided by the client.
-
-
Constructor Detail
-
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, java.lang.String clientId, java.lang.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 Detail
-
build
public AuthorizationCodeFlow build()
Returns a new instance of an authorization code flow based on this builder.
-
getMethod
public final Credential.AccessMethod getMethod()
Returns the method of presenting the access token to the resource server (for exampleBearerToken.authorizationHeaderAccessMethod()).
-
setMethod
public AuthorizationCodeFlow.Builder setMethod(Credential.AccessMethod method)
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
public final java.lang.String getClientId()
Returns the client identifier.
-
setClientId
public AuthorizationCodeFlow.Builder setClientId(java.lang.String clientId)
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
public final java.lang.String getAuthorizationServerEncodedUrl()
Returns the authorization server encoded URL.
-
setAuthorizationServerEncodedUrl
public AuthorizationCodeFlow.Builder setAuthorizationServerEncodedUrl(java.lang.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
@Beta @Deprecated public final CredentialStore 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
public AuthorizationCodeFlow.Builder setClock(com.google.api.client.util.Clock clock)
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 java.io.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:
java.io.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
public AuthorizationCodeFlow.Builder setScopes(java.util.Collection<java.lang.String> scopes)
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
public final java.util.Collection<java.lang.String> 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
public AuthorizationCodeFlow.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.
- Parameters:
refreshListener- refresh listener- Since:
- 1.15
-
getRefreshListeners
public final java.util.Collection<CredentialRefreshListener> getRefreshListeners()
Returns the listeners for refresh token results.- Since:
- 1.15
-
setRefreshListeners
public AuthorizationCodeFlow.Builder setRefreshListeners(java.util.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
public final AuthorizationCodeFlow.CredentialCreatedListener getCredentialCreatedListener()
Returns the credential created listener ornullfor none.- Since:
- 1.14
-
-