class ClientLocalHistory extends AbstractClientHistory implements AutoCloseable {

    @Override
    AbstractTransactionCommitCohort onTransactionReady(final ClientTransaction tx,
            final AbstractTransactionCommitCohort cohort) {

        final State local = state();
        switch (local) {
            case CLOSED:
                return super.onTransactionReady(tx, cohort);
            case IDLE:
                throw new IllegalStateException(String.format("Local history %s is idle when readying transaction %s",
                    this, tx.getIdentifier()));
            case TX_OPEN:
                updateState(local, State.IDLE);
                return super.onTransactionReady(tx, cohort);
            default:
                throw new IllegalStateException(String.format("Local history %s in unhandled state %s", this, local));

        }
    }

      ClientLocalHistory(final AbstractDataStoreClientBehavior client, final LocalHistoryIdentifier historyId);

}