Class AuthorizationCodeFlow.Builder

  • Enclosing class:
    AuthorizationCodeFlow

    public static class AuthorizationCodeFlow.Builder
    extends Object
    Authorization code flow builder.

    Implementation is not thread-safe.

    • 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,
                       String clientId,
                       String authorizationServerEncodedUrl)
        Parameters:
        method - method of presenting the access token to the resource server (for example BearerToken.authorizationHeaderAccessMethod())
        transport - HTTP transport
        jsonFactory - JSON factory
        tokenServerUrl - token server URL
        clientAuthentication - client authentication or null for none (see TokenRequest.setClientAuthentication(HttpExecuteInterceptor))
        clientId - client identifier
        authorizationServerEncodedUrl - authorization server encoded URL
    • Method Detail

      • build

        public AuthorizationCodeFlow build()
        Returns a new instance of an authorization code flow based on this builder.
      • 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
      • getClientId

        public final String getClientId()
        Returns the client identifier.
      • setClientId

        public AuthorizationCodeFlow.Builder setClientId​(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 String 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
      • getCredentialDataStore

        @Beta
        public final com.google.api.client.util.store.DataStore<StoredCredential> getCredentialDataStore()
        Beta
        Returns the stored credential data store or null for none.
        Since:
        1.16
      • getClock

        public final com.google.api.client.util.Clock getClock()
        Returns the clock passed along to the Credential or Clock.SYSTEM when 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.SYSTEM

        Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

        Since:
        1.9
      • getRequestInitializer

        public final com.google.api.client.http.HttpRequestInitializer getRequestInitializer()
        Returns the HTTP request initializer or null for none.
      • setRequestInitializer

        public AuthorizationCodeFlow.Builder setRequestInitializer​(com.google.api.client.http.HttpRequestInitializer requestInitializer)
        Sets the HTTP request initializer or null for 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​(Collection<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 Collection<String> getScopes()
        Returns a collection of scopes.
      • 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
      • 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