test_class.declarator: TEST_TENANT = "test-tenant"
test_class.modifier: private static final
test_class.original_string: private static final String TEST_TENANT = "test-tenant";
test_class.type: String
test_class.var_name: TEST_TENANT
test_class.declarator: TENANT_ID_1 = "b341mmd3ifaasdjm23midijjiro"
test_class.modifier: private static final
test_class.original_string: private static final String TENANT_ID_1 = "b341mmd3ifaasdjm23midijjiro";
test_class.type: String
test_class.var_name: TENANT_ID_1
test_class.declarator: TENANT_ID_2 = "c341mmd3ifaasdjm23midijjiro"
test_class.modifier: private static final
test_class.original_string: private static final String TENANT_ID_2 = "c341mmd3ifaasdjm23midijjiro";
test_class.type: String
test_class.var_name: TENANT_ID_2
test_class.declarator: TENANT_ID_3 = "d341mmd3ifaasdjm23midijjiro"
test_class.modifier: private static final
test_class.original_string: private static final String TENANT_ID_3 = "d341mmd3ifaasdjm23midijjiro";
test_class.type: String
test_class.var_name: TENANT_ID_3
test_class.declarator: TENANT_ID_4 = "e341mmd3ifaasdjm23midijjiro"
test_class.modifier: private static final
test_class.original_string: private static final String TENANT_ID_4 = "e341mmd3ifaasdjm23midijjiro";
test_class.type: String
test_class.var_name: TENANT_ID_4
test_class.declarator: TENANT_ID_5 = "f341mmd3ifaasdjm23midijjiro"
test_class.modifier: private static final
test_class.original_string: private static final String TENANT_ID_5 = "f341mmd3ifaasdjm23midijjiro";
test_class.type: String
test_class.var_name: TENANT_ID_5
test_class.declarator: CONNECTION_STRING = "jdbc:hsqldb:mem:target/rules.db"
test_class.modifier: private static final
test_class.original_string: private static final String CONNECTION_STRING = "jdbc:hsqldb:mem:target/rules.db";
test_class.type: String
test_class.var_name: CONNECTION_STRING
test_class.declarator: TARGET_RULES_DB = "target/rules.db"
test_class.modifier: private static final
test_class.original_string: private static final String TARGET_RULES_DB = "target/rules.db";
test_class.type: String
test_class.var_name: TARGET_RULES_DB
test_class.declarator: emf
test_class.modifier: private static
test_class.original_string: private static EntityManagerFactory emf;
test_class.type: EntityManagerFactory
test_class.var_name: emf
test_class.declarator: em
test_class.modifier: private
test_class.original_string: private EntityManager em;
test_class.type: EntityManager
test_class.var_name: em
test_class.declarator: producer
test_class.modifier: @Mock
  	private
test_class.original_string: @Mock
  	private KafkaProducer<String, String> producer;
test_class.type: KafkaProducer<String, String>
test_class.var_name: producer
test_class.declarator: am
test_class.modifier: @Mock
  	private
test_class.original_string: @Mock
  	private ApplicationManager am;
test_class.type: ApplicationManager
test_class.var_name: am
test_class.declarator: ruleId
test_class.modifier: private static
test_class.original_string: private static short ruleId;
test_class.type: short
test_class.var_name: ruleId
test_class.declarator: templateId
test_class.modifier: private static
test_class.original_string: private static short templateId;
test_class.type: short
test_class.var_name: templateId
test_class.file: hendrix-api/src/test/java/io/symcpe/hendrix/api/dao/TestRulesManager.java
test_class.identifier: TestRulesManager
test_case.body: @Test
  	public void testGetRuleObjects() throws Exception {
  		Rules rule = new Rules();
  		Tenant tenant = RulesManager.getInstance().getTenant(em, TENANT_ID_2);
  		short ruleId = RulesManager.getInstance().createNewRule(em, rule, tenant);
  		try {
  			List<Rule> rules = RulesManager.getInstance().getRuleObjects(em, TENANT_ID_2);
  			assertEquals(1, rules.size());
  			assertEquals(ruleId, rules.get(0).getRuleId());
  			assertEquals("", rules.get(0).getName());
  		} catch (NoResultException e) {
  		}
  		rule = new Rules();
  		rule.setRuleContent(RuleSerializer.serializeRuleToJSONString(
  				new SimpleRule(ruleId, "simple-rule", true, new EqualsCondition("host", "symcpe"),
  						new Action[] { new TemplatedAlertAction((short) 0, templateId) }),
  				false));
  		tenant = RulesManager.getInstance().getTenant(em, TENANT_ID_2);
  		ruleId = RulesManager.getInstance().createNewRule(em, rule, tenant);
  		try {
  			List<Rule> rules = RulesManager.getInstance().getRuleObjects(em, TENANT_ID_2);
  			assertEquals(2, rules.size());
  			for (Rule rule2 : rules) {
  				if (rule2.getRuleId() == ruleId) {
  					assertEquals("simple-rule", rule2.getName());
  					assertEquals("host", ((EqualsCondition) rule2.getCondition()).getkey());
  				}
  			}
  		} catch (NoResultException e) {
  		}
  	}
