Class 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 Detail

    • Method Detail

      • getProjectId

        public String getProjectId()
      • getDatabaseId

        @BetaApi
        public String getDatabaseId()
      • 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()