@Override
public void replay(final String document) {
try {
notifier.notifyWriteStart(document);
final String operationCode = extractOpcode(document);
Operation operation = operations.get(operationCode);
operation.execute(document);
notifier.notifyWriteSuccess(document);
} catch (OperationFailed problem) {
notifier.notifyWriteFailure(document, problem);
if (problem.isConnectionLost()) {
throw problem;