public MeasureKey(Metric metric, Rule rule) { this.metric = metric; if (rule != null && rule.getRulesCategory() != null) { this.rulesCategoryId = rule.getRulesCategory().getId(); } this.rule = rule; }
public RuleFailureParam(String key, Double value, Double value2) { setKey(key); this.value = value; this.value2 = value2; }
@Override public Object clone() { return new ActiveRuleParam(getActiveRule(), getRuleParam(), getValue()); }
public boolean isRuleParamEqual(RuleParam ruleParam, RuleParam ruleParamFromDatabase, String ruleKey, String pluginKey) { return ruleParam.getKey().equals(ruleParamFromDatabase.getKey()) && ruleKey.equals(ruleParamFromDatabase.getRule().getKey()) && ruleParamFromDatabase.getRule().getPluginName().equals(pluginKey); }
public void addActiveRulesToProfile(List<ActiveRule> activeRules, int profileId, String pluginKey) { RulesProfile rulesProfile = getProfileById(profileId); for (ActiveRule activeRule : activeRules) { synchronizeRuleOfActiveRule(activeRule, pluginKey); activeRule.setRulesProfile(rulesProfile); getSession().save(activeRule); } }
public List<ActiveRule> getActiveRules(RuleFailureLevel level) { List<ActiveRule> result = new ArrayList<ActiveRule>(); for (ActiveRule activeRule : getActiveRules()) { if (activeRule.getLevel().equals(level)) { result.add(activeRule); } } return result; }
public ActiveRule getActiveRule(String pluginKey, String ruleKey) { for (ActiveRule activeRule : getActiveRules()) { if (activeRule.getRuleKey().equals(ruleKey) && activeRule.getPluginName().equals(pluginKey)) { return activeRule; } } return null; }
public List<Rule> getRulesByCategory(RulesCategory categ) { List<Rule> result = new ArrayList<Rule>(); for (Rule rule : getRules()) { if (rule.getRulesCategory().equals(categ)) { result.add(rule); } } return result; }
public Rule(String name, String key, RulesCategory rulesCategory, String pluginName, String description) { this(); setName(name); this.key = key; this.rulesCategory = rulesCategory; this.pluginName = pluginName; this.description = description; }
public Object transform(Object input) { return ((ActiveRule) input).clone(); } })));
public Object transform(Object input) { return ((ActiveRuleParam) input).clone(); } })));
public Integer getCategoryId() { if (rulesCategory != null) { return rulesCategory.getId(); } return null; }
public String getConfigKey() { return rule.getConfigKey(); }
public RuleFailureParam addParameter(String key, Double value) { return addParameter(key, value, null); }
public String getRuleKey() { return rule.getKey(); }
public String getPluginName() { return rule.getPluginName(); }
public final void setName(String name) { this.name = removeNewLineCharacters(name); }
public Rule(String name, String key, String configKey, RulesCategory rulesCategory, String pluginName, String description) { this(); setName(name); this.key = key; this.configKey = configKey; this.rulesCategory = rulesCategory; this.pluginName = pluginName; this.description = description; }