/** * Flush the client's operation to cc. */ public void flush() throws TransformException { cc.onClientOperations(clientOperations.toArray(new WaveletOperation[] {})); clientOperations.clear(); }
/** * Flush the client's operation to cc. */ public void flush() throws TransformException { cc.onClientOperations(clientOperations.toArray(new WaveletOperation[] {})); clientOperations.clear(); }
@Override public void send(WaveletOperation... operations) throws ChannelException { if (state == State.CLOSED) { // TODO(anorth): throw an exception here after fixing clients. logger.error().log("Cannot send to closed operation channel: " + this); } else if (accessibility.isWritable()) { try { cc.onClientOperations(operations); } catch (TransformException e) { throw new ChannelException(ResponseCode.INVALID_OPERATION, "Operation channel failed on send: " + this + ", " + deltaChannel + ", " + cc, e, Recoverable.NOT_RECOVERABLE, null, null); } } else { throw new ChannelException(ResponseCode.NOT_AUTHORIZED, "Attempt to write to inaccessible wavelet", null, Recoverable.NOT_RECOVERABLE, null, null); } }