RemoteApiOptions

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 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()
        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.
      • 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()