Google Cloud Firestore

<dependency>
	<groupId>org.eclipse.store</groupId>
	<artifactId>afs-googlecloud-firestore</artifactId>
	<version>1.4.0</version>
</dependency>
<dependency>
	<groupId>com.google.cloud</groupId>
	<artifactId>google-cloud-firestore</artifactId>
	<version>3.0.17</version>
</dependency>
Firestore firestore = ...
BlobStoreFileSystem fileSystem = BlobStoreFileSystem.New(
	GoogleCloudFirestoreConnector.Caching(client)
);
EmbeddedStorage.start(fileSystem.ensureDirectoryPath("storage"));

Configuration

When using external configuration Google Cloud Firestore can be set as follows.

eclipsestore.properties
# optional, enforces checks
storage-filesystem.target=googlecloud.firestore

storage-filesystem.googlecloud.firestore.credentials.type=default
storage-filesystem.googlecloud.firestore.database-id=my-database-id
storage-filesystem.googlecloud.firestore.project-id=my-project-id

Supported properties

Property Description Type

database-id

The database ID to use with this Firestore client.

String

emulator-host

The emulator host to use with this Firestore client.

String

host

The service host.

String

project-id

The project ID. If no project ID is set, the project ID from the environment will be used.

String

quota-project-id

The project ID that specifies the project used for quota and billing purposes.

String

credentials.type

The type of the credentials provider. Supported values are:

  • "none"
    No credentials are used.

  • "input-stream"
    Path of a JSON file stream. The stream can contain a Service Account key file in JSON format from the Google DevelopersConsole or a stored user credential using the format supported by the Cloud SDK.

  • "default"
    Returns the Application Default Credentials which are used to identify and authorize thewhole application. The following are searched (in order) to find the Application DefaultCredentials:

    1. Credentials file pointed to by the GOOGLE_APPLICATION_CREDENTIALS environment variable

    2. Credentials provided by the Google Cloud SDK.

      1. gcloud auth application-default login for user account credentials.

      2. gcloud auth application-default login --impersonate-service-account forimpersonated service account credentials.

    3. Google App Engine built-in credentials

    4. Google Cloud Shell built-in credentials

    5. Google Compute Engine built-in credentials

String

Depending on the amount of data and transactions, charges may apply depending on service usage. Please check with your service provider for details.