@Override public void setConf(AbstractConfig config) { this.config = (ForkOperationConfig) config; List<List<OperationProcessor>> processors = new ArrayList<List<OperationProcessor>>(); OperationFactoryFactory off = new OperationFactoryFactory(); for (Fork fork : this.config.getForks()) { List<OperationProcessor> processorsInFork = new ArrayList<OperationProcessor>(); for (OperationConfig opConfig : fork.getOperations()) { try { processorsInFork.add(new OperationProcessor(off.getFactory(opConfig))); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } processors.add(processorsInFork); } this.processors = processors; }
@Override public void setConf(AbstractConfig config) { this.config = (ForkOperationConfig) config; List<List<OperationProcessor>> processors = new ArrayList<List<OperationProcessor>>(); OperationFactoryFactory off = new OperationFactoryFactory(); for (Fork fork : this.config.getForks()) { List<OperationProcessor> processorsInFork = new ArrayList<OperationProcessor>(); for (OperationConfig opConfig : fork.getOperations()) { try { processorsInFork.add(new OperationProcessor(off.getFactory(opConfig))); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } processors.add(processorsInFork); } this.processors = processors; }
@Override public void setConf(AbstractConfig config) { this.config = (ConditionalOperationConfig) config; List<Pair<FilterOperation, List<OperationProcessor>>> cases = new ArrayList<Pair<FilterOperation, List<OperationProcessor>>>(); OperationFactoryFactory off = new OperationFactoryFactory(); for (Condition caze : this.config.getConditions()) { List<OperationProcessor> processorsInCase = new ArrayList<OperationProcessor>(); /* * Create {@OperationProcessor}s from configs */ for (OperationConfig opConfig : caze.getOperations()) { try { processorsInCase.add(new OperationProcessor(off.getFactory(opConfig))); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } FilterOperation filter; try { filter = (FilterOperation) off.getFactory(caze.getCondition()).newInstance(); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } cases.add( new ImmutablePair<FilterOperation, List<OperationProcessor>>(filter, processorsInCase)); } this.cases = cases; }
@Override public void setConf(AbstractConfig config) { this.config = (ConditionalOperationConfig) config; List<Pair<FilterOperation, List<OperationProcessor>>> cases = new ArrayList<Pair<FilterOperation, List<OperationProcessor>>>(); OperationFactoryFactory off = new OperationFactoryFactory(); for (Condition caze : this.config.getConditions()) { List<OperationProcessor> processorsInCase = new ArrayList<OperationProcessor>(); /* * Create {@OperationProcessor}s from configs */ for (OperationConfig opConfig : caze.getOperations()) { try { processorsInCase.add(new OperationProcessor(off.getFactory(opConfig))); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } FilterOperation filter; try { filter = (FilterOperation) off.getFactory(caze.getCondition()).newInstance(); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } cases.add( new ImmutablePair<FilterOperation, List<OperationProcessor>>(filter, processorsInCase)); } this.cases = cases; }
public Source(SourceConfig config) throws ClassNotFoundException { this.sourceRegex = Pattern.compile(config.getSourceRegex()); this.sourceName = config.getName(); DeserializerFactory dFactory = dff.getFactory(config.getDeserializerConfig()); this.deserProcessor = new DeserializerProcessor(dFactory.newInstance()); List<OperationConfig> operationConfigs = config.getOperationConfigs(); if (operationConfigs.size() > 0) { OperationFactoryFactory off = new OperationFactoryFactory(); for (OperationConfig operationConfig : operationConfigs) { this.operationProcessors.add(new OperationProcessor(off.getFactory(operationConfig))); } } this.containsStrings.addAll(config.getContainsStrings()); for (String strRegex : config.getRegexPatterns()) { this.regexPatterns.add(Pattern.compile(strRegex)); } }
public Source(SourceConfig config) throws ClassNotFoundException { this.sourceRegex = Pattern.compile(config.getSourceRegex()); this.sourceName = config.getName(); DeserializerFactory dFactory = dff.getFactory(config.getDeserializerConfig()); this.deserProcessor = new DeserializerProcessor(dFactory.newInstance()); List<OperationConfig> operationConfigs = config.getOperationConfigs(); if (operationConfigs.size() > 0) { OperationFactoryFactory off = new OperationFactoryFactory(); for (OperationConfig operationConfig : operationConfigs) { this.operationProcessors.add(new OperationProcessor(off.getFactory(operationConfig))); } } this.containsStrings.addAll(config.getContainsStrings()); for (String strRegex : config.getRegexPatterns()) { this.regexPatterns.add(Pattern.compile(strRegex)); } }