/** * see {@link IConfig#setConfigValueIfEquals(String, String, String)} */ @RolesAllowed("user") @Transactional(readOnly = false) // see above public boolean setConfigValueIfEquals(String key, String value, String test) throws ApiUsageException, SecurityViolation { key = prefs.resolveAlias(key); lock.writeLock().lock(); try { String current = getInternalValue(key); if (test == null) { if (current != null) { return false; } } else { if (!test.equals(current)) { return false; } } setConfigValue(key, value); return true; } finally { lock.writeLock().unlock(); } }