|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rrd4j.core.jrrd.RRDatabase
public class RRDatabase
Instances of this class model Round Robin Database (RRD) files.
Constructor Summary | |
---|---|
RRDatabase(File file)
Creates a database to read from. |
|
RRDatabase(String name)
Creates a database to read from. |
Method Summary | |
---|---|
void |
close()
Closes this database stream and releases any associated system resources. |
Archive |
getArchive(int index)
Returns the Archive at the specified position in this database. |
Archive |
getArchive(String name)
|
Iterator<Archive> |
getArchives()
Returns an iterator over the archives in this database in proper sequence. |
Iterator<Archive> |
getArchives(ConsolidationFunctionType type)
Returns an iterator over the archives in this database of the given type in proper sequence. |
DataChunk |
getData(ConsolidationFunctionType type)
Returns data from the database corresponding to the given consolidation function and a step size of 1. |
DataChunk |
getData(ConsolidationFunctionType type,
Date startDate,
Date endDate,
long step)
Returns data from the database corresponding to the given consolidation function. |
DataChunk |
getData(ConsolidationFunctionType type,
long start,
long end,
long step)
|
DataSource |
getDataSource(int index)
Returns the DataSource at the specified position in this database. |
Iterator<DataSource> |
getDataSources()
Returns an iterator over the data sources in this database in proper sequence. |
Set<String> |
getDataSourcesName()
|
Header |
getHeader()
Returns the Header for this database. |
Date |
getLastUpdate()
Returns the date this database was last updated. |
int |
getNumArchives()
Returns the number of archives in this database. |
void |
printInfo(PrintStream s)
Outputs the header information of the database to the given print stream using the default number format. |
void |
printInfo(PrintStream s,
NumberFormat numberFormat)
Outputs the header information of the database to the given print stream using the given number format. |
String |
toString()
Returns a summary the contents of this database. |
void |
toXml(PrintStream s)
Outputs the content of the database to the given print stream as a stream of XML. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RRDatabase(String name) throws IOException
name
- the filename of the file to read from.
IOException
- if an I/O error occurs.public RRDatabase(File file) throws IOException
file
- the file to read from.
IOException
- if an I/O error occurs.Method Detail |
---|
public Header getHeader()
Header
for this database.
Header
for this database.public Set<String> getDataSourcesName()
public Date getLastUpdate()
rrdtool last
call Date.getTime() and
divide the result by 1000.
public DataSource getDataSource(int index)
DataSource
at the specified position in this database.
index
- index of DataSource
to return.
DataSource
at the specified position in this databasepublic Iterator<DataSource> getDataSources()
public Archive getArchive(int index)
Archive
at the specified position in this database.
index
- index of Archive
to return.
Archive
at the specified position in this database.public Archive getArchive(String name)
public Iterator<Archive> getArchives()
public int getNumArchives()
public Iterator<Archive> getArchives(ConsolidationFunctionType type)
type
- the consolidation function that should have been applied to
the data.
public void close() throws IOException
IOException
- if an I/O error occurs.public void printInfo(PrintStream s)
double
is 0.0000000000E0.
s
- the PrintStream to print the header information to.public DataChunk getData(ConsolidationFunctionType type) throws IOException
type
- the consolidation function that should have been applied to
the data.
IllegalArgumentException
- if there was a problem locating a data archive with
the requested consolidation function.
IOException
- if there was a problem reading data from the database.public DataChunk getData(ConsolidationFunctionType type, Date startDate, Date endDate, long step) throws IOException
type
- the consolidation function that should have been applied to
the data.step
- the step size to use.
IllegalArgumentException
- if there was a problem locating a data archive with
the requested consolidation function.
IOException
- if there was a problem reading data from the database.public DataChunk getData(ConsolidationFunctionType type, long start, long end, long step) throws IOException
IOException
public void printInfo(PrintStream s, NumberFormat numberFormat)
s
- the PrintStream to print the header information to.numberFormat
- the format to print double
s as.public void toXml(PrintStream s)
s
- the PrintStream to send the XML to.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |