Package org.rrd4j.core
Class Header
java.lang.Object
org.rrd4j.core.Header
- All Implemented Interfaces:
RrdUpdater<Header>
public class Header extends Object implements RrdUpdater<Header>
Class to represent RRD header. Header information is mainly static (once set, it
cannot be changed), with the exception of last update time (this value is changed whenever
RRD gets updated).
Normally, you don't need to manipulate the Header object directly - Rrd4j framework does it for you.
- Author:
- Sasa Markovic*
-
Field Summary
Fields Modifier and Type Field Description (package private) static String
DEFAULT_SIGNATURE
(package private) static String
RRDTOOL_VERSION1
(package private) static String
RRDTOOL_VERSION3
(package private) static String
SIGNATURE
(package private) static int
SIGNATURE_LENGTH
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description (package private) void
appendXml(XmlWriter writer)
void
copyStateTo(Header header)
copyStateTo.(package private) String
dump()
int
getArcCount()
Returns the number of archives defined in the RRD.int
getDsCount()
Returns the number of datasources defined in the RRD.String
getInfo()
getInfo.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()
void
setInfo(String info)
setInfo.(package private) void
setLastUpdateTime(long lastUpdateTime)
(package private) void
validateHeader()
-
Field Details
-
SIGNATURE_LENGTH
static final int SIGNATURE_LENGTH- See Also:
- Constant Field Values
-
SIGNATURE
- See Also:
- Constant Field Values
-
DEFAULT_SIGNATURE
- See Also:
- Constant Field Values
-
RRDTOOL_VERSION1
- See Also:
- Constant Field Values
-
RRDTOOL_VERSION3
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Header
- Throws:
IOException
-
Header
- Throws:
IOException
-
-
Method Details
-
getSignature
Returns RRD signature. Initially, the returned string will be of the form Rrd4j, version x.x.- Returns:
- RRD signature
- Throws:
IOException
- Thrown in case of I/O error
-
getInfo
getInfo.
- Returns:
- a
String
object. - Throws:
IOException
- if any.
-
setInfo
setInfo.
- Parameters:
info
- aString
object.- Throws:
IOException
- if any.
-
getLastUpdateTime
Returns the last update time of the RRD.- Returns:
- Timestamp (Unix epoch, no milliseconds) corresponding to the last update time.
- Throws:
IOException
- Thrown in case of I/O error
-
getStep
Returns primary RRD time step.- Returns:
- Primary time step in seconds
- Throws:
IOException
- Thrown in case of I/O error
-
getDsCount
Returns the number of datasources defined in the RRD.- Returns:
- Number of datasources defined
- Throws:
IOException
- Thrown in case of I/O error
-
getArcCount
Returns the number of archives defined in the RRD.- Returns:
- Number of archives defined
- Throws:
IOException
- Thrown in case of I/O error
-
setLastUpdateTime
- Throws:
IOException
-
dump
- Throws:
IOException
-
appendXml
- Throws:
IOException
-
copyStateTo
copyStateTo.
Copies object's internal state to another Header object.- Specified by:
copyStateTo
in interfaceRrdUpdater<Header>
- Parameters:
header
- aRrdUpdater
object.- Throws:
IOException
- if any.
-
getRrdBackend
Returns the underlying storage (backend) object which actually performs all I/O operations.- Specified by:
getRrdBackend
in interfaceRrdUpdater<Header>
- Returns:
- I/O backend object
-
getVersion
Return the RRD version.- Returns:
- RRD version
- Throws:
IOException
- if any.
-
isRrd4jHeader
boolean isRrd4jHeader() -
validateHeader
- Throws:
IOException
-
getRrdAllocator
Required to implement RrdUpdater interface. You should never call this method directly.- Specified by:
getRrdAllocator
in interfaceRrdUpdater<Header>
- Returns:
- Allocator object
-