Interface ApiProxy.Environment

All Known Subinterfaces:
ApiProxy.EnvironmentWithTrace
Enclosing class:
ApiProxy

public static interface ApiProxy.Environment
Environment is a simple data container that provides additional information about the current request (e.g. who is logged in, are they an administrator, etc.).
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the application identifier for the current application.
    Get a Map containing any attributes that have been set in this Environment.
    Returns the domain used for authentication.
    Gets the email address of the currently logged-in user.
    Gets the module identifier for the current application instance.
    long
    Gets the remaining number of milliseconds left before this request receives a DeadlineExceededException from App Engine.
    Deprecated.
    Use NamespaceManager.getGoogleAppsNamespace()
    Gets the version identifier for the current application version.
    boolean
    Returns true if the currently logged-in user is an administrator.
    boolean
    Returns true if the user is logged in.
  • Method Details

    • getAppId

      String getAppId()
      Gets the application identifier for the current application.
    • getModuleId

      String getModuleId()
      Gets the module identifier for the current application instance.
    • getVersionId

      String getVersionId()
      Gets the version identifier for the current application version. Result is of the form <major>.<minor> where <major> is the version name supplied at deploy time and <minor> is a timestamp value maintained by App Engine.
    • getEmail

      String getEmail()
      Gets the email address of the currently logged-in user.
    • isLoggedIn

      boolean isLoggedIn()
      Returns true if the user is logged in.
    • isAdmin

      boolean isAdmin()
      Returns true if the currently logged-in user is an administrator.
    • getAuthDomain

      String getAuthDomain()
      Returns the domain used for authentication.
    • getRequestNamespace

      @Deprecated String getRequestNamespace()
      Deprecated.
      Use NamespaceManager.getGoogleAppsNamespace()
    • getAttributes

      Map<String,Object> getAttributes()
      Get a Map containing any attributes that have been set in this Environment. The returned Map is mutable and is a useful place to store transient, per-request information.
    • getRemainingMillis

      long getRemainingMillis()
      Gets the remaining number of milliseconds left before this request receives a DeadlineExceededException from App Engine. This API can be used for planning how much work you can reasonably accomplish before the soft deadline kicks in.

      If there is no deadline for the request, then this will reply with Long.MAX_VALUE.