@Test public void testFontArguments() throws Exception { long end = System.currentTimeMillis(); long start = end - (24 * 60 * 60 * 1000); String[] command = new String[] { "--start=" + start, "--end=" + end, "--font=DEFAULT:16", "--font", "TITLE:18:", "CDEF:something=1", "PRINT:something:AVERAGE:\"%le\"" }; JRobinRrdGraphDetails graphDetails = (JRobinRrdGraphDetails) m_strategy.createGraphReturnDetails(StringUtils.arrayToDelimitedString(command, " "), new File("")); assertNotNull("graph details object", graphDetails); }
public RrdGraphDetails createGraphReturnDetails(final String command, final File workDir) throws IOException, org.opennms.netmgt.rrd.RrdException { try { String[] commandArray = tokenize(command, " \t", false); RrdGraphDef graphDef = createGraphDef(workDir, commandArray); graphDef.setSignature("OpenNMS/JRobin"); RrdGraph graph = new RrdGraph(graphDef); return new JRobinRrdGraphDetails(graph, command); } catch (Throwable e) { log().error("JRobin: exception occurred creating graph: " + e.getMessage(), e); throw new org.opennms.netmgt.rrd.RrdException("An exception occurred creating the graph: " + e.getMessage(), e); } }
JRobinRrdStrategy implements RrdStrategy<RrdDef,RrdDb> { public RrdGraphDetails createGraphReturnDetails(final String command, final File workDir) throws IOException, org.opennms.netmgt.rrd.RrdException { try { String[] commandArray = tokenize(command, " \t", false); RrdGraphDef graphDef = createGraphDef(workDir, commandArray); graphDef.setSignature("OpenNMS/JRobin"); RrdGraph graph = new RrdGraph(graphDef); return new JRobinRrdGraphDetails(graph, command); } catch (Throwable e) { log().error("JRobin: exception occurred creating graph: " + e.getMessage(), e); throw new org.opennms.netmgt.rrd.RrdException("An exception occurred creating the graph: " + e.getMessage(), e); } } }
JRobinRrdStrategy implements RrdStrategy<RrdDef,RrdDb> { public RrdGraphDetails createGraphReturnDetails(final String command, final File workDir) throws IOException, org.opennms.netmgt.rrd.RrdException { try { String[] commandArray = tokenize(command, " \t", false); RrdGraphDef graphDef = createGraphDef(workDir, commandArray); graphDef.setSignature("OpenNMS/JRobin"); RrdGraph graph = new RrdGraph(graphDef); return new JRobinRrdGraphDetails(graph, command); } catch (Throwable e) { log().error("JRobin: exception occurred creating graph: " + e.getMessage(), e); throw new org.opennms.netmgt.rrd.RrdException("An exception occurred creating the graph: " + e.getMessage(), e); } } JRobinRrdStrategy(); }
JRobinRrdStrategy implements RrdStrategy<RrdDef,RrdDb> { public RrdGraphDetails createGraphReturnDetails(final String command, final File workDir) throws IOException, org.opennms.netmgt.rrd.RrdException { try { String[] commandArray = tokenize(command, " \t", false); RrdGraphDef graphDef = createGraphDef(workDir, commandArray); graphDef.setSignature("OpenNMS/JRobin"); RrdGraph graph = new RrdGraph(graphDef); return new JRobinRrdGraphDetails(graph, command); } catch (Throwable e) { log().error("JRobin: exception occurred creating graph: " + e.getMessage(), e); throw new org.opennms.netmgt.rrd.RrdException("An exception occurred creating the graph: " + e.getMessage(), e); } } JRobinRrdStrategy(); Properties getConfigurationProperties(); void setConfigurationProperties(final Properties configurationParameters); void closeFile(final RrdDb rrdFile); RrdDef createDefinition(final String creator,
			final String directory, final String rrdName, int step,
			final List<RrdDataSource> dataSources, final List<String> rraList); void createFile(final RrdDef rrdDef,  Map<String, String> attributeMappings); RrdDb openFile(final String fileName); void updateFile(final RrdDb rrdFile, final String owner, final String data); Double fetchLastValue(final String fileName, final String ds, final int interval); Double fetchLastValue(final String fileName, final String ds, final String consolidationFunction, final int interval); Double fetchLastValueInRange(final String fileName, final String ds, final int interval, final int range); InputStream createGraph(final String command, final File workDir); RrdGraphDetails createGraphReturnDetails(final String command, final File workDir); void promoteEnqueuedFiles(Collection<String> rrdFiles); String getStats(); int getGraphLeftOffset(); int getGraphRightOffset(); int getGraphTopOffsetWithText(); String getDefaultFileExtension(); static String[] tokenizeWithQuotingAndEscapes(String line, String delims, boolean processQuoted); static String[] tokenizeWithQuotingAndEscapes(final String line, final String delims, final boolean processQuoted, final String tokens); static char[] escapeIfNotPathSepInDEF(final char encountered, final char escaped, final StringBuffer currToken); }
JRobinRrdStrategy implements RrdStrategy<RrdDef,RrdDb> { public RrdGraphDetails createGraphReturnDetails(final String command, final File workDir) throws IOException, org.opennms.netmgt.rrd.RrdException { try { String[] commandArray = tokenize(command, " \t", false); RrdGraphDef graphDef = createGraphDef(workDir, commandArray); graphDef.setSignature("OpenNMS/JRobin"); RrdGraph graph = new RrdGraph(graphDef); return new JRobinRrdGraphDetails(graph, command); } catch (Throwable e) { log().error("JRobin: exception occurred creating graph: " + e.getMessage(), e); throw new org.opennms.netmgt.rrd.RrdException("An exception occurred creating the graph: " + e.getMessage(), e); } } JRobinRrdStrategy(); Properties getConfigurationProperties(); void setConfigurationProperties(final Properties configurationParameters); void closeFile(final RrdDb rrdFile); RrdDef createDefinition(final String creator,
			final String directory, final String rrdName, int step,
			final List<RrdDataSource> dataSources, final List<String> rraList); void createFile(final RrdDef rrdDef,  Map<String, String> attributeMappings); RrdDb openFile(final String fileName); void updateFile(final RrdDb rrdFile, final String owner, final String data); Double fetchLastValue(final String fileName, final String ds, final int interval); Double fetchLastValue(final String fileName, final String ds, final String consolidationFunction, final int interval); Double fetchLastValueInRange(final String fileName, final String ds, final int interval, final int range); InputStream createGraph(final String command, final File workDir); RrdGraphDetails createGraphReturnDetails(final String command, final File workDir); void promoteEnqueuedFiles(Collection<String> rrdFiles); String getStats(); int getGraphLeftOffset(); int getGraphRightOffset(); int getGraphTopOffsetWithText(); String getDefaultFileExtension(); static String[] tokenizeWithQuotingAndEscapes(String line, String delims, boolean processQuoted); static String[] tokenizeWithQuotingAndEscapes(final String line, final String delims, final boolean processQuoted, final String tokens); static char[] escapeIfNotPathSepInDEF(final char encountered, final char escaped, final StringBuffer currToken);  }