public void complete() { if (--remaining == 0) { originalCallback.receivedStatus(mostRecentStatus); originalCallback.complete(); } }
@Override protected void wasCancelled() { // XXX: Replace this comment with why I did this getCallback().receivedStatus(CANCELLED); }
/** * Decode the given payload for this command. * * @param pl the payload. */ protected void decodePayload(byte[] pl) { assert pl.length == 0 : "Payload has bytes, but decode isn't overridden"; getCallback().receivedStatus(STATUS_OK); }
@Override protected void wasCancelled() { // XXX: Replace this comment with why I did this getCallback().receivedStatus(CANCELLED); }
@Override protected void wasCancelled() { // XXX: Replace this comment with why the hell I did this. getCallback().receivedStatus(CANCELLED); }
public void complete() { if (remaining.decrementAndGet() == 0) { originalCallback.receivedStatus(mostRecentStatus); originalCallback.complete(); } }
@Override public synchronized void timeOut() { timedout = true; synchronized (clones) { Iterator<Operation> i = clones.iterator(); while(i.hasNext()) { i.next().timeOut(); } } callback.receivedStatus(TIMED_OUT); callback.complete(); }
@Override public synchronized void timeOut() { timedout = true; synchronized (clones) { Iterator<Operation> i = clones.iterator(); while(i.hasNext()) { i.next().timeOut(); } } callback.receivedStatus(TIMED_OUT); callback.complete(); }
public final synchronized void cancel() { cancelled = true; synchronized (clones) { Iterator<Operation> i = clones.iterator(); while(i.hasNext()) { i.next().cancel(); } } wasCancelled(); callback.receivedStatus(CANCELLED); callback.complete(); }
@Override protected void decodePayload(byte[] pl) { getCallback().receivedStatus(new OperationStatus(true, String.valueOf(decodeLong(pl, 0)), StatusCode.SUCCESS)); }
@Override protected void decodePayload(byte[] pl) { getCallback().receivedStatus(new OperationStatus(true, String.valueOf(decodeLong(pl, 0)))); }
@Override protected void decodePayload(byte[] pl) { final int flags = decodeInt(pl, 0); final byte[] data = new byte[pl.length - EXTRA_HDR_LEN]; System.arraycopy(pl, EXTRA_HDR_LEN, data, 0, pl.length - EXTRA_HDR_LEN); GetlOperation.Callback gcb = (GetlOperation.Callback) getCallback(); gcb.gotData(key, flags, responseCas, data); getCallback().receivedStatus(STATUS_OK); }
@Override protected void decodePayload(byte[] pl) { final int flags = decodeInt(pl, 0); final byte[] data = new byte[pl.length - EXTRA_HDR_LEN]; System.arraycopy(pl, EXTRA_HDR_LEN, data, 0, pl.length - EXTRA_HDR_LEN); GetsOperation.Callback gcb = (GetsOperation.Callback) getCallback(); gcb.gotData(key, flags, responseCas, data); getCallback().receivedStatus(STATUS_OK); } }
@Override protected void decodePayload(byte[] pl) { final int flags = decodeInt(pl, 0); final byte[] data = new byte[pl.length - EXTRA_HDR_LEN]; System.arraycopy(pl, EXTRA_HDR_LEN, data, 0, pl.length - EXTRA_HDR_LEN); GetOperation.Callback gcb = (GetOperation.Callback) getCallback(); gcb.gotData(key, flags, data); getCallback().receivedStatus(STATUS_OK); } }
@Override public void handleLine(String line) { getLogger().debug("Result: %s", line); OperationStatus found=null; if(line.equals("NOT_FOUND")) { found=NOT_FOUND; } else { found=new OperationStatus(true, line); } getCallback().receivedStatus(found); transitionState(OperationState.COMPLETE); }
@Override public void handleLine(String line) { getLogger().debug("Delete of %s returned %s", key, line); getCallback().receivedStatus(matchStatus(line, DELETED, NOT_FOUND)); transitionState(OperationState.COMPLETE); }
@Override public void handleLine(String line) { getLogger().debug("Flush completed successfully"); getCallback().receivedStatus(matchStatus(line, OK)); transitionState(OperationState.COMPLETE); }
@Override public void handleLine(String line) { assert getState() == OperationState.READING : "Read ``" + line + "'' when in " + getState() + " state"; getCallback().receivedStatus(matchStatus(line, STORED, NOT_FOUND, EXISTS)); transitionState(OperationState.COMPLETE); }
@Override public void handleLine(String line) { assert getState() == OperationState.READING : "Read ``" + line + "'' when in " + getState() + " state"; getCallback().receivedStatus(matchStatus(line, STORED, NOT_FOUND, EXISTS)); transitionState(OperationState.COMPLETE); }
@Override public void handleLine(String line) { getLogger().debug("Touch completed successfully"); getCallback().receivedStatus(matchStatus(line, OK)); transitionState(OperationState.COMPLETE); }