Class RemoteApiInstaller
java.lang.Object
com.google.appengine.tools.remoteapi.RemoteApiInstaller
Installs and uninstalls the remote API. While the RemoteApi is installed, all App Engine calls
made by the same thread that performed the installation will be sent to a remote server.
Instances of this class can only be used on a single thread.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of RPC calls made since the API was installed orresetRpcCount()was called.voidinstall(RemoteApiOptions options) Installs the remote API using the provided options.voidinstallOnAllThreads(RemoteApiOptions options) Installs the remote API on all threads using the provided options.voidStarts logging remote API method calls to the console.static org.apache.http.cookie.CookiemakeDevAppServerCookie(String hostname, String email) voidReturns a string containing the cookies associated with this connection.voidUninstalls the remote API.
-
Constructor Details
-
RemoteApiInstaller
public RemoteApiInstaller()
-
-
Method Details
-
installOnAllThreads
Installs the remote API on all threads using the provided options. Logs into the remote application using the credentials available via these options.Note that if installed using this method, the remote API cannot be uninstalled.
- Throws:
IllegalArgumentException- if the server or credentials weren't provided.IllegalStateException- if already installedLoginException- if unable to log in.IOException- if unable to connect to the remote API.
-
install
Installs the remote API using the provided options. Logs into the remote application using the credentials available via these options.Warning: This method only installs the remote API on the current thread. Do not share this instance across threads!
- Throws:
IllegalArgumentException- if the server or credentials weren't provided.IllegalStateException- if already installedLoginException- if unable to log in.IOException- if unable to connect to the remote API.
-
uninstall
public void uninstall()Uninstalls the remote API. If any async calls are in progress, waits for them to finish.If the remote API isn't installed, this method has no effect.
-
serializeCredentials
Returns a string containing the cookies associated with this connection. The string can be used to create a new connection without logging in again by usingRemoteApiOptions.reuseCredentials(java.lang.String, java.lang.String). By storing credentials to a file, we can avoid repeated password prompts in command-line tools. (Note that the cookies will expire based on the setting under Application Settings in the admin console.)Beware: it's important to keep this string private, as it allows admin access to the app as the current user.
-
logMethodCalls
public void logMethodCalls()Starts logging remote API method calls to the console. (Useful within tests.) -
resetRpcCount
public void resetRpcCount() -
getRpcCount
public int getRpcCount()Returns the number of RPC calls made since the API was installed orresetRpcCount()was called. -
makeDevAppServerCookie
-