# Class ClientSideCredentialAccessBoundaryFactory.Builder (1.46.0)

1.46.0 (latest) 1.43.0 1.42.1 1.41.0 1.40.0 1.39.1 1.38.0 1.37.1 1.36.0 1.35.0 1.34.0 1.33.1 1.32.1 1.31.0 1.30.1 1.29.1-SNAPSHOT 1.28.0 1.27.0 1.26.0 1.25.0 1.24.1 1.20.0 1.19.0 1.18.0 1.7.0 1.6.1 1.4.0 1.3.0

    public static class ClientSideCredentialAccessBoundaryFactory.Builder

Builder for [ClientSideCredentialAccessBoundaryFactory](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.credentialaccessboundary.ClientSideCredentialAccessBoundaryFactory).

Use this builder to create instances of `ClientSideCredentialAccessBoundaryFactory`
with the desired configuration options.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> ClientSideCredentialAccessBoundaryFactory.Builder

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Methods

### build()

    public ClientSideCredentialAccessBoundaryFactory build()

Creates a new `ClientSideCredentialAccessBoundaryFactory` instance based on the current
builder configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.credentialaccessboundary.ClientSideCredentialAccessBoundaryFactory` | A new `ClientSideCredentialAccessBoundaryFactory` instance. |

### setClock(Clock clock)

    public ClientSideCredentialAccessBoundaryFactory.Builder setClock(Clock clock)

Set the clock for checking token expiry. Used for testing.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `clock` | `com.google.api.client.util.Clock` the clock to use. Defaults to the system clock |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.credentialaccessboundary.ClientSideCredentialAccessBoundaryFactory.Builder` | the builder |

### setHttpTransportFactory(HttpTransportFactory transportFactory)

    public ClientSideCredentialAccessBoundaryFactory.Builder setHttpTransportFactory(HttpTransportFactory transportFactory)

Sets the HTTP transport factory.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `transportFactory` | `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.http.HttpTransportFactory` the `HttpTransportFactory` to set |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.credentialaccessboundary.ClientSideCredentialAccessBoundaryFactory.Builder` | this `Builder` object |

### setMinimumTokenLifetime(Duration minimumTokenLifetime)

    public ClientSideCredentialAccessBoundaryFactory.Builder setMinimumTokenLifetime(Duration minimumTokenLifetime)

Sets the minimum acceptable lifetime for a generated downscoped access token.

This parameter ensures that any generated downscoped access token has a minimum validity
period. If the time remaining before the underlying credentials expire is less than this
value, the factory will perform a blocking refresh, meaning that it will wait until the
credentials are refreshed before generating a new downscoped token. This guarantees that the
generated token will be valid for at least `minimumTokenLifetime`. A reasonable value
should be chosen based on the expected duration of operations using the downscoped token. If
not set, the default value is defined by #DEFAULT_MINIMUM_TOKEN_LIFETIME.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `minimumTokenLifetime` | `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` The minimum acceptable lifetime for a generated downscoped access token. Must be greater than zero. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.credentialaccessboundary.ClientSideCredentialAccessBoundaryFactory.Builder` | This `Builder` object. |

### setRefreshMargin(Duration refreshMargin)

    public ClientSideCredentialAccessBoundaryFactory.Builder setRefreshMargin(Duration refreshMargin)

Sets the refresh margin for the underlying credentials.

This duration specifies how far in advance of the credentials' expiration time an
asynchronous refresh should be initiated. This refresh happens in the background, without
blocking the main thread. If not provided, it will default to the value defined by #DEFAULT_REFRESH_MARGIN.

Note: The `refreshMargin` must be at least one minute longer than the `
minimumTokenLifetime`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `refreshMargin` | `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` The refresh margin. Must be greater than zero. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.credentialaccessboundary.ClientSideCredentialAccessBoundaryFactory.Builder` | This `Builder` object. |

### setSourceCredential(GoogleCredentials sourceCredential)

    public ClientSideCredentialAccessBoundaryFactory.Builder setSourceCredential(GoogleCredentials sourceCredential)

Sets the required source credential.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `sourceCredential` | `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.GoogleCredentials` the `GoogleCredentials` to set. This is a **required** parameter. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.credentialaccessboundary.ClientSideCredentialAccessBoundaryFactory.Builder` | this `Builder` object for chaining. |

### setUniverseDomain(String universeDomain)

    public ClientSideCredentialAccessBoundaryFactory.Builder setUniverseDomain(String universeDomain)

Sets the optional universe domain.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `universeDomain` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` the universe domain to set |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.credentialaccessboundary.ClientSideCredentialAccessBoundaryFactory.Builder` | this `Builder` object |