use of com.google.gerrit.server.config.ConfigKey in project gerrit by GerritCodeReview.
the class SetParent method configUpdated.
@Override
public Multimap<UpdateResult, ConfigUpdateEntry> configUpdated(ConfigUpdatedEvent event) {
ConfigKey receiveSetParent = ConfigKey.create("receive", "allowProjectOwnersToChangeParent");
if (!event.isValueUpdated(receiveSetParent)) {
return ConfigUpdatedEvent.NO_UPDATES;
}
try {
boolean enabled = event.getNewConfig().getBoolean("receive", "allowProjectOwnersToChangeParent", false);
this.allowProjectOwnersToChangeParent = enabled;
} catch (IllegalArgumentException iae) {
return event.reject(receiveSetParent);
}
return event.accept(receiveSetParent);
}
use of com.google.gerrit.server.config.ConfigKey in project gerrit by GerritCodeReview.
the class SshLog method configUpdated.
@Override
public Multimap<UpdateResult, ConfigUpdateEntry> configUpdated(ConfigUpdatedEvent event) {
ConfigKey sshdRequestLog = ConfigKey.create("sshd", "requestLog");
if (!event.isValueUpdated(sshdRequestLog)) {
return ConfigUpdatedEvent.NO_UPDATES;
}
boolean stateUpdated;
try {
boolean enabled = event.getNewConfig().getBoolean("sshd", "requestLog", true);
if (enabled) {
stateUpdated = enableLogging();
} else {
stateUpdated = disableLogging();
}
return stateUpdated ? event.accept(sshdRequestLog) : ConfigUpdatedEvent.NO_UPDATES;
} catch (IllegalArgumentException iae) {
return event.reject(sshdRequestLog);
}
}
Aggregations