}
private void configureNetwork(ImmutableSettings.Builder builder) {
- String host = props.value(ProcessProperties.SEARCH_HOST);
- Integer port = props.valueAsInt(ProcessProperties.SEARCH_PORT);
+ // the following properties can't be null as default values are defined by app process
+ String host = props.nonNullValue(ProcessProperties.SEARCH_HOST);
+ int port = Integer.parseInt(props.nonNullValue(ProcessProperties.SEARCH_PORT));
LOGGER.info("Elasticsearch listening on {}:{}", host, port);
// disable multicast
List<ActiveRuleChange> changes = Lists.newArrayList();
RuleActivatorContext context = contextFactory.create(key.qProfile(), key.ruleKey(), dbSession);
ActiveRuleChange change;
- if (context.activeRule() == null) {
+ ActiveRuleDto activeRuleDto = context.activeRule();
+ if (activeRuleDto == null) {
return changes;
}
- if (!force && !isCascade && context.activeRule().getInheritance() != null) {
+ if (!force && !isCascade && activeRuleDto.getInheritance() != null) {
throw new BadRequestException("Cannot deactivate inherited rule '" + key.ruleKey() + "'");
}
change = ActiveRuleChange.createFor(ActiveRuleChange.Type.DEACTIVATED, key);