com.google.appengine.tools.remoteapi
Class RemoteApiOptions

java.lang.Object
  extended by com.google.appengine.tools.remoteapi.RemoteApiOptions

public final 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),
     .credentials("username", "password does not matter");
 

Example for connecting to a deployed app:

 RemoteApiOptions options = new RemoteApiOptions()
     .server("myappid.appspot.com", 443),
     .credentials(adminUsername, adminPassword);
 

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


Constructor Summary
RemoteApiOptions()
           
 
Method Summary
 RemoteApiOptions appEngineContainer(boolean appEngineContainer)
          Set this to true in order to use the Remote API from within App Engine.
 RemoteApiOptions copy()
           
 RemoteApiOptions credentials(java.lang.String newUserEMail, java.lang.String newPassword)
          Sets a username and password to be used for logging in via the ClientLogin API.
 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()
           
 boolean isAppEngineContainer()
           
 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.
 
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

public RemoteApiOptions credentials(java.lang.String newUserEMail,
                                    java.lang.String newPassword)
Sets a username and password to be used for logging in via the ClientLogin API.


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.

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

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.


appEngineContainer

public RemoteApiOptions appEngineContainer(boolean appEngineContainer)
Set this to true in order to use the Remote API from within App Engine. All API calls except those initiated by the com.google.appengine.api.urlfetch.URLFetchService will be sent via the URLFetchService to a remote App Engine app for execution. API calls initiated by the URLFetchService will be executed locally.

Set this to false in order to use the Remote API outside of App Engine. All API calls will be sent via sockets to a remote App Engine app for execution. This is the default behavior.


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

isAppEngineContainer

public boolean isAppEngineContainer()