Exemplo n.º 1
0
 public static void saveOrUpdate(RuleModel ruleModel) {
   if (!ruleModel.isEchoOnly()) {
     RulesDao.saveOrUpdateRule(ruleModel.toRule());
     if (!ruleModel.getEcho()) {
       EchoParametersDao.deleteEchoParameters(ruleModel.getId());
     }
   }
   if (ruleModel.getEcho() || ruleModel.isEchoOnly()) {
     EchoParametersDao.saveOrUpdateEchoParameter(ruleModel.toEchoParameter());
   }
 }
Exemplo n.º 2
0
 public static List<RuleModel> getRulesModels() {
   List<RuleModel> ruleModels =
       RulesDao.getRules().stream().map(RuleModel::new).collect(Collectors.toList());
   EchoParametersDao.getEchoParameters()
       .forEach(forwardParameter -> mergedForwardParameter(ruleModels, forwardParameter));
   return ruleModels;
 }
Exemplo n.º 3
0
 public static void delete(String... rulesIds) {
   RulesDao.deleteRules(rulesIds);
   EchoParametersDao.deleteEchoParameters(rulesIds);
 }