1 /* ============================================================
2 * JRobin : Pure java implementation of RRDTool's functionality
3 * ============================================================
4 *
5 * Project Info: http://www.jrobin.org
6 * Project Lead: Sasa Markovic (saxon@jrobin.org)
7 *
8 * Developers: Sasa Markovic (saxon@jrobin.org)
9 *
10 *
11 * (C) Copyright 2003-2005, by Sasa Markovic.
12 *
13 * This library is free software; you can redistribute it and/or modify it under the terms
14 * of the GNU Lesser General Public License as published by the Free Software Foundation;
15 * either version 2.1 of the License, or (at your option) any later version.
16 *
17 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
18 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 * See the GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public License along with this
22 * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
23 * Boston, MA 02111-1307, USA.
24 */
25
26 package org.jrobin.graph;
27
28 import org.jrobin.data.DataProcessor;
29
30 class Def extends Source {
31 private final String rrdPath, dsName, consolFun, backend;
32
33 Def(String name, String rrdPath, String dsName, String consolFun) {
34 this(name, rrdPath, dsName, consolFun, null);
35 }
36
37 Def(String name, String rrdPath, String dsName, String consolFun, String backend) {
38 super(name);
39 this.rrdPath = rrdPath;
40 this.dsName = dsName;
41 this.consolFun = consolFun;
42 this.backend = backend;
43 }
44
45 void requestData(DataProcessor dproc) {
46 if (backend == null) {
47 dproc.addDatasource(name, rrdPath, dsName, consolFun);
48 }
49 else {
50 dproc.addDatasource(name, rrdPath, dsName, consolFun, backend);
51 }
52 }
53 }
54