test_case.class_method_signature: TestRulesManager.testGetRuleObjects()
test_case.full_signature: @Test public void testGetRuleObjects()
test_case.identifier: testGetRuleObjects
test_case.invocations: getTenant getInstance createNewRule getInstance getRuleObjects getInstance assertEquals size assertEquals getRuleId get assertEquals getName get setRuleContent serializeRuleToJSONString getTenant getInstance createNewRule getInstance getRuleObjects getInstance assertEquals size getRuleId assertEquals getName assertEquals getkey getCondition
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetRuleObjects()
focal_class.declarator: HENDRIX_RULE_UPDATES_TXT = "~/hendrix/rule-updates.txt"
focal_class.modifier: private static final
focal_class.original_string: private static final String HENDRIX_RULE_UPDATES_TXT = "~/hendrix/rule-updates.txt";
focal_class.type: String
focal_class.var_name: HENDRIX_RULE_UPDATES_TXT
focal_class.declarator: PARAM_TENANT_ID = "tenantId"
focal_class.modifier: private static final
focal_class.original_string: private static final String PARAM_TENANT_ID = "tenantId";
focal_class.type: String
focal_class.var_name: PARAM_TENANT_ID
focal_class.declarator: PARAM_RULE_ID = "ruleId"
focal_class.modifier: private static final
focal_class.original_string: private static final String PARAM_RULE_ID = "ruleId";
focal_class.type: String
focal_class.var_name: PARAM_RULE_ID
focal_class.declarator: logger = Logger.getLogger(RulesManager.class.getCanonicalName())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = Logger.getLogger(RulesManager.class.getCanonicalName());
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: PARAM_TEMPLATE = "template"
focal_class.modifier: private static final
focal_class.original_string: private static final String PARAM_TEMPLATE = "template";
focal_class.type: String
focal_class.var_name: PARAM_TEMPLATE
focal_class.declarator: RULES_MANAGER = new RulesManager()
focal_class.modifier: private static
focal_class.original_string: private static RulesManager RULES_MANAGER = new RulesManager();
focal_class.type: RulesManager
focal_class.var_name: RULES_MANAGER
focal_class.file: hendrix-api/src/main/java/io/symcpe/hendrix/api/dao/RulesManager.java
focal_class.identifier: RulesManager
focal_class.class_method_signature: RulesManager.RulesManager()
focal_class.full_signature: private  RulesManager()
focal_class.identifier: RulesManager
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  RulesManager()
focal_class.class_method_signature: RulesManager.getInstance()
focal_class.full_signature: public static RulesManager getInstance()
focal_class.identifier: getInstance
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: RulesManager
focal_class.signature: RulesManager getInstance()
focal_class.class_method_signature: RulesManager.createNewRule(EntityManager em, Rules dbRule, Tenant tenant)
focal_class.full_signature: public short createNewRule(EntityManager em, Rules dbRule, Tenant tenant)
focal_class.identifier: createNewRule
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, Rules dbRule, Tenant tenant)
focal_class.return: short
focal_class.signature: short createNewRule(EntityManager em, Rules dbRule, Tenant tenant)
focal_class.class_method_signature: RulesManager.saveRule(EntityManager em, Rules dbRule, Tenant tenant, Rule currRule, ApplicationManager am)
focal_class.full_signature: public Rule saveRule(EntityManager em, Rules dbRule, Tenant tenant, Rule currRule, ApplicationManager am)
focal_class.identifier: saveRule
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, Rules dbRule, Tenant tenant, Rule currRule, ApplicationManager am)
focal_class.return: Rule
focal_class.signature: Rule saveRule(EntityManager em, Rules dbRule, Tenant tenant, Rule currRule, ApplicationManager am)
focal_class.class_method_signature: RulesManager.sendRuleToKafka(boolean delete, String tenantId, Rule rule, ApplicationManager am)
focal_class.full_signature: public void sendRuleToKafka(boolean delete, String tenantId, Rule rule, ApplicationManager am)
focal_class.identifier: sendRuleToKafka
focal_class.modifiers: public
focal_class.parameters: (boolean delete, String tenantId, Rule rule, ApplicationManager am)
focal_class.return: void
focal_class.signature: void sendRuleToKafka(boolean delete, String tenantId, Rule rule, ApplicationManager am)
focal_class.class_method_signature: RulesManager.sendRuleToKafka(boolean delete, String tenantId, String ruleJson, ApplicationManager am)
focal_class.full_signature: public void sendRuleToKafka(boolean delete, String tenantId, String ruleJson, ApplicationManager am)
focal_class.identifier: sendRuleToKafka
focal_class.modifiers: public
focal_class.parameters: (boolean delete, String tenantId, String ruleJson, ApplicationManager am)
focal_class.return: void
focal_class.signature: void sendRuleToKafka(boolean delete, String tenantId, String ruleJson, ApplicationManager am)
focal_class.class_method_signature: RulesManager.getRule(EntityManager em, short ruleId)
focal_class.full_signature: protected Rules getRule(EntityManager em, short ruleId)
focal_class.identifier: getRule
focal_class.modifiers: protected
focal_class.parameters: (EntityManager em, short ruleId)
focal_class.return: Rules
focal_class.signature: Rules getRule(EntityManager em, short ruleId)
focal_class.class_method_signature: RulesManager.getRule(EntityManager em, String tenantId, short ruleId)
focal_class.full_signature: public Rules getRule(EntityManager em, String tenantId, short ruleId)
focal_class.identifier: getRule
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, String tenantId, short ruleId)
focal_class.return: Rules
focal_class.signature: Rules getRule(EntityManager em, String tenantId, short ruleId)
focal_class.class_method_signature: RulesManager.getRuleByTemplateId(EntityManager em, String tenantId, short templateId)
focal_class.full_signature: public List<Short> getRuleByTemplateId(EntityManager em, String tenantId, short templateId)
focal_class.identifier: getRuleByTemplateId
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, String tenantId, short templateId)
focal_class.return: List<Short>
focal_class.signature: List<Short> getRuleByTemplateId(EntityManager em, String tenantId, short templateId)
focal_class.class_method_signature: RulesManager.getRuleObject(EntityManager em, short ruleId)
focal_class.full_signature: protected Rule getRuleObject(EntityManager em, short ruleId)
focal_class.identifier: getRuleObject
focal_class.modifiers: protected
focal_class.parameters: (EntityManager em, short ruleId)
focal_class.return: Rule
focal_class.signature: Rule getRuleObject(EntityManager em, short ruleId)
focal_class.class_method_signature: RulesManager.deleteRule(EntityManager em, String tenantId, short ruleId, ApplicationManager am)
focal_class.full_signature: public void deleteRule(EntityManager em, String tenantId, short ruleId, ApplicationManager am)
focal_class.identifier: deleteRule
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, String tenantId, short ruleId, ApplicationManager am)
focal_class.return: void
focal_class.signature: void deleteRule(EntityManager em, String tenantId, short ruleId, ApplicationManager am)
focal_class.class_method_signature: RulesManager.deleteRules(EntityManager em, Tenant tenant, ApplicationManager am)
focal_class.full_signature: public void deleteRules(EntityManager em, Tenant tenant, ApplicationManager am)
focal_class.identifier: deleteRules
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, Tenant tenant, ApplicationManager am)
focal_class.return: void
focal_class.signature: void deleteRules(EntityManager em, Tenant tenant, ApplicationManager am)
focal_class.class_method_signature: RulesManager.disableAllRules(EntityManager em, String tenantId, ApplicationManager am)
focal_class.full_signature: public void disableAllRules(EntityManager em, String tenantId, ApplicationManager am)
focal_class.identifier: disableAllRules
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, String tenantId, ApplicationManager am)
focal_class.return: void
focal_class.signature: void disableAllRules(EntityManager em, String tenantId, ApplicationManager am)
focal_class.class_method_signature: RulesManager.getRuleObjects(EntityManager em, String tenantId)
focal_class.full_signature: public List<Rule> getRuleObjects(EntityManager em, String tenantId)
focal_class.identifier: getRuleObjects
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, String tenantId)
focal_class.return: List<Rule>
focal_class.signature: List<Rule> getRuleObjects(EntityManager em, String tenantId)
focal_class.class_method_signature: RulesManager.getRules(EntityManager em, String tenantId)
focal_class.full_signature: public List<Rules> getRules(EntityManager em, String tenantId)
focal_class.identifier: getRules
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, String tenantId)
focal_class.return: List<Rules>
focal_class.signature: List<Rules> getRules(EntityManager em, String tenantId)
focal_class.class_method_signature: RulesManager.getRuleContents(EntityManager em, String tenantId, boolean pretty, int filter)
focal_class.full_signature: public String getRuleContents(EntityManager em, String tenantId, boolean pretty, int filter)
focal_class.identifier: getRuleContents
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, String tenantId, boolean pretty, int filter)
focal_class.return: String
focal_class.signature: String getRuleContents(EntityManager em, String tenantId, boolean pretty, int filter)
focal_class.class_method_signature: RulesManager.enableDisableRule(EntityManager em, boolean ruleState, String tenantId, short ruleId,
  			ApplicationManager am)
