@Override public String getContentType() { return ContentType.AMF.mimeType(); }
@Override public String getContentType() { return ContentType.AMF.mimeType(); }
@Override public String getContentType() { return ContentType.AMF.mimeType(); }
@Override public String getContentType() { return ContentType.AMF.mimeType(); }
@Override public String getContentType() { return ContentType.JMF_AMF.mimeType(); }
@Override public String getContentType() { return ContentType.AMF.mimeType(); }
@Override public String getContentType() { return ContentType.JMF_AMF.mimeType(); }
@Override public String getContentType() { return ContentType.AMF.mimeType(); }
@Override public String getContentType() { return ContentType.JMF_AMF.mimeType(); }
@Override public String getContentType() { return ContentType.JMF_AMF.mimeType(); }
@Override public String getContentType() { return ContentType.JMF_AMF.mimeType(); }
@Override public String getContentType() { return ContentType.JMF_AMF.mimeType(); }
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { if (!(req instanceof HttpServletRequest) || !(resp instanceof HttpServletResponse)) throw new ServletException("Not in HTTP context: " + req + ", " + resp); HttpServletRequest request = (HttpServletRequest)req; HttpServletResponse response = (HttpServletResponse)resp; if (ContentType.JMF_AMF.mimeType().equals(request.getContentType())) doJMFAMFFilter(request, response, chain); else doAMFFilter(request, response, chain); }
public void service(GraniteConfig graniteConfig, ServicesConfig servicesConfig, ServletContext context, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { if (ContentType.JMF_AMF.mimeType().equals(request.getContentType())) serviceJMFAMF(graniteConfig, servicesConfig, context, request, response); else serviceAMF(graniteConfig, servicesConfig, context, request, response); }
public static ContentType getContentType(String contentType, String protocol) { if (contentType == null) { if (protocol != null) { if ("org.granite.gravity".equals(protocol)) contentType = ContentType.AMF.mimeType(); else if (protocol.startsWith("org.granite.gravity.")) contentType = "application/x-" + protocol.substring("org.granite.gravity.".length()); else throw new RuntimeException("Missing Content-Type and unsupported Sec-WebSocket-Protocol: " + protocol); } else { contentType = ContentType.AMF.mimeType(); log.warn("Missing Content-Type and Sec-WebSocket-Protocol in handshake request. Using: %s", contentType); } } ContentType type = ContentType.forMimeType(contentType); if (type == null) { log.warn("No (or unsupported) content type in handshake request: %s. Using: %s", contentType, ContentType.AMF.mimeType()); type = ContentType.AMF; } return type; } }
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (!ContentType.JMF_AMF.mimeType().equals(request.getContentType())) { log.info("Ignoring request with content-type: " + request.getContentType()); chain.doFilter(request, response); } else { DumpRequestWrapper requestWrapper = new DumpRequestWrapper((HttpServletRequest)request); DumpResponseWrapper responseWrapper= new DumpResponseWrapper((HttpServletResponse)response); chain.doFilter(requestWrapper, responseWrapper); } }
public static Message[] deserialize(GravityInternal gravity, HttpServletRequest request, InputStream is) throws ClassNotFoundException, IOException { if (ContentType.JMF_AMF.mimeType().equals(request.getContentType())) { @SuppressWarnings("resource") JMFDeserializer deserializer = new JMFDeserializer(is, gravity.getGraniteConfig().getSharedContext()); return (Message[])deserializer.readObject(); } ObjectInput amf3Deserializer = gravity.getGraniteConfig().newAMF3Deserializer(is); Object[] objects = (Object[])amf3Deserializer.readObject(); Message[] messages = new Message[objects.length]; System.arraycopy(objects, 0, messages, 0, objects.length); return messages; }
response.setContentType(contentType.mimeType()); response.setDateHeader("Expire", 0L); response.setHeader("Cache-Control", "no-store");
response.setContentType(ContentType.AMF.mimeType()); response.setDateHeader("Expire", 0L); response.setHeader("Cache-Control", "no-store");
response.setContentType(ContentType.JMF_AMF.mimeType()); response.setDateHeader("Expire", 0L); response.setHeader("Cache-Control", "no-store");