protected Collection<Report> generateReportsByJmxDatacollectionConfig(InputStream inputConfigStream) { return generateReportsByJmxDatacollectionConfig(JaxbUtils.unmarshal(JmxDatacollectionConfig.class, inputConfigStream)); }
protected Collection<Report> generateReportsByJmxDatacollectionConfig(InputStream inputConfigStream) { return generateReportsByJmxDatacollectionConfig(JaxbUtils.unmarshal(JmxDatacollectionConfig.class, inputConfigStream)); }
public Collection<Report> generateReportsByJmxDatacollectionConfig(String inputConfigFileName) { final JmxDatacollectionConfig config = JaxbUtils.unmarshal(JmxDatacollectionConfig.class, new File(inputConfigFileName)); return generateReportsByJmxDatacollectionConfig(config); }
public Collection<Report> generateReportsByJmxDatacollectionConfig(String inputConfigFileName) { final JmxDatacollectionConfig config = JaxbUtils.unmarshal(JmxDatacollectionConfig.class, new File(inputConfigFileName)); return generateReportsByJmxDatacollectionConfig(config); }
@Override protected void execute() throws CmdRunException, CmdLineException { if (printTemplate) { LOG.info(getClass().getResourceAsStream("/graphTemplate.vm")); return; } try { JmxConfigReader jmxToSnmpGraphConfigGen = new JmxConfigReader(LOG); Collection<Report> reports = jmxToSnmpGraphConfigGen.generateReportsByJmxDatacollectionConfig(inputFile); GraphConfigGenerator graphConfigGenerator = new GraphConfigGenerator(LOG); String snmpGraphConfig = graphConfigGenerator.generateSnmpGraph(reports, templateFile); LOG.info(snmpGraphConfig); ByteStreams.copy(new ByteArrayInputStream(snmpGraphConfig.getBytes()), new FileOutputStream(outFile)); } catch (IOException ioex) { throw new CmdRunException(ioex); } }
@Override protected void execute() throws CmdRunException, CmdLineException { if (printTemplate) { LOG.info(getClass().getResourceAsStream("/graphTemplate.vm")); return; } try { JmxConfigReader jmxToSnmpGraphConfigGen = new JmxConfigReader(LOG); Collection<Report> reports = jmxToSnmpGraphConfigGen.generateReportsByJmxDatacollectionConfig(inputFile); GraphConfigGenerator graphConfigGenerator = new GraphConfigGenerator(LOG); String snmpGraphConfig = graphConfigGenerator.generateSnmpGraph(reports, templateFile); LOG.info(snmpGraphConfig); ByteStreams.copy(new ByteArrayInputStream(snmpGraphConfig.getBytes()), new FileOutputStream(outFile)); } catch (IOException ioex) { throw new CmdRunException(ioex); } }
@Override public void run() { if (model == null) { return; } // create snmp-graph.properties try { GraphConfigGenerator graphConfigGenerator = new GraphConfigGenerator(); Collection<Report> reports = new JmxConfigReader() .generateReportsByJmxDatacollectionConfig(model.getOutputConfig()); model.setSnmpGraphProperties(graphConfigGenerator.generateSnmpGraph(reports)); } catch (IOException ex) { model.setSnmpGraphProperties(ex.getMessage()); // TODO handle Errors in UI LOG.error("SNMP Graph-Properties couldn't be created.", ex); } model.updateOutput(); updateView(UiState.ResultView); removeWindow(getProgressWindow()); } }
@Override public Void execute() throws TaskRunException { // create snmp-graph.properties GraphConfigGenerator graphConfigGenerator = new GraphConfigGenerator(new Slf4jLogAdapter(GraphConfigGenerator.class)); Collection<Report> reports = new JmxConfigReader(new Slf4jLogAdapter(JmxConfigReader.class)).generateReportsByJmxDatacollectionConfig(model.getOutputConfig()); model.setSnmpGraphProperties(graphConfigGenerator.generateSnmpGraph(reports)); model.updateOutput(); return null; }
@Override public Void execute() throws JobManager.TaskRunException { // create snmp-graph.properties GraphConfigGenerator graphConfigGenerator = new GraphConfigGenerator(new Slf4jLogAdapter(GraphConfigGenerator.class)); Collection<Report> reports = new JmxConfigReader(new Slf4jLogAdapter(JmxConfigReader.class)).generateReportsByJmxDatacollectionConfig(model.getOutputConfig()); model.setSnmpGraphProperties(graphConfigGenerator.generateSnmpGraph(reports)); model.updateOutput(); return null; }