focal_class.full_signature: public Rules enableDisableRule(EntityManager em, boolean ruleState, String tenantId, short ruleId,
  			ApplicationManager am)
focal_class.identifier: enableDisableRule
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, boolean ruleState, String tenantId, short ruleId,
  			ApplicationManager am)
focal_class.return: Rules
focal_class.signature: Rules enableDisableRule(EntityManager em, boolean ruleState, String tenantId, short ruleId,
  			ApplicationManager am)
focal_class.class_method_signature: RulesManager.getTenant(EntityManager em, String tenantId)
focal_class.full_signature: public Tenant getTenant(EntityManager em, String tenantId)
focal_class.identifier: getTenant
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, String tenantId)
focal_class.return: Tenant
focal_class.signature: Tenant getTenant(EntityManager em, String tenantId)
focal_method.body: public List<Rule> getRuleObjects(EntityManager em, String tenantId) throws Exception {
  		List<Rule> rules = new ArrayList<>();
  		try {
  			List<Rules> results = getRules(em, tenantId);
  			for (Rules rule : results) {
  				if (rule.getRuleContent() != null) {
  					rules.add(RuleSerializer.deserializeJSONStringToRule(rule.getRuleContent()));
  				} else {
  					rules.add(new SimpleRule(rule.getRuleId(), "", false, null, new Action[] {}));
  				}
  			}
  			return rules;
  		} catch (Exception e) {
  			logger.log(Level.SEVERE, "Failed to load rule objects for tenant:" + tenantId, e);
  			throw e;
  		}
  	}
focal_method.class_method_signature: RulesManager.getRuleObjects(EntityManager em, String tenantId)
focal_method.full_signature: public List<Rule> getRuleObjects(EntityManager em, String tenantId)
focal_method.identifier: getRuleObjects
focal_method.invocations: getRules getRuleContent add deserializeJSONStringToRule getRuleContent add getRuleId log
focal_method.modifiers: public
focal_method.parameters: (EntityManager em, String tenantId)
focal_method.return: List<Rule>
focal_method.signature: List<Rule> getRuleObjects(EntityManager em, String tenantId)