use of com.predic8.membrane.core.model.IRuleChangeListener in project service-proxy by membrane.
the class RuleManager method addProxyAndOpenPortIfNew.
public synchronized void addProxyAndOpenPortIfNew(Rule rule, RuleDefinitionSource source) throws IOException {
if (exists(rule.getKey()))
return;
router.getTransport().openPort(rule.getKey().getIp(), rule.getKey().getPort(), rule.getSslInboundContext());
rules.add(rule);
ruleSources.add(source);
for (IRuleChangeListener listener : listeners) {
listener.ruleAdded(rule);
}
}
use of com.predic8.membrane.core.model.IRuleChangeListener in project service-proxy by membrane.
the class RuleManager method removeRule.
public synchronized void removeRule(Rule rule) {
getExchangeStore().removeAllExchanges(rule);
int i = rules.indexOf(rule);
rules.remove(i);
ruleSources.remove(i);
for (IRuleChangeListener listener : listeners) {
listener.ruleRemoved(rule, rules.size());
}
}
use of com.predic8.membrane.core.model.IRuleChangeListener in project service-proxy by membrane.
the class RuleManager method ruleDown.
public synchronized void ruleDown(Rule rule) {
int index = rules.indexOf(rule);
if (index < 0 || index == (rules.size() - 1))
return;
Collections.swap(rules, index, index + 1);
Collections.swap(ruleSources, index, index + 1);
for (IRuleChangeListener listener : listeners) {
listener.rulePositionsChanged();
}
}
use of com.predic8.membrane.core.model.IRuleChangeListener in project service-proxy by membrane.
the class RuleManager method ruleUp.
public synchronized void ruleUp(Rule rule) {
int index = rules.indexOf(rule);
if (index <= 0)
return;
Collections.swap(rules, index, index - 1);
Collections.swap(ruleSources, index, index - 1);
for (IRuleChangeListener listener : listeners) {
listener.rulePositionsChanged();
}
}
use of com.predic8.membrane.core.model.IRuleChangeListener in project service-proxy by membrane.
the class RuleManager method addProxy.
public synchronized void addProxy(Rule rule, RuleDefinitionSource source) {
if (exists(rule.getKey()))
return;
rules.add(rule);
ruleSources.add(source);
for (IRuleChangeListener listener : listeners) {
listener.ruleAdded(rule);
}
}
Aggregations