@@ -0,0 +1,1003 @@
+package cec.service;%0D%0A%0D%0Aimport java.util.UUID;%0D%0A%0D%0Aimport cec.model.FolderFactory;%0D%0Aimport cec.model.Rule;%0D%0Aimport cec.model.RuleBuilder;%0D%0Aimport cec.model.RuleSet;%0D%0Aimport cec.model.RuleSetFactory;%0D%0A%0D%0Aimport cec.view.RuleViewEntity;%0D%0A%0D%0Apublic class RuleService %7B%0D%0A%09private RuleSet ruleSet;%09%0D%0A%09%0D%0A%09public RuleService() %7B%0D%0A%09%09ruleSet = RuleSetFactory.getRuleSetInstance();%0D%0A%09%7D%0D%0A%09%0D%0A%09public void save(RuleViewEntity ruleViewEntity) %7B%0D%0A%09%09Rule rule = (new RuleBuilder())%0D%0A%09%09%09%09.withId(UUID.randomUUID())%0D%0A%09%09%09%09.withRank(ruleSet.getNextRank())%0D%0A%09%09%09%09.withEmailAddresses(ruleViewEntity.getEmailAddresses())%0D%0A%09%09%09%09.withWords(ruleViewEntity.getWords())%0D%0A%09%09%09%09.withTargetFolder(FolderFactory.getFolder(ruleViewEntity.getFolderPath()))%0D%0A%09%09%09%09.withIsActive(true)%0D%0A%09%09%09%09.build();%0D%0A%09%09%0D%0A%09%09rule.save();  // should this call the ruleset?%0D%0A%09%7D%09%0D%0A%09%0D%0A%09public void delete(RuleViewEntity ruleViewEntity) %7B%0D%0A%09%09Rule rule = (new RuleBuilder())%0D%0A%09%09%09%09.withId(UUID.fromString(ruleViewEntity.getID()))%0D%0A%09%09%09%09.build();%0D%0A%09%09rule.delete();%0D%0A%09%7D%0D%0A%7D%0D%0A

Add the Save and Delete methods to the Rule Service