public static class ClientSideCredentialAccessBoundaryFactory.Builder
Builder for ClientSideCredentialAccessBoundaryFactory.
Use this builder to create instances of ClientSideCredentialAccessBoundaryFactory
with the desired configuration options.
Methods
build()
public ClientSideCredentialAccessBoundaryFactory build()
Creates a new ClientSideCredentialAccessBoundaryFactory
instance based on the current
builder configuration.
Returns | |
---|---|
Type | Description |
ClientSideCredentialAccessBoundaryFactory |
A new |
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 |
ClientSideCredentialAccessBoundaryFactory.Builder |
the builder |
setHttpTransportFactory(HttpTransportFactory transportFactory)
public ClientSideCredentialAccessBoundaryFactory.Builder setHttpTransportFactory(HttpTransportFactory transportFactory)
Sets the HTTP transport factory.
Parameter | |
---|---|
Name | Description |
transportFactory |
HttpTransportFactory the |
Returns | |
---|---|
Type | Description |
ClientSideCredentialAccessBoundaryFactory.Builder |
this |
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 |
Duration The minimum acceptable lifetime for a generated downscoped access token. Must be greater than zero. |
Returns | |
---|---|
Type | Description |
ClientSideCredentialAccessBoundaryFactory.Builder |
This |
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 |
Duration The refresh margin. Must be greater than zero. |
Returns | |
---|---|
Type | Description |
ClientSideCredentialAccessBoundaryFactory.Builder |
This |
setSourceCredential(GoogleCredentials sourceCredential)
public ClientSideCredentialAccessBoundaryFactory.Builder setSourceCredential(GoogleCredentials sourceCredential)
Sets the required source credential.
Parameter | |
---|---|
Name | Description |
sourceCredential |
GoogleCredentials the |
Returns | |
---|---|
Type | Description |
ClientSideCredentialAccessBoundaryFactory.Builder |
this |
setUniverseDomain(String universeDomain)
public ClientSideCredentialAccessBoundaryFactory.Builder setUniverseDomain(String universeDomain)
Sets the optional universe domain.
Parameter | |
---|---|
Name | Description |
universeDomain |
String the universe domain to set |
Returns | |
---|---|
Type | Description |
ClientSideCredentialAccessBoundaryFactory.Builder |
this |