@Override public void onRequest(AtmosphereResource resource) { if (pushHandler == null) { getLogger().warning( "AtmosphereHandler.onRequest called before PushHandler has been set. This should really not happen"); return; } AtmosphereRequest req = resource.getRequest(); if (req.getMethod().equalsIgnoreCase("GET")) { onConnect(resource); } else if (req.getMethod().equalsIgnoreCase("POST")) { onMessage(resource); } }
@Override public String method() { return resource.getRequest().getMethod(); }
@Override public void onRequest(AtmosphereResource resource) { if (pushHandler == null) { getLogger().warn( "AtmosphereHandler.onRequest called before PushHandler has been set. This should really not happen"); return; } AtmosphereRequest req = resource.getRequest(); if (req.getMethod().equalsIgnoreCase("GET")) { onConnect(resource); } else if (req.getMethod().equalsIgnoreCase("POST")) { onMessage(resource); } }
@Override public void onRequest(AtmosphereResource resource) { if (pushHandler == null) { getLogger().warning( "AtmosphereHandler.onRequest called before PushHandler has been set. This should really not happen"); return; } AtmosphereRequest req = resource.getRequest(); if (req.getMethod().equalsIgnoreCase("GET")) { onConnect(resource); } else if (req.getMethod().equalsIgnoreCase("POST")) { onMessage(resource); } }
public void onRequest(AtmosphereResource resource) throws IOException { AtmosphereRequest r = resource.getRequest(); // We only handle GET. POST are supported by PrimeFaces directly via the Broadcaster. if (r.getMethod().equalsIgnoreCase("GET")) { applyRules(resource); } else { StringBuilder stringBuilder = read(resource); resource.getAtmosphereConfig().metaBroadcaster().broadcastTo("/*", stringBuilder.toString()); } }
@Override public void onRequest(AtmosphereResource resource) throws IOException { AtmosphereRequest req = resource.getRequest(); AtmosphereResponse res = resource.getResponse(); req.setCharacterEncoding("utf-8"); res.setCharacterEncoding("utf-8"); for (Entry<String, String> entry : AbstractSocketFactory.noCacheHeader().entrySet()) { res.setHeader(entry.getKey(), entry.getValue()); } for (Entry<String, String> entry : AbstractSocketFactory.corsHeader(req.getHeader("Origin")).entrySet()) { res.setHeader(entry.getKey(), entry.getValue()); } if (req.getMethod().equalsIgnoreCase("GET")) { String when = req.getParameter("when"); if (when.equals("open") || when.equals("poll")) { socketFactory.open(resource); } else if (when.equals("abort")) { socketFactory.abort(req.getParameter("id")); } } else if (req.getMethod().equalsIgnoreCase("POST")) { String raw = read(req.getReader()); socketFactory.fire(raw.startsWith("data=") ? raw.substring("data=".length()) : raw); } }
@Override public void onRequest(AtmosphereResource resource) throws IOException { if (resource.transport() == TRANSPORT.WEBSOCKET) { if (resource.getRequest().getMethod().equals("GET")) { wsActions.fire(new AtmosphereServerWebSocket(resource)); } } else { httpActions.fire(new AtmosphereServerHttpExchange(resource)); } } });
logger.trace("Session[" + session.getSessionId() + "]: " + resource.getRequest().getMethod() + "sendMessage");
logger.trace("onStateChange on SessionID=" + request.getAttribute(SocketIOAtmosphereHandler.SOCKETIO_SESSION_ID) + " Method=" + request.getMethod()); SocketIOSessionOutbound outbound = (org.atmosphere.socketio.SocketIOSessionOutbound) request.getAttribute(SocketIOAtmosphereHandler.SOCKETIO_SESSION_OUTBOUND);
logger.trace("onStateChange on SessionID=" + request.getAttribute(SocketIOAtmosphereHandler.SOCKETIO_SESSION_ID) + " Method=" + request.getMethod()); SocketIOSessionOutbound outbound = (org.atmosphere.socketio.SocketIOSessionOutbound) request.getAttribute(SocketIOAtmosphereHandler.SOCKETIO_SESSION_OUTBOUND);
logger.trace("Session[" + session.getSessionId() + "]: " + resource.getRequest().getMethod() + "sendMessage");
if (r.getMethod().equalsIgnoreCase("POST")) { async = true; request.bodyHandler(body -> {
if ("GET".equals(request.getMethod()) && "WebSocket".equalsIgnoreCase(request.getHeader("Upgrade"))) { session = sessionFactory.getSession(sessionId);
response.sendError(AtmosphereResponse.SC_BAD_REQUEST); } else { if ("GET".equals(request.getMethod())) { session = connect(resource, atmosphereHandler, sessionFactory); if (session == null) {
if ("GET".equals(request.getMethod()) && "WebSocket".equalsIgnoreCase(request.getHeader("Upgrade"))) { session = sessionFactory.getSession(sessionId);
response.sendError(AtmosphereResponse.SC_BAD_REQUEST); } else { if ("GET".equals(request.getMethod())) { session = connect(resource, atmosphereHandler, sessionFactory); if (session == null) {