public static SyncAgentConfigCommand getSyncAgentConfigCommand() { SyncAgentConfigCommand cmd = new SyncAgentConfigCommand(); cmd.setNapdexTraceTagRules(Arrays.asList(new NapdexTraceTagRule(1234, "pattern1", 4321), new NapdexTraceTagRule(2345, "pattern2", 5432), new NapdexTraceTagRule(3456, "pattern3", 6543))); cmd.setExcludeTracePathList(Arrays.asList("path1", "path2", "path3")); cmd.setMaxNumberOfTracesPerMinute(1234); return cmd; }
public List<NapdexTraceTagRule> getNapdexTraceTagRules() { List<NapdexTraceTagRule> rules = new LinkedList<NapdexTraceTagRule>(); int i = 1; Serializable patternValue = configuration.get(NAPDEX_TRACE_TAG_RULE_PREFIX + i + PATTERN_SUFFIX); Serializable thresholdValue = configuration.get(NAPDEX_TRACE_TAG_RULE_PREFIX + i + THRESHOLD_SUFFIX); Serializable precedenceValue = configuration.get(NAPDEX_TRACE_TAG_RULE_PREFIX + i + PRECEDENCE_SUFFIX); while (patternValue != null && thresholdValue != null && precedenceValue != null) { rules.add(new NapdexTraceTagRule(((Number)precedenceValue).intValue(), (String)patternValue, ((Number)thresholdValue).longValue())); i++; patternValue = configuration.get(NAPDEX_TRACE_TAG_RULE_PREFIX + + i + PATTERN_SUFFIX); thresholdValue = configuration.get(NAPDEX_TRACE_TAG_RULE_PREFIX + + i + THRESHOLD_SUFFIX); precedenceValue = configuration.get(NAPDEX_TRACE_TAG_RULE_PREFIX + + i + PRECEDENCE_SUFFIX); } return rules; }
public static SyncTraceTagRuleListCommand getTraceTagCommand() { TraceTagRuleList ttrl = new TraceTagRuleList(); ttrl.addRule(new NapdexTraceTagRule(1, "butter", 344555)); return new SyncTraceTagRuleListCommand(ttrl); }
public TraceTagRuleList getRuleList() { TraceTagRuleList ruleList = new TraceTagRuleList(); for (PersistedTraceTagRule rule : dao.getRuleList().getRules()) { ruleList.addRule(new NapdexTraceTagRule(rule.getPrecedence(), rule.getPattern(), rule.getThreshold())); } return ruleList; }