Java 8 has reached end of support
and will be
deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Java 8
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Java
8 applications will continue to run and receive traffic after their
deprecation date. We recommend that
you
migrate to the latest supported version of Java.
ApiProxy.Environment (Google App Engine API for Java)
Stay organized with collections
Save and categorize content based on your preferences.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods
Modifier and Type |
Method and Description |
java.lang.String |
getAppId()
Gets the application identifier for the current application.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Get a Map containing any attributes that have been set in this
Environment .
|
java.lang.String |
getAuthDomain()
Returns the domain used for authentication.
|
java.lang.String |
getEmail()
Gets the email address of the currently logged-in user.
|
java.lang.String |
getModuleId()
Gets the module identifier for the current application instance.
|
long |
getRemainingMillis()
Gets the remaining number of milliseconds left before this request receives a
DeadlineExceededException from App Engine.
|
java.lang.String |
getRequestNamespace()
|
java.lang.String |
getVersionId()
Gets the version identifier for the current application version.
|
boolean |
isAdmin()
Returns true if the currently logged-in user is an administrator.
|
boolean |
isLoggedIn()
Returns true if the user is logged in.
|
-
-
Method Detail
-
getRequestNamespace
@Deprecated
java.lang.String getRequestNamespace()
Deprecated.
-
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-06-16 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-16 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eApiProxy.Environment\u003c/code\u003e interface provides data about the current request, including user login status and application details.\u003c/p\u003e\n"],["\u003cp\u003eIt allows access to the application identifier, module identifier, and version identifier through the \u003ccode\u003egetAppId\u003c/code\u003e, \u003ccode\u003egetModuleId\u003c/code\u003e, and \u003ccode\u003egetVersionId\u003c/code\u003e methods, respectively.\u003c/p\u003e\n"],["\u003cp\u003eMethods like \u003ccode\u003egetEmail\u003c/code\u003e, \u003ccode\u003eisLoggedIn\u003c/code\u003e, and \u003ccode\u003eisAdmin\u003c/code\u003e enable checking the currently logged-in user's email, login status, and administrator status.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetAttributes\u003c/code\u003e method provides a mutable map to store transient, per-request information, while \u003ccode\u003egetRemainingMillis\u003c/code\u003e can be used to check the time remaining before a potential \u003ccode\u003eDeadlineExceededException\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetRequestNamespace\u003c/code\u003e method has been deprecated, and you should now use \u003ccode\u003eNamespaceManager.getGoogleAppsNamespace()\u003c/code\u003e instead.\u003c/p\u003e\n"]]],[],null,["# ApiProxy.Environment (Google App Engine API for Java)\n\ncom.google.apphosting.api\n\nInterface ApiProxy.Environment\n------------------------------\n\n-\n\n Enclosing class:\n : [ApiProxy](../../../../com/google/apphosting/api/ApiProxy.html \"class in com.google.apphosting.api\")\n\n *** ** * ** ***\n\n \u003cbr /\u003e\n\n ```\n public static interface ApiProxy.Environment\n ``` \nEnvironment is a simple data container that provides additional information about the current request (e.g. who is logged in, are they an administrator, etc.). \n-\n -\n\n ### Method Summary\n\n-\n -\n\n ### Method Detail\n\n\n -\n\n #### getAppId\n\n ```\n java.lang.String getAppId()\n ``` \n Gets the application identifier for the current application.\n\n\n -\n\n #### getModuleId\n\n ```\n java.lang.String getModuleId()\n ``` \n Gets the module identifier for the current application instance.\n\n\n -\n\n #### getVersionId\n\n ```\n java.lang.String getVersionId()\n ``` \n Gets the version identifier for the current application version. Result is of the form \\\u003cmajor\\\u003e.\\\u003cminor\\\u003e where \\\u003cmajor\\\u003e is the version name supplied at deploy time and \\\u003cminor\\\u003e is a timestamp value maintained by App Engine.\n\n\n -\n\n #### getEmail\n\n ```\n java.lang.String getEmail()\n ``` \n Gets the email address of the currently logged-in user.\n\n\n -\n\n #### isLoggedIn\n\n ```\n boolean isLoggedIn()\n ``` \n Returns true if the user is logged in.\n\n\n -\n\n #### isAdmin\n\n ```\n boolean isAdmin()\n ``` \n Returns true if the currently logged-in user is an administrator.\n\n\n -\n\n #### getAuthDomain\n\n ```\n java.lang.String getAuthDomain()\n ``` \n Returns the domain used for authentication.\n\n\n -\n\n #### getRequestNamespace\n\n ```\n @Deprecated\n java.lang.String getRequestNamespace()\n ``` \n Deprecated. Use [`NamespaceManager`](../../../../com/google/appengine/api/NamespaceManager.html \"class in com.google.appengine.api\").getGoogleAppsNamespace()\n\n\n -\n\n #### getAttributes\n\n ```\n java.util.Map\u003cjava.lang.String,java.lang.Object\u003e getAttributes()\n ``` \n 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.\n\n\n -\n\n #### getRemainingMillis\n\n ```\n long getRemainingMillis()\n ``` \n 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."]]