test_class.declarator: caller
test_class.modifier: @Mock
  	private
test_class.original_string: @Mock
  	private RulesEngineCaller<Object, Object> caller;
test_class.type: RulesEngineCaller<Object, Object>
test_class.var_name: caller
test_class.declarator: testFactory
test_class.modifier: private
test_class.original_string: private TestFactory testFactory;
test_class.type: TestFactory
test_class.var_name: testFactory
test_class.declarator: engine
test_class.modifier: private
test_class.original_string: private StatelessRulesEngine<Object, Object> engine;
test_class.type: StatelessRulesEngine<Object, Object>
test_class.var_name: engine
test_class.file: wraith-engine/src/test/java/io/symcpe/wraith/rules/TestStatelessRulesEngine.java
test_class.identifier: TestStatelessRulesEngine
test_case.body: @Test
  	public void testInitializeRules() throws Exception {
  		Map<String, String> conf = new HashMap<>();
  		conf.put(TestFactory.RULES_CONTENT,
  				RuleSerializer.serializeRulesToJSONString(Arrays.asList(new SimpleRule((short) 1122, "test1", true,
  						new EqualsCondition("host", "val"), new AlertAction((short) 2, "test", "test", "test"))),
  						false));
  		engine.initializeRules(conf);
  		Map<Short, Rule> map = engine.getRuleMap();
  		assertEquals(1, map.size());
  	}
