private void write(Status status, ByteBuffer response) throws IOException { LOG.debug("write status: {}", status); ByteBuffer statusBuffer = ByteBuffer.allocate(1); statusBuffer.clear(); statusBuffer.put((byte)(status.ordinal())).flip(); writeFully(statusBuffer); write(response); }
private void write(Status status, ByteBuffer response) throws IOException { LOG.debug("write status: {}", status); ByteBuffer statusBuffer = ByteBuffer.allocate(1); statusBuffer.clear(); statusBuffer.put((byte)(status.ordinal())).flip(); writeFully(statusBuffer); write(response); }
private void write(Status status, String response) throws IOException { write(status, ByteBuffer.wrap(response.getBytes("UTF-8"))); }
if (sasl.client.hasInitialResponse()) response = ByteBuffer.wrap(sasl.evaluate(response.array())); write(Status.START, sasl.getMechanismName(), response); if (sasl.isComplete()) saslResponsePiggybacked = true; frame = readFrame(); if (!mechanism.equalsIgnoreCase(sasl.getMechanismName())) { write(Status.FAIL, "Wrong mechanism: "+mechanism); throw new SaslException("Wrong mechanism: "+mechanism); status = Status.FAIL; write(status, response!=null ? ByteBuffer.wrap(response) : EMPTY); break; case COMPLETE:
private void write(Status status, String response) throws IOException { write(status, ByteBuffer.wrap(response.getBytes("UTF-8"))); }
if (sasl.client.hasInitialResponse()) response = ByteBuffer.wrap(sasl.evaluate(response.array())); write(Status.START, sasl.getMechanismName(), response); if (sasl.isComplete()) saslResponsePiggybacked = true; frame = readFrame(); if (!mechanism.equalsIgnoreCase(sasl.getMechanismName())) { write(Status.FAIL, "Wrong mechanism: "+mechanism); throw new SaslException("Wrong mechanism: "+mechanism); status = Status.FAIL; write(status, response!=null ? ByteBuffer.wrap(response) : EMPTY); break; case COMPLETE: