Class UPRequestTranslator


  • public class UPRequestTranslator
    extends Object
    Translates HttpServletRequest to the UPRequest proto, and vice versa for the response.
    • Constructor Detail

      • UPRequestTranslator

        public UPRequestTranslator​(AppInfoFactory appInfoFactory,
                                   boolean passThroughPrivateHeaders,
                                   boolean skipPostData)
        Construct an UPRequestTranslator.
        Parameters:
        appInfoFactory - An AppInfoFactory.
        passThroughPrivateHeaders - Include internal App Engine headers in translation (mostly X-AppEngine-*) instead of eliding them.
        skipPostData - Don't read the request body. This is useful for callers who will read it directly, since the read can only happen once.
    • Method Detail

      • translateResponse

        public final void translateResponse​(org.eclipse.jetty.server.Response response,
                                            com.google.apphosting.base.protos.RuntimePb.UPResponse rpcResp)
        Translate from a response proto to a javax.servlet response.
        Parameters:
        response - the Jetty response object to fill
        rpcResp - the proto info available to extract info from
      • translateRequest

        public final com.google.apphosting.base.protos.RuntimePb.UPRequest translateRequest​(javax.servlet.http.HttpServletRequest realRequest)
        Makes a UPRequest from an HttpServletRequest
        Parameters:
        realRequest - the http request object
        Returns:
        equivalent UPRequest object