test_case.class_method_signature: TestStatelessRulesEngine.testInitializeRules()
test_case.full_signature: @Test public void testInitializeRules()
test_case.identifier: testInitializeRules
test_case.invocations: put serializeRulesToJSONString asList initializeRules getRuleMap assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInitializeRules()
focal_class.declarator: logger = LoggerFactory.getLogger(StatelessRulesEngine.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(StatelessRulesEngine.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: ruleMap
focal_class.modifier: private
focal_class.original_string: private Map<Short, Rule> ruleMap;
focal_class.type: Map<Short, Rule>
focal_class.var_name: ruleMap
focal_class.declarator: ruleGroupMap
focal_class.modifier: private
focal_class.original_string: private Map<String, Map<Short, Rule>> ruleGroupMap;
focal_class.type: Map<String, Map<Short, Rule>>
focal_class.var_name: ruleGroupMap
focal_class.declarator: caller
focal_class.modifier: private
focal_class.original_string: private RulesEngineCaller<K, C> caller;
focal_class.type: RulesEngineCaller<K, C>
focal_class.var_name: caller
focal_class.declarator: eventFactory
focal_class.modifier: private
focal_class.original_string: private EventFactory eventFactory;
focal_class.type: EventFactory
focal_class.var_name: eventFactory
focal_class.declarator: storeFactory
focal_class.modifier: private
focal_class.original_string: private StoreFactory storeFactory;
focal_class.type: StoreFactory
focal_class.var_name: storeFactory
focal_class.declarator: ruleGroupsActive
focal_class.modifier: private
focal_class.original_string: private boolean ruleGroupsActive;
focal_class.type: boolean
focal_class.var_name: ruleGroupsActive
focal_class.declarator: hashSize
focal_class.modifier: private
focal_class.original_string: private int hashSize;
focal_class.type: int
focal_class.var_name: hashSize
focal_class.file: wraith-engine/src/main/java/io/symcpe/wraith/rules/StatelessRulesEngine.java
focal_class.identifier: StatelessRulesEngine
focal_class.class_method_signature: StatelessRulesEngine.StatelessRulesEngine(RulesEngineCaller<K, C> caller, EventFactory eventFactory, StoreFactory storeFactory)
focal_class.full_signature: public  StatelessRulesEngine(RulesEngineCaller<K, C> caller, EventFactory eventFactory, StoreFactory storeFactory)
focal_class.identifier: StatelessRulesEngine
focal_class.modifiers: public
focal_class.parameters: (RulesEngineCaller<K, C> caller, EventFactory eventFactory, StoreFactory storeFactory)
focal_class.signature:  StatelessRulesEngine(RulesEngineCaller<K, C> caller, EventFactory eventFactory, StoreFactory storeFactory)
focal_class.class_method_signature: StatelessRulesEngine.initializeRules(Map<String, String> conf)
focal_class.full_signature: public void initializeRules(Map<String, String> conf)
focal_class.identifier: initializeRules
focal_class.modifiers: public
focal_class.parameters: (Map<String, String> conf)
focal_class.return: void
focal_class.signature: void initializeRules(Map<String, String> conf)
focal_class.class_method_signature: StatelessRulesEngine.updateRuleMap(Map<Short, Rule> ruleMap, String ruleJson, boolean delete)
focal_class.full_signature: public static Rule updateRuleMap(Map<Short, Rule> ruleMap, String ruleJson, boolean delete)
focal_class.identifier: updateRuleMap
focal_class.modifiers: public static
focal_class.parameters: (Map<Short, Rule> ruleMap, String ruleJson, boolean delete)
focal_class.return: Rule
focal_class.signature: Rule updateRuleMap(Map<Short, Rule> ruleMap, String ruleJson, boolean delete)
focal_class.class_method_signature: StatelessRulesEngine.updateRule(String ruleGroup, String ruleJson, boolean delete)
focal_class.full_signature: public void updateRule(String ruleGroup, String ruleJson, boolean delete)
focal_class.identifier: updateRule
focal_class.modifiers: public
focal_class.parameters: (String ruleGroup, String ruleJson, boolean delete)
focal_class.return: void
focal_class.signature: void updateRule(String ruleGroup, String ruleJson, boolean delete)
focal_class.class_method_signature: StatelessRulesEngine.evaluateEventAgainstAllRules(C eventCollector, K eventContainer, Event event)
focal_class.full_signature: public void evaluateEventAgainstAllRules(C eventCollector, K eventContainer, Event event)
focal_class.identifier: evaluateEventAgainstAllRules
focal_class.modifiers: public
focal_class.parameters: (C eventCollector, K eventContainer, Event event)
focal_class.return: void
focal_class.signature: void evaluateEventAgainstAllRules(C eventCollector, K eventContainer, Event event)
focal_class.class_method_signature: StatelessRulesEngine.evaluateEventAgainstGroupedRules(C eventCollector, K eventContainer, Event event)
focal_class.full_signature: public void evaluateEventAgainstGroupedRules(C eventCollector, K eventContainer, Event event)
focal_class.identifier: evaluateEventAgainstGroupedRules
focal_class.modifiers: public
focal_class.parameters: (C eventCollector, K eventContainer, Event event)
focal_class.return: void
focal_class.signature: void evaluateEventAgainstGroupedRules(C eventCollector, K eventContainer, Event event)
focal_class.class_method_signature: StatelessRulesEngine.evaluateEventAgainstRule(String ruleGroup, Rule rule, C eventCollector, K eventContainer, Event event)
focal_class.full_signature: public void evaluateEventAgainstRule(String ruleGroup, Rule rule, C eventCollector, K eventContainer, Event event)
focal_class.identifier: evaluateEventAgainstRule
focal_class.modifiers: public
focal_class.parameters: (String ruleGroup, Rule rule, C eventCollector, K eventContainer, Event event)
focal_class.return: void
focal_class.signature: void evaluateEventAgainstRule(String ruleGroup, Rule rule, C eventCollector, K eventContainer, Event event)
focal_class.class_method_signature: StatelessRulesEngine.applyRuleAction(C eventCollector, K eventContainer, Event event, Rule rule, Action action)
focal_class.full_signature: protected void applyRuleAction(C eventCollector, K eventContainer, Event event, Rule rule, Action action)
focal_class.identifier: applyRuleAction
focal_class.modifiers: protected
focal_class.parameters: (C eventCollector, K eventContainer, Event event, Rule rule, Action action)
focal_class.return: void
focal_class.signature: void applyRuleAction(C eventCollector, K eventContainer, Event event, Rule rule, Action action)
focal_class.class_method_signature: StatelessRulesEngine.getRuleMap()
focal_class.full_signature: public Map<Short, Rule> getRuleMap()
focal_class.identifier: getRuleMap
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<Short, Rule>
focal_class.signature: Map<Short, Rule> getRuleMap()
focal_class.class_method_signature: StatelessRulesEngine.getRuleGroupMap()
focal_class.full_signature: public Map<String, Map<Short, Rule>> getRuleGroupMap()
focal_class.identifier: getRuleGroupMap
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<String, Map<Short, Rule>>
focal_class.signature: Map<String, Map<Short, Rule>> getRuleGroupMap()
focal_class.class_method_signature: StatelessRulesEngine.isRuleGroupsActive()
focal_class.full_signature: public boolean isRuleGroupsActive()
focal_class.identifier: isRuleGroupsActive
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isRuleGroupsActive()
focal_class.class_method_signature: StatelessRulesEngine.getHashSize()
focal_class.full_signature: public int getHashSize()
focal_class.identifier: getHashSize
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getHashSize()
focal_method.body: public void initializeRules(Map<String, String> conf) throws Exception {
  		ruleGroupsActive = Boolean.parseBoolean(conf.getOrDefault(Constants.RULE_GROUP_ACTIVE, Constants.FALSE));
  		hashSize = Integer.parseInt(conf.getOrDefault(Constants.RULE_HASH_INIT_SIZE, Constants.DEFAULT_RULE_HASH_SIZE));
  		if (!ruleGroupsActive) {
  			this.ruleMap = new LinkedHashMap<>(hashSize);
  		} else {
  			this.ruleGroupMap = new HashMap<>(hashSize);
  		}
  		RulesStore store = null;
  		try {
  			store = storeFactory.getRulesStore(conf.get(Constants.RSTORE_TYPE), conf);
  		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
  			throw e;
  		}
  		try {
  			store.connect();
  			if (!ruleGroupsActive) {
  				this.ruleMap.putAll(store.listRules());
  			} else {
  				this.ruleGroupMap.putAll(store.listGroupedRules());
  			}
  			store.disconnect();
  		} catch (IOException e) {
  			logger.error("Failed to load rules from store, reason:" + e.getMessage());
  			throw e;
  		}
  	}
focal_method.class_method_signature: StatelessRulesEngine.initializeRules(Map<String, String> conf)
focal_method.full_signature: public void initializeRules(Map<String, String> conf)
focal_method.identifier: initializeRules
focal_method.invocations: parseBoolean getOrDefault parseInt getOrDefault getRulesStore get connect putAll listRules putAll listGroupedRules disconnect error getMessage
focal_method.modifiers: public
focal_method.parameters: (Map<String, String> conf)
focal_method.return: void
focal_method.signature: void initializeRules(Map<String, String> conf)