com.google.appengine.tools.admin
Interface AppAdmin


public interface AppAdmin

The application administration interface to App Engine. Use this API to update, configure, and otherwise manage an App Engine application. Use AppAdminFactory to retrieve an AppAdmin instance configured for a specific application.

Synchronous versus Asynchronous requests: Some requests, such as update(com.google.appengine.tools.admin.UpdateListener), occur asynchronously and must be monitored with a listener. Other requests, such as updateIndexes(), are made synchronously. In either case, work often continues to occur asynchronously on the remote server after the request has been completed.

Error handling: Most configuration operations require communicating to App Engine's remote administration server occur over a network connection. In cases where unrecoverable failures occur (such as a network failure), this API throws an AdminException.

Application updates occur transactionally. If a failure occurs during update, you must rollback() the incomplete transaction before beginning another.


Nested Class Summary
static class AppAdmin.LogSeverity
          The severity levels for App Engine application logging.
 
Method Summary
 java.util.List<CronEntry> cronInfo()
          Locally parses an application's configured cron entries and reports the upcoming several execution times.
 java.io.Reader requestLogs(int numDays, AppAdmin.LogSeverity severity)
          Retrieves application logs from the remote administration server.
 void rollback()
          Rolls back an "in-progress" transaction.
 void update(UpdateListener listener)
          Uploads a new version of the application and updates its indexes.
 void updateCron()
          Sends a synchronous request to update the application's cron jobs.
 void updateDos()
          Sends a synchronous request to update the application's DoS configuration.
 void updateIndexes()
          Sends a synchronous request to update the application's indexes.
 void updateQueues()
          Sends a synchronous request to update the application's task queue definitions.
 void vacuumIndexes(com.google.appengine.tools.admin.ConfirmationCallback<com.google.appengine.tools.admin.IndexDeleter.DeleteIndexAction> callback, UpdateListener listener)
          Performs the following three steps: Queries the remote administration server for existing indexes that are not included in the local index configuration file.
 

Method Detail

update

void update(UpdateListener listener)
Uploads a new version of the application and updates its indexes. The update occurs asynchronously, so an UpdateListener must be installed to track progress.

Parameters:
listener - The listener to be notified of updates. Must not be null.
Throws:
AdminException - if an error occurs.

rollback

void rollback()
Rolls back an "in-progress" transaction. This operation occurs synchronously.

Throws:
AdminException - if an error occurs.

updateIndexes

void updateIndexes()
Sends a synchronous request to update the application's indexes. This work completes asynchronously on the server.

Throws:
AdminException - if an error occurs.

updateCron

void updateCron()
Sends a synchronous request to update the application's cron jobs. This work completes synchronously on the server.

Throws:
AdminException - if an error occurs.

updateQueues

void updateQueues()
Sends a synchronous request to update the application's task queue definitions. This work completes synchronously on the server.

Throws:
AdminException - if an error occurs.

updateDos

void updateDos()
Sends a synchronous request to update the application's DoS configuration. This work completes synchronously on the server.

Throws:
AdminException - if an error occurs.

cronInfo

java.util.List<CronEntry> cronInfo()
Locally parses an application's configured cron entries and reports the upcoming several execution times.

Throws:
AdminException - if an error occurs.

vacuumIndexes

void vacuumIndexes(com.google.appengine.tools.admin.ConfirmationCallback<com.google.appengine.tools.admin.IndexDeleter.DeleteIndexAction> callback,
                   UpdateListener listener)
Performs the following three steps:
  1. Queries the remote administration server for existing indexes that are not included in the local index configuration file. We will refer to these as orphaned indexes.
  2. If callback is not null, then the confirmAction method will be called once for each of the orphaned indexes to confirm that it really should be deleted.
  3. A request will be sent to the server to delete each of the confirmed indexes. This work completes asynchronously on the server.

Parameters:
callback - Used to confirm deletions. May be null in which case no confirmation will be done.
listener - The listener to be notified of updates. Must not be null.
Throws:
AdminException - if an error occurs.

requestLogs

java.io.Reader requestLogs(int numDays,
                           AppAdmin.LogSeverity severity)
Retrieves application logs from the remote administration server.

Parameters:
numDays - The number of days to retrieve logs for. The cut-off point is midnight UTC. Use 0 to get all available logs.
severity - The severity of app-level log messages to get. If null, only request logs are returned.
Returns:
a non-null Reader which can be used to stream the logs from the remote administration server. You should close the Reader when you're finished reading logs. It is ok to close the Reader before all logs have been read (streaming from the server is cancelled).
Throws:
AdminException - if an error occurs.