@Override protected void finishedPayload(byte[] pl) throws IOException { if (keyLen > 0) { final byte[] keyBytes = new byte[keyLen]; final byte[] data = new byte[pl.length - keyLen]; System.arraycopy(pl, 0, keyBytes, 0, keyLen); System.arraycopy(pl, keyLen, data, 0, pl.length - keyLen); Callback cb = (Callback) getCallback(); cb.gotStat(new String(keyBytes, "UTF-8"), new String(data, "UTF-8")); } else { OperationStatus status = getStatusForErrorCode(errorCode, pl); getCallback().receivedStatus(status); transitionState(OperationState.COMPLETE); } resetInput(); } }
@Override public void handleLine(String line) { if (line.equals("END")) { cb.receivedStatus(END); transitionState(OperationState.COMPLETE); } else { String[] parts = line.split(" ", 3); assert parts.length == 3; cb.gotStat(parts[1], parts[2]); } }
@Override protected void finishedPayload(byte[] pl) throws IOException { if (keyLen > 0) { final byte[] keyBytes = new byte[keyLen]; final byte[] data = new byte[pl.length - keyLen]; System.arraycopy(pl, 0, keyBytes, 0, keyLen); System.arraycopy(pl, keyLen, data, 0, pl.length - keyLen); Callback cb = (Callback) getCallback(); cb.gotStat(new String(keyBytes, "UTF-8"), new String(data, "UTF-8")); } else { OperationStatus status = getStatusForErrorCode(errorCode, pl); getCallback().receivedStatus(status); transitionState(OperationState.COMPLETE); } resetInput(); } }
@Override protected void finishedPayload(byte[] pl) throws IOException { if (keyLen > 0) { final byte[] keyBytes = new byte[keyLen]; final byte[] data = new byte[pl.length - keyLen]; System.arraycopy(pl, 0, keyBytes, 0, keyLen); System.arraycopy(pl, keyLen, data, 0, pl.length - keyLen); Callback cb = (Callback) getCallback(); cb.gotStat(new String(keyBytes, "UTF-8"), new String(data, "UTF-8")); } else { OperationStatus status = getStatusForErrorCode(errorCode, pl); getCallback().receivedStatus(status); transitionState(OperationState.COMPLETE); } resetInput(); } }
@Override protected void finishedPayload(byte[] pl) throws IOException { if (keyLen > 0) { final byte[] keyBytes = new byte[keyLen]; final byte[] data = new byte[pl.length - keyLen]; System.arraycopy(pl, 0, keyBytes, 0, keyLen); System.arraycopy(pl, keyLen, data, 0, pl.length - keyLen); Callback cb = (Callback) getCallback(); cb.gotStat(new String(keyBytes, "UTF-8"), new String(data, "UTF-8")); } else { OperationStatus status = getStatusForErrorCode(errorCode, pl); getCallback().receivedStatus(status); transitionState(OperationState.COMPLETE); } resetInput(); } }
@Override protected void finishedPayload(byte[] pl) throws IOException { if (keyLen > 0) { final byte[] keyBytes = new byte[keyLen]; final byte[] data = new byte[pl.length - keyLen]; System.arraycopy(pl, 0, keyBytes, 0, keyLen); System.arraycopy(pl, keyLen, data, 0, pl.length - keyLen); Callback cb = (Callback) getCallback(); cb.gotStat(new String(keyBytes, "UTF-8"), new String(data, "UTF-8")); } else { OperationStatus status = getStatusForErrorCode(errorCode, pl); getCallback().receivedStatus(status); transitionState(OperationState.COMPLETE); } resetInput(); } }
@Override protected void finishedPayload(byte[] pl) throws IOException { if (keyLen > 0) { final byte[] keyBytes = new byte[keyLen]; final byte[] data = new byte[pl.length - keyLen]; System.arraycopy(pl, 0, keyBytes, 0, keyLen); System.arraycopy(pl, keyLen, data, 0, pl.length - keyLen); Callback cb = (Callback) getCallback(); cb.gotStat(new String(keyBytes, "UTF-8"), new String(data, "UTF-8")); } else { getCallback().receivedStatus(STATUS_OK); transitionState(OperationState.COMPLETE); } resetInput(); }
@Override protected void finishedPayload(byte[] pl) throws IOException { if(keyLen > 0) { final byte[] keyBytes=new byte[keyLen]; final byte[] data=new byte[pl.length - keyLen]; System.arraycopy(pl, 0, keyBytes, 0, keyLen); System.arraycopy(pl, keyLen, data, 0, pl.length-keyLen); Callback cb=(Callback)getCallback(); cb.gotStat(new String(keyBytes, "UTF-8"), new String(data, "UTF-8")); } else { getCallback().receivedStatus(STATUS_OK); transitionState(OperationState.COMPLETE); } resetInput(); }
@Override protected void finishedPayload(byte[] pl) throws IOException { if(keyLen > 0) { final byte[] keyBytes=new byte[keyLen]; final byte[] data=new byte[pl.length - keyLen]; System.arraycopy(pl, 0, keyBytes, 0, keyLen); System.arraycopy(pl, keyLen, data, 0, pl.length-keyLen); Callback cb=(Callback)getCallback(); cb.gotStat(new String(keyBytes, "UTF-8"), new String(data, "UTF-8")); } else { getCallback().receivedStatus(STATUS_OK); transitionState(OperationState.COMPLETE); } resetInput(); }
@Override protected void wasCancelled() { cb.receivedStatus(CANCELLED); }
@Override protected void wasCancelled() { cb.receivedStatus(CANCELLED); }
@Override protected void wasCancelled() { cb.receivedStatus(CANCELLED); }
@Override protected void wasCancelled() { cb.receivedStatus(CANCELLED); }
@Override protected void wasCancelled() { cb.receivedStatus(CANCELLED); }
@Override protected void wasCancelled() { cb.receivedStatus(CANCELLED); }
@Override public void handleLine(String line) { if (line.equals("END")) { cb.receivedStatus(END); transitionState(OperationState.COMPLETE); } else { String[] parts = line.split(" ", 3); assert parts.length == 3; cb.gotStat(parts[1], parts[2]); } }
@Override public void handleLine(String line) { if (line.startsWith("END")) { cb.receivedStatus(END); transitionState(OperationState.COMPLETE); } else { String[] parts = line.split(" ", 3); assert parts.length == 3; cb.gotStat(parts[1], parts[2]); } }
@Override public void handleLine(String line) { if(line.equals("END")) { cb.receivedStatus(END); transitionState(OperationState.COMPLETE); } else { String[] parts=line.split(" ", 3); assert parts.length == 3; cb.gotStat(parts[1], parts[2]); } }
@Override public void handleLine(String line) { if (line.equals("END")) { cb.receivedStatus(END); transitionState(OperationState.COMPLETE); } else { String[] parts = line.split(" ", 3); assert parts.length == 3; cb.gotStat(parts[1], parts[2]); } }
@Override public void handleLine(String line) { if(line.equals("END")) { cb.receivedStatus(END); transitionState(OperationState.COMPLETE); } else { String[] parts=line.split(" ", 3); assert parts.length == 3; cb.gotStat(parts[1], parts[2]); } }