@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { InputStream stream = request.getInputStream(); String contentType = request.getContentType(); if (contentType != null && contentType.equals("application/x-gzip")) { stream = new GZIPInputStream(stream); } // Read the command directly from the reader, assuming UTF8 encoding Command command = (Command) wireFormat.unmarshalText(new InputStreamReader(stream, "UTF-8")); if (command instanceof WireFormatInfo) { WireFormatInfo info = (WireFormatInfo) command; if (!canProcessWireFormatVersion(info.getVersion())) { response.sendError(HttpServletResponse.SC_NOT_FOUND, "Cannot process wire format of version: " + info.getVersion()); } } else { BlockingQueueTransport transport = getTransportChannel(request, response); if (transport == null) { return; } transport.doConsume(command); } }
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { InputStream stream = request.getInputStream(); String contentType = request.getContentType(); if (contentType != null && contentType.equals("application/x-gzip")) { stream = new GZIPInputStream(stream); } // Read the command directly from the reader, assuming UTF8 encoding Command command = (Command) wireFormat.unmarshalText(new InputStreamReader(stream, "UTF-8")); if (command instanceof WireFormatInfo) { WireFormatInfo info = (WireFormatInfo) command; if (!canProcessWireFormatVersion(info.getVersion())) { response.sendError(HttpServletResponse.SC_NOT_FOUND, "Cannot process wire format of version: " + info.getVersion()); } } else { BlockingQueueTransport transport = getTransportChannel(request, response); if (transport == null) { return; } if (command instanceof ConnectionInfo) { ((ConnectionInfo) command).setTransportContext(request.getAttribute("javax.servlet.request.X509Certificate")); } transport.doConsume(command); } }
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { InputStream stream = request.getInputStream(); String contentType = request.getContentType(); if (contentType != null && contentType.equals("application/x-gzip")) { stream = new GZIPInputStream(stream); } // Read the command directly from the reader, assuming UTF8 encoding Command command = (Command) wireFormat.unmarshalText(new InputStreamReader(stream, "UTF-8")); if (command instanceof WireFormatInfo) { WireFormatInfo info = (WireFormatInfo) command; if (!canProcessWireFormatVersion(info.getVersion())) { response.sendError(HttpServletResponse.SC_NOT_FOUND, "Cannot process wire format of version: " + info.getVersion()); } } else { BlockingQueueTransport transport = getTransportChannel(request, response); if (transport == null) { return; } if (command instanceof ConnectionInfo) { ((ConnectionInfo) command).setTransportContext(request.getAttribute("javax.servlet.request.X509Certificate")); } transport.doConsume(command); } }
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { InputStream stream = request.getInputStream(); String contentType = request.getContentType(); if (contentType != null && contentType.equals("application/x-gzip")) { stream = new GZIPInputStream(stream); } // Read the command directly from the reader, assuming UTF8 encoding Command command = (Command) wireFormat.unmarshalText(new InputStreamReader(stream, "UTF-8")); if (command instanceof WireFormatInfo) { WireFormatInfo info = (WireFormatInfo) command; if (!canProcessWireFormatVersion(info.getVersion())) { response.sendError(HttpServletResponse.SC_NOT_FOUND, "Cannot process wire format of version: " + info.getVersion()); } } else { BlockingQueueTransport transport = getTransportChannel(request, response); if (transport == null) { return; } if (command instanceof ConnectionInfo) { ((ConnectionInfo) command).setTransportContext(request.getAttribute("javax.servlet.request.X509Certificate")); } transport.doConsume(command); } }