Examples of RrdDefTemplate


Examples of org.jrobin.core.RrdDefTemplate

     
      if (!rrdFile.exists())
      {
        InputStream templateIs = getClass().getResourceAsStream(RDD_TEMPLATE_FILE_NAME);

        RrdDefTemplate defTemplate = new RrdDefTemplate(new InputSource(templateIs));

        defTemplate.setVariable("path", _rrdPath);
        defTemplate.setVariable("start", new Date(System.currentTimeMillis()));
        RrdDef rrdDef = defTemplate.getRrdDef();

        RrdDb rrdDb = _rrdPool.requestRrdDb(rrdDef);
        rrdDb.getRrdDef().getStep();
        _rrdPool.release(rrdDb);
      }
View Full Code Here

Examples of org.jrobin.core.RrdDefTemplate

  /**
   * If the database file doesn't exist, it'll get created, otherwise, it'll
   * be returned in r/w mode.
   */
  protected RrdDef getDatabaseTemplateSpec() throws Exception {
    RrdDefTemplate t = new RrdDefTemplate(templateFile);
    t.setVariable("database", this.outputFile.getCanonicalPath());
    RrdDef def = t.getRrdDef();
    if (!this.outputFile.exists()) {
      FileUtils.forceMkdir(this.outputFile.getParentFile());
      rrdToolCreateDatabase(def);
    }
    return def;
View Full Code Here

Examples of org.jrobin.core.RrdDefTemplate

   */
  protected RrdDb createOrOpenDatabase() throws Exception {
    RrdDb result;
    if (!this.outputFile.exists()) {
      FileUtils.forceMkdir(this.outputFile.getParentFile());
      RrdDefTemplate t = new RrdDefTemplate(this.templateFile);
      t.setVariable("database", this.outputFile.getCanonicalPath());
      RrdDef def = t.getRrdDef();
      result = new RrdDb(def);
    } else {
      result = new RrdDb(this.outputFile.getCanonicalPath());
    }
    return result;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.