/** * Do the database adjustment only if not already performed. */ public void start() { if (isCheckRequired()) { if (isReadOnlyDb) { doCheck(); } else { checkIsStarting(); doCheck(); checkIsDone(); } log.info("performed " + configKeyValue); } else if (log.isDebugEnabled()) { log.debug("skipped " + configKey); } }
/** * @param executor executor to use for configuration map check * @param preferences the OMERO configuration settings * @param readOnly the read-only status */ protected BaseDBCheck(Executor executor, PreferenceContext preferences, ReadOnlyStatus readOnly) { this.executor = executor; this.version = preferences.getProperty("omero.db.version"); this.patch = Integer.parseInt(preferences.getProperty("omero.db.patch")); /* these values may depend upon version and patch above */ configKey = "DB check " + getClass().getSimpleName(); configValue = getCheckDone(); configKeyValue = configKey + ": " + configValue; isReadOnlyDb = readOnly.isReadOnlyDb(); }