private String bufferToString() { byte[] bytes = Utils.getRemainingArray(buffer); String str; try { str = new String(bytes, ENCODING); } catch (UnsupportedEncodingException e) { throw new RuntimeException("Unsupported encoding" + ENCODING, e); } return str; }
@Override public void sendPong(ByteBuffer applicationData) throws IOException, IllegalArgumentException { if (applicationData != null && applicationData.remaining() > 125) { throw new IllegalArgumentException( "Pong applicationData exceeded the maximum allowed payload of 125 bytes."); } clusterContext.sendPong(sessionId, Utils.getRemainingArray(applicationData)); }
@Override public void sendPing(ByteBuffer applicationData) throws IOException, IllegalArgumentException { if (applicationData != null && applicationData.remaining() > 125) { throw new IllegalArgumentException( "Ping applicationData exceeded the maximum allowed payload of 125 bytes."); } clusterContext.sendPing(sessionId, Utils.getRemainingArray(applicationData)); }
@Override public void sendPing(ByteBuffer applicationData) throws IOException, IllegalArgumentException { if (applicationData != null && applicationData.remaining() > 125) { throw new IllegalArgumentException( "Ping applicationData exceeded the maximum allowed payload of 125 bytes."); } clusterContext.sendPing(sessionId, Utils.getRemainingArray(applicationData)); }
@Override public void sendPong(ByteBuffer applicationData) throws IOException, IllegalArgumentException { if (applicationData != null && applicationData.remaining() > 125) { throw new IllegalArgumentException( "Pong applicationData exceeded the maximum allowed payload of 125 bytes."); } clusterContext.sendPong(sessionId, Utils.getRemainingArray(applicationData)); }
@Override public void sendPong(ByteBuffer applicationData) throws IOException, IllegalArgumentException { if (applicationData != null && applicationData.remaining() > 125) { throw new IllegalArgumentException( "Pong applicationData exceeded the maximum allowed payload of 125 bytes."); } clusterContext.sendPong(sessionId, Utils.getRemainingArray(applicationData)); }
@Override public void sendPong(ByteBuffer applicationData) throws IOException, IllegalArgumentException { if (applicationData != null && applicationData.remaining() > 125) { throw new IllegalArgumentException( "Pong applicationData exceeded the maximum allowed payload of 125 bytes."); } clusterContext.sendPong(sessionId, Utils.getRemainingArray(applicationData)); }
@Override public void sendPing(ByteBuffer applicationData) throws IOException { if (applicationData != null && applicationData.remaining() > 125) { throw new IllegalArgumentException(LocalizationMessages.APPLICATION_DATA_TOO_LONG("Ping")); } session.restartIdleTimeoutExecutor(); webSocket.sendPing(Utils.getRemainingArray(applicationData)); }
@Override public Future<Void> sendBinary(ByteBuffer data) { checkNotNull(data, "data"); return clusterContext.sendBinary(sessionId, Utils.getRemainingArray(data)); }
@Override public void sendPong(ByteBuffer applicationData) throws IOException { if (applicationData != null && applicationData.remaining() > 125) { throw new IllegalArgumentException(LocalizationMessages.APPLICATION_DATA_TOO_LONG("Pong")); } session.restartIdleTimeoutExecutor(); webSocket.sendPong(Utils.getRemainingArray(applicationData)); }
@Override public Future<Void> sendBinary(ByteBuffer data) { checkNotNull(data, "data"); return clusterContext.sendBinary(sessionId, Utils.getRemainingArray(data)); }
@Override public void sendPong(ByteBuffer applicationData) throws IOException { if (applicationData != null && applicationData.remaining() > 125) { throw new IllegalArgumentException(LocalizationMessages.APPLICATION_DATA_TOO_LONG("Pong")); } session.restartIdleTimeoutExecutor(); webSocket.sendPong(Utils.getRemainingArray(applicationData)); }
@Override public void sendPing(ByteBuffer applicationData) throws IOException { if (applicationData != null && applicationData.remaining() > 125) { throw new IllegalArgumentException(LocalizationMessages.APPLICATION_DATA_TOO_LONG("Ping")); } session.restartIdleTimeoutExecutor(); webSocket.sendPing(Utils.getRemainingArray(applicationData)); }
@Override public void sendBinary(ByteBuffer data, SendHandler handler) { checkNotNull(data, "data"); checkNotNull(handler, "handler"); clusterContext.sendBinary(sessionId, Utils.getRemainingArray(data), handler); }
@Override public void sendBinary(ByteBuffer data) throws IOException { checkNotNull(data, "data"); final Future<?> future = clusterContext.sendBinary(sessionId, Utils.getRemainingArray(data)); processFuture(future); }
@Override public void sendBinary(ByteBuffer partialByte, boolean isLast) throws IOException { checkNotNull(partialByte, "partialByte"); final Future<?> future = clusterContext.sendBinary(sessionId, Utils.getRemainingArray(partialByte), isLast); processFuture(future); }
@Override public void sendBinary(ByteBuffer data) throws IOException { checkNotNull(data, "data"); final Future<?> future = clusterContext.sendBinary(sessionId, Utils.getRemainingArray(data)); processFuture(future); }
@Override public void sendBinary(ByteBuffer partialByte, boolean isLast) throws IOException { checkNotNull(partialByte, "partialByte"); session.getDebugContext().appendLogMessage(LOGGER, Level.FINEST, DebugContext.Type.MESSAGE_OUT, "Sending partial binary message"); final Future<?> future = webSocket.sendBinary(Utils.getRemainingArray(partialByte), isLast); try { processFuture(future); } finally { session.restartIdleTimeoutExecutor(); } }
@Override public void sendBinary(ByteBuffer data) throws IOException { checkNotNull(data, "data"); session.getDebugContext() .appendLogMessage(LOGGER, Level.FINEST, DebugContext.Type.MESSAGE_OUT, "Sending binary message"); final Future<?> future = webSocket.sendBinary(Utils.getRemainingArray(data)); try { processFuture(future); } finally { session.restartIdleTimeoutExecutor(); } }
@Override public void sendBinary(ByteBuffer data) throws IOException { checkNotNull(data, "data"); session.getDebugContext() .appendLogMessage(LOGGER, Level.FINEST, DebugContext.Type.MESSAGE_OUT, "Sending binary message"); final Future<?> future = webSocket.sendBinary(Utils.getRemainingArray(data)); try { processFuture(future); } finally { session.restartIdleTimeoutExecutor(); } }