public class Header extends Object implements RrdUpdater<Header>
Normally, you don't need to manipulate the Header object directly - Rrd4j framework does it for you.
This header contains metadata about the RRD file.
| Modifier and Type | Field and Description |
|---|---|
(package private) static String | DEFAULT_SIGNATUREDefault signature string for RRD files created by RRD4J. |
(package private) static String | RRDTOOL_VERSION1Version identifier for RRDTool version 1 compatibility. |
(package private) static String | RRDTOOL_VERSION3Version identifier for RRDTool version 3 compatibility. |
(package private) static String | SIGNATURERRD4J signature string used to identify RRD4J files. |
(package private) static int | SIGNATURE_LENGTHLength of the RRD signature string. |
| Constructor and Description |
|---|
Header(RrdDb parentDb,
DataImporter reader) |
Header(RrdDb parentDb,
RrdDef rrdDef) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void | appendXml(XmlWriter writer)Appends header information to XML writer. |
void | copyStateTo(Header header)copyStateTo. |
(package private) String | dump()Returns a string representation of the header information. |
int | getArcCount()Returns the number of archives defined in the RRD. |
int | getDsCount()Returns the number of datasources defined in the RRD. |
String | getInfo()Info string (everything after the signature prefix). |
long | getLastUpdateTime()Returns the last update time of the RRD. |
RrdAllocator | getRrdAllocator()Required to implement RrdUpdater interface. |
RrdBackend | getRrdBackend()Returns the underlying storage (backend) object which actually performs all I/O operations. |
String | getSignature()Returns RRD signature. |
long | getStep()Returns primary RRD time step. |
int | getVersion()Return the RRD version. |
(package private) boolean | isRrd4jHeader()True if the header matches RRD4J or JRobin format. |
void | setInfo(String info)Override the info portion of the RRD signature. |
(package private) void | setLastUpdateTime(long lastUpdateTime)Sets the last update time of the RRD. |
(package private) void | validateHeader()InvalidRrdException if the header is not a valid RRD4J/RRD file. |
static final String DEFAULT_SIGNATURE
static final String RRDTOOL_VERSION1
static final String RRDTOOL_VERSION3
static final String SIGNATURE
static final int SIGNATURE_LENGTH
Header(RrdDb parentDb, DataImporter reader) throws IOException
IOExceptionHeader(RrdDb parentDb, RrdDef rrdDef) throws IOException
IOExceptionvoid appendXml(XmlWriter writer) throws IOException
writer - the XML writer to append toIOException - if an I/O error occurspublic void copyStateTo(Header header) throws IOException
Copies object's internal state to another Header object.
copyStateTo in interface RrdUpdater<Header>header - a RrdUpdater object.IOException - if any.String dump() throws IOException
IOException - if an I/O error occurspublic int getArcCount()
throws IOExceptionIOException - Thrown in case of I/O errorpublic int getDsCount()
throws IOExceptionIOException - Thrown in case of I/O errorpublic String getInfo() throws IOException
IOException - if an I/O error occurspublic long getLastUpdateTime()
throws IOExceptionIOException - Thrown in case of I/O errorpublic RrdAllocator getRrdAllocator()
getRrdAllocator in interface RrdUpdater<Header>public RrdBackend getRrdBackend()
getRrdBackend in interface RrdUpdater<Header>public String getSignature() throws IOException
IOException - Thrown in case of I/O errorpublic long getStep()
throws IOExceptionIOException - Thrown in case of I/O errorpublic int getVersion()
throws IOExceptionIOException - if any.boolean isRrd4jHeader()
public void setInfo(String info) throws IOException
info - the new info string, or null/empty to clear itIOException - if an I/O error occursvoid setLastUpdateTime(long lastUpdateTime)
throws IOExceptionlastUpdateTime - the last update time (Unix epoch)IOException - if an I/O error occursvoid validateHeader()
throws IOExceptionInvalidRrdException - if the header is not a valid RRD4J/RRD fileIOException