Class DatastoreOptions

java.lang.Object
com.google.datastore.v1.client.DatastoreOptions

public class DatastoreOptions extends Object
An immutable object containing settings for the datastore.

Example for connecting to a datastore:

 DatastoreOptions options = new DatastoreOptions.Builder()
     .projectId("my-project-id")
     .credential(DatastoreHelper.getComputeEngineCredential())
     .build();
 DatastoreFactory.get().create(options);
 

The options should be passed to DatastoreFactory.create(com.google.datastore.v1.client.DatastoreOptions).

  • Field Details

    • SCOPES

      public static final List<String> SCOPES
  • Method Details

    • getProjectId

      public String getProjectId()
    • getDatabaseId

      @BetaApi @Deprecated public String getDatabaseId()
      Deprecated.
      This field is ignored and will be removed in a future release. Please set the database id on the request itself. For example:
      
       CommitRequest.newBuilder()
           .setDatabaseId("my-database-id")
           ....
           .build();
       
    • getProjectEndpoint

      public String getProjectEndpoint()
    • getHost

      public String getHost()
    • getLocalHost

      public String getLocalHost()
    • getInitializer

      public com.google.api.client.http.HttpRequestInitializer getInitializer()
    • getCredential

      public com.google.api.client.auth.oauth2.Credential getCredential()
    • getTransport

      public com.google.api.client.http.HttpTransport getTransport()