com.google.appengine.tools.remoteapi

## Class RemoteApiOptions

- java.lang.Object
- - com.google.appengine.tools.remoteapi.RemoteApiOptions

-     public class RemoteApiOptions
      extends java.lang.Object

  A mutable object containing settings for installing the remote API.

  Example for connecting to a development app server:

       RemoteApiOptions options = new RemoteApiOptions()
           .server("localhost", 8888),
           .useDevelopmentServerCredential();

  Example for connecting to a deployed app:

       RemoteApiOptions options = new RemoteApiOptions()
           .server("myappid.appspot.com", 443),
           .useApplicationDefaultCredential();

  The options should be passed to `RemoteApiInstaller.install(com.google.appengine.tools.remoteapi.RemoteApiOptions)`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RemoteApiOptions()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `RemoteApiOptions` | `copy()`
    `RemoteApiOptions` | `credentials(java.lang.String newUserEMail, java.lang.String newPassword)` Deprecated. Use `useApplicationDefaultCredential()` or `useServiceAccountCredential` instead.
    `RemoteApiOptions` | `datastoreQueryFetchSize(int newValue)` When executing a datastore query, this is the number of results to fetch per HTTP request.
    `java.lang.String` | `getCredentialsToReuse()`
    `int` | `getDatastoreQueryFetchSize()`
    `java.lang.String` | `getHostname()`
    `int` | `getMaxConcurrentRequests()`
    `int` | `getMaxHttpResponseSize()`
    `java.lang.String` | `getPassword()`
    `int` | `getPort()`
    `java.lang.String` | `getRemoteApiPath()`
    `java.lang.String` | `getUserEmail()`
    `RemoteApiOptions` | `maxConcurrentRequests(int newValue)` This parameter controls the maximum number of async API requests that will be in flight at once.
    `RemoteApiOptions` | `maxHttpResponseSize(int newValue)` When making a remote call, this is the maximum size of the HTTP response.
    `RemoteApiOptions` | `remoteApiPath(java.lang.String newPath)` Sets the path used to access the remote API.
    `RemoteApiOptions` | `reuseCredentials(java.lang.String newUserEmail, java.lang.String serializedCredentials)` Reuses credentials from another AppEngineClient.
    `RemoteApiOptions` | `server(java.lang.String newHostname, int newPort)` Sets the host and port port where we will connect.
    `RemoteApiOptions` | `useApplicationDefaultCredential()` Use a Google Application Default credential for authentication.
    `RemoteApiOptions` | `useComputeEngineCredential()` Deprecated. Use `useApplicationDefaultCredential()`.
    `RemoteApiOptions` | `useDevelopmentServerCredential()` Use credentials appropriate for talking to the Development Server.
    `RemoteApiOptions` | `useServiceAccountCredential(java.lang.String serviceAccountId, java.security.PrivateKey privateKey)` Use a service account credential.
    `RemoteApiOptions` | `useServiceAccountCredential(java.lang.String serviceAccountId, java.lang.String p12PrivateKeyFile)` Use a service account credential.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RemoteApiOptions

          public RemoteApiOptions()

  - ### Method Detail

    - #### server

          public RemoteApiOptions server(java.lang.String newHostname,
                                         int newPort)

      Sets the host and port port where we will connect.

    - #### credentials

          @Deprecated
          public RemoteApiOptions credentials(java.lang.String newUserEMail,
                                                          java.lang.String newPassword)

      Deprecated. Use `useApplicationDefaultCredential()` or `useServiceAccountCredential` instead.
      Sets a username and password to be used for logging in via the ClientLogin API. Overrides any previously-provided credentials.

    - #### reuseCredentials

          public RemoteApiOptions reuseCredentials(java.lang.String newUserEmail,
                                                   java.lang.String serializedCredentials)

      Reuses credentials from another AppEngineClient. Credentials can only be reused from a client with the same hostname and user. Overrides any previously-provided credentials.
      Parameters:
        `newUserEmail` - the email address of the user we want to log in as.
        `serializedCredentials` - a string returned by calling `AppEngineClient.serializeCredentials()` on the previous client

    - #### useComputeEngineCredential

          @Deprecated
          public RemoteApiOptions useComputeEngineCredential()

      Deprecated. Use `useApplicationDefaultCredential()`.
      Use a Compute Engine credential for authentication. Overrides any previously-provided credentials.
      Returns:
        this `RemoteApiOptions` instance

    - #### useApplicationDefaultCredential

          public RemoteApiOptions useApplicationDefaultCredential()

      Use a Google Application Default credential for authentication. Overrides any previously-provided credentials.
      Returns:
        this `RemoteApiOptions` instance.
      See Also:
        Application Default Credentials

    - #### useServiceAccountCredential

          public RemoteApiOptions useServiceAccountCredential(java.lang.String serviceAccountId,
                                                              java.lang.String p12PrivateKeyFile)

      Use a service account credential. Overrides any previously-provided credentials.
      Parameters:
        `serviceAccountId` - service account ID (typically an e-mail address)
        `p12PrivateKeyFile` - p12 file containing a private key to use with the service account
      Returns:
        this `RemoteApiOptions` instance

    - #### useServiceAccountCredential

          public RemoteApiOptions useServiceAccountCredential(java.lang.String serviceAccountId,
                                                              java.security.PrivateKey privateKey)

      Use a service account credential. Overrides any previously-provided credentials.
      Parameters:
        `serviceAccountId` - service account ID (typically an e-mail address)
        `privateKey` - private key to use with the service account
      Returns:
        this `RemoteApiOptions` instance

    - #### useDevelopmentServerCredential

          public RemoteApiOptions useDevelopmentServerCredential()

      Use credentials appropriate for talking to the Development Server. Overrides any previously-provided credentials.
      Returns:
        this `RemoteApiOptions` instance

    - #### remoteApiPath

          public RemoteApiOptions remoteApiPath(java.lang.String newPath)

      Sets the path used to access the remote API. If not set, the default is /remote_api.

    - #### maxConcurrentRequests

          public RemoteApiOptions maxConcurrentRequests(int newValue)

      This parameter controls the maximum number of async API requests that will be in flight at once. Each concurrent request will likely be handled by a separate instance of your App. Having more instances increases throughput but may result in errors due to exceeding quota. Defaults to 5.

    - #### datastoreQueryFetchSize

          public RemoteApiOptions datastoreQueryFetchSize(int newValue)

      When executing a datastore query, this is the number of results to fetch per HTTP request. Increasing this value will reduce the number of round trips when running large queries, but too high a value can be wasteful when not all results are needed. Defaults to 500.

      (This value can be overridden by the code using the datastore API.)

    - #### maxHttpResponseSize

          public RemoteApiOptions maxHttpResponseSize(int newValue)

      When making a remote call, this is the maximum size of the HTTP response. The default is 33M. Normally there's no reason to change this. This setting has no effect when running in an App Engine container.

    - #### copy

          public RemoteApiOptions copy()

    - #### getHostname

          public java.lang.String getHostname()

    - #### getPort

          public int getPort()

    - #### getUserEmail

          public java.lang.String getUserEmail()

    - #### getPassword

          public java.lang.String getPassword()

    - #### getCredentialsToReuse

          public java.lang.String getCredentialsToReuse()

    - #### getRemoteApiPath

          public java.lang.String getRemoteApiPath()

    - #### getMaxConcurrentRequests

          public int getMaxConcurrentRequests()

    - #### getDatastoreQueryFetchSize

          public int getDatastoreQueryFetchSize()

    - #### getMaxHttpResponseSize

          public int getMaxHttpResponseSize()