Package com.google.apphosting.runtime
Class ApiProxyImpl.EnvironmentImpl
- java.lang.Object
-
- com.google.apphosting.runtime.ApiProxyImpl.EnvironmentImpl
-
- All Implemented Interfaces:
com.google.apphosting.api.ApiProxy.Environment,com.google.apphosting.api.ApiProxy.EnvironmentWithTrace
- Enclosing class:
- ApiProxyImpl
public static final class ApiProxyImpl.EnvironmentImpl extends Object implements com.google.apphosting.api.ApiProxy.EnvironmentWithTrace
To implement ApiProxy.Environment, we use a class that wraps around an UPRequest and retrieves the necessary information from it.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddLogRecord(com.google.apphosting.api.ApiProxy.LogRecord record)voidflushLogs()StringgetAppId()AppVersiongetAppVersion()Map<String,Object>getAttributes()StringgetAuthDomain()StringgetEmail()StringgetModuleId()longgetRemainingMillis()StringgetRequestNamespace()Deprecated.Optional<String>getSpanId()Get the span id of the current request, which can be used to identify a span within a trace.com.google.apphosting.runtime.ApiProxyImpl.TraceExceptionGeneratorgetTraceExceptionGenerator()Optional<String>getTraceId()Get the trace id of the current request, which can be used to correlate log messages belonging to that request.TraceWritergetTraceWriter()StringgetVersionId()booleanisAdmin()booleanisLoggedIn()
-
-
-
Method Detail
-
addLogRecord
public void addLogRecord(com.google.apphosting.api.ApiProxy.LogRecord record)
-
flushLogs
public void flushLogs()
-
getTraceWriter
public TraceWriter getTraceWriter()
-
getAppId
public String getAppId()
- Specified by:
getAppIdin interfacecom.google.apphosting.api.ApiProxy.Environment
-
getModuleId
public String getModuleId()
- Specified by:
getModuleIdin interfacecom.google.apphosting.api.ApiProxy.Environment
-
getVersionId
public String getVersionId()
- Specified by:
getVersionIdin interfacecom.google.apphosting.api.ApiProxy.Environment
-
getTraceId
public Optional<String> getTraceId()
Get the trace id of the current request, which can be used to correlate log messages belonging to that request.- Specified by:
getTraceIdin interfacecom.google.apphosting.api.ApiProxy.EnvironmentWithTrace
-
getSpanId
public Optional<String> getSpanId()
Get the span id of the current request, which can be used to identify a span within a trace.- Specified by:
getSpanIdin interfacecom.google.apphosting.api.ApiProxy.EnvironmentWithTrace
-
getAppVersion
public AppVersion getAppVersion()
-
isLoggedIn
public boolean isLoggedIn()
- Specified by:
isLoggedInin interfacecom.google.apphosting.api.ApiProxy.Environment
-
isAdmin
public boolean isAdmin()
- Specified by:
isAdminin interfacecom.google.apphosting.api.ApiProxy.Environment
-
getEmail
public String getEmail()
- Specified by:
getEmailin interfacecom.google.apphosting.api.ApiProxy.Environment
-
getAuthDomain
public String getAuthDomain()
- Specified by:
getAuthDomainin interfacecom.google.apphosting.api.ApiProxy.Environment
-
getRequestNamespace
@Deprecated public String getRequestNamespace()
Deprecated.- Specified by:
getRequestNamespacein interfacecom.google.apphosting.api.ApiProxy.Environment
-
getAttributes
public Map<String,Object> getAttributes()
- Specified by:
getAttributesin interfacecom.google.apphosting.api.ApiProxy.Environment
-
getRemainingMillis
public long getRemainingMillis()
- Specified by:
getRemainingMillisin interfacecom.google.apphosting.api.ApiProxy.Environment
-
getTraceExceptionGenerator
public com.google.apphosting.runtime.ApiProxyImpl.TraceExceptionGenerator getTraceExceptionGenerator()
-
-