class EmbeddedOpenDJManager {

    public State upgrade() throws ServletException {
        if (state.equals(State.NO_EMBEDDED_INSTANCE)) {
            throw new IllegalStateException("Cannot upgrade embedded instance as no embedded instance has "
                    + "been configured");
        }
        if (!state.equals(State.UPGRADE_REQUIRED)) {
            throw new IllegalStateException("Embedded instance does not require upgrading");
        }
        try {
            upgrader.upgrade();
            state = State.UPGRADED;
            return state;
        } catch (Exception e) {
            logger.error("Failed to upgrade OpenDJ", e);
            throw new ServletException("An error occurred while upgrading the embedded OpenDJ instance", e);
        }
    }

    public  EmbeddedOpenDJManager(Debug logger, String baseDirectory, OpenDJUpgrader upgrader);

}