1
2
3
4
5
6
7
8
9 package org.jrobin.core.jrrd;
10
11 import java.io.IOException;
12
13
14
15
16
17
18
19 public class Main {
20
21 public Main(String rrdFile) {
22
23 RRDatabase rrd = null;
24 DataChunk chunk = null;
25
26 try {
27 rrd = new RRDatabase(rrdFile);
28 chunk = rrd.getData(ConsolidationFunctionType.AVERAGE);
29 } catch (Exception e) {
30 e.printStackTrace();
31
32 return;
33 }
34
35 rrd.toXml(System.out);
36 rrd.printInfo(System.out);
37 System.out.println(rrd);
38 System.out.println(chunk);
39
40 try {
41 rrd.close();
42 } catch (IOException e) {
43 e.printStackTrace();
44 }
45 }
46
47 static void usage(int status) {
48 System.err.println("Usage: " + Main.class.getName() + " rrdfile");
49 System.exit(status);
50 }
51
52 public static void main(String[] args) {
53 if (args.length != 1) {
54 usage(1);
55 }
56 new Main(args[0]);
57 }
58 }