Class CloudDatastoreRemoteServiceConfig.Builder (2.0.0)

public abstract static class CloudDatastoreRemoteServiceConfig.Builder

Inheritance

java.lang.Object > CloudDatastoreRemoteServiceConfig.Builder

Constructors

Builder()

public Builder()

Methods

accessToken(String accessToken)

public abstract CloudDatastoreRemoteServiceConfig.Builder accessToken(String accessToken)

Sets the access token.

Cannot be combined with a call to #useComputeEngineCredential(boolean) or #useServiceAccountCredential(String, PrivateKey).

Parameter
NameDescription
accessTokenString
Returns
TypeDescription
CloudDatastoreRemoteServiceConfig.Builder

additionalAppIds(Set<CloudDatastoreRemoteServiceConfig.AppId> value)

public abstract CloudDatastoreRemoteServiceConfig.Builder additionalAppIds(Set<CloudDatastoreRemoteServiceConfig.AppId> value)

Provides a set of additional app IDs that may appear in Key values in entities.

This is only required if the client will read entities containing Key values that contain app IDs other than the one provided to #appId. Any such app IDs should be provided to this method.

Parameter
NameDescription
valueSet<AppId>
Returns
TypeDescription
CloudDatastoreRemoteServiceConfig.Builder

appId(CloudDatastoreRemoteServiceConfig.AppId value)

public abstract CloudDatastoreRemoteServiceConfig.Builder appId(CloudDatastoreRemoteServiceConfig.AppId value)

Sets the AppId of the Cloud Datastore instance to call. Required.

Parameter
NameDescription
valueCloudDatastoreRemoteServiceConfig.AppId
Returns
TypeDescription
CloudDatastoreRemoteServiceConfig.Builder

asyncStackTraceCaptureEnabled(boolean value)

public abstract CloudDatastoreRemoteServiceConfig.Builder asyncStackTraceCaptureEnabled(boolean value)

If set to true, stacktrace for async calls is captured and returned as part of error messages. There is overhead in capturing this stack trace and it is recommended to enable it primarily for debugging.

Parameter
NameDescription
valueboolean
Returns
TypeDescription
CloudDatastoreRemoteServiceConfig.Builder

build()

public CloudDatastoreRemoteServiceConfig build()
Returns
TypeDescription
CloudDatastoreRemoteServiceConfig

emulatorHost(String value)

public abstract CloudDatastoreRemoteServiceConfig.Builder emulatorHost(String value)

Instructs the client to connect to a locally-running Cloud Datastore Emulator and not to pass credentials.

Parameter
NameDescription
valueString
Returns
TypeDescription
CloudDatastoreRemoteServiceConfig.Builder

hostOverride(String value)

public abstract CloudDatastoreRemoteServiceConfig.Builder hostOverride(String value)

Overrides the host (e.g. datastore.googleapis.com) used to contact the Cloud Datastore API. To connect to the Cloud Datastore Emulator, use #emulatorHost instead.

Parameter
NameDescription
valueString
Returns
TypeDescription
CloudDatastoreRemoteServiceConfig.Builder

httpConnectTimeoutMillis(int value)

public abstract CloudDatastoreRemoteServiceConfig.Builder httpConnectTimeoutMillis(int value)

Sets the HTTP connect timeout in milliseconds.

Parameter
NameDescription
valueint
Returns
TypeDescription
CloudDatastoreRemoteServiceConfig.Builder

installApiProxyEnvironment(boolean value)

public abstract CloudDatastoreRemoteServiceConfig.Builder installApiProxyEnvironment(boolean value)

If set to true, a minimal Environment will be installed (if none is already installed).

If set to false, no attempt to install an environment will be made and the user must install it instead. At a minimum, such an environment must provide implementations for Environment#getAppId(), Environment#getAttributes(), and Environment#getRemainingMillis().

Parameter
NameDescription
valueboolean
Returns
TypeDescription
CloudDatastoreRemoteServiceConfig.Builder

maxRetries(int value)

public abstract CloudDatastoreRemoteServiceConfig.Builder maxRetries(int value)

Sets the maximum number of retries for underlying HTTP connect exceptions.

Parameter
NameDescription
valueint
Returns
TypeDescription
CloudDatastoreRemoteServiceConfig.Builder

useComputeEngineCredential(boolean value)

public abstract CloudDatastoreRemoteServiceConfig.Builder useComputeEngineCredential(boolean value)

If set to true, always use a Compute Engine credential instead of using the Application Default Credentials library to construct the credential.

Cannot be combined with a call to #useServiceAccountCredential(String, PrivateKey) or #accessToken(String).

Parameter
NameDescription
valueboolean
Returns
TypeDescription
CloudDatastoreRemoteServiceConfig.Builder

useServiceAccountCredential(String serviceAccountId, PrivateKey privateKey)

public CloudDatastoreRemoteServiceConfig.Builder useServiceAccountCredential(String serviceAccountId, PrivateKey privateKey)

Instructs the client to use a service account credential instead of using the Application Default Credentials library to construct the credential.

Cannot be combined with a call to #useComputeEngineCredential(boolean) or #accessToken(String).

Parameters
NameDescription
serviceAccountIdString
privateKeyPrivateKey
Returns
TypeDescription
CloudDatastoreRemoteServiceConfig.Builder