rrdService.service
Class RoundRobinDataBase

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--rrdService.service.RoundRobin
                          |
                          +--rrdService.service.RoundRobinDataBase
All Implemented Interfaces:
LockItf, java.rmi.Remote, RoundRobinDataBaseItf, RoundRobinItf, java.io.Serializable

public class RoundRobinDataBase
extends RoundRobin
implements RoundRobinDataBaseItf

The class RoundRobinDataBase allows the managment of a group of rrd

Version:
1.0 date : 15/07/2001
Author:
Damien Pellier
See Also:
RoundRobinDataBase, RoundRobin, Serialized Form

Field Summary
private static Mutex mutex
          Mutex allowing the synchronisation of graph method
private static java.lang.String RRDTOOL_CMD
          RRDTOOL_CMD command of rrdtool.exe
private static java.lang.String RRDTOOL_CMD_BAT
          RRDTOOL_CMD_BAT command of rrdtool.bat
 
Fields inherited from class rrdService.service.RoundRobin
mountFile, RRD_FILE, RRD_FILE_EXTENTION, RRD_LIBRARY, type
 
Fields inherited from class java.rmi.server.UnicastRemoteObject
csf, port, portFactoryParamTypes, portParamTypes, serialVersionUID, ssf
 
Fields inherited from class java.rmi.server.RemoteServer
log, logname
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface rrdService.service.LockItf
DELETE, READ_WRITE
 
Constructor Summary
RoundRobinDataBase(java.lang.String fileName)
          Constructor of class RoundRobinDataBase
RoundRobinDataBase(java.lang.String fileName, Time startTime, int steps, DataSourceContainer dataSourceContainer, RoundRobinArchiveContainer roundRobinArchiveContainer)
          Constructor of class RoundRobinDataBase
 
Method Summary
private  RoundRobinInfo createRoundRobinInfo()
          createInfoFile create the file of info on this RRD
 int delete()
          delete delete a rrd
 java.io.File dump(java.lang.String xmlFilename)
          dump dump a round robin database The dump function prints the contents of an RRD in human readable (?)
 java.lang.String fetch(java.lang.String cf)
          fetch fetch a round robin database
 java.lang.String fetch(java.lang.String cf, int resolution)
          fetch fetch a round robin database
 java.lang.String fetch(java.lang.String cf, int resolution, Time startTime)
          fetch fetch a round robin database
 java.lang.String fetch(java.lang.String cf, int resolution, Time startTime, Time endTime)
          fetch fetch a round robin database
 java.lang.String fetch(java.lang.String cf, Time startTime)
          fetch fetch a round robin database
 java.lang.String fetch(java.lang.String cf, Time startTime, Time endTime)
          fetch fetch a round robin database
 DataSourceContainer getDataSourceContainer()
          Returns the data source container of the round robin
 RoundRobinArchiveContainer getRoundRobinArchiveContainer()
          Returns the round robin archive container of the round robin
 java.lang.String getRoundRobineVersion()
          Returns the version of the round robin
 long getSize()
          getSize return the size of RoundRobinDataBase
 int getStep()
          Returns the step of the round robin
 RoundRobinImage graph(RoundRobinGraphic roundRobinGraphic)
          graph Create a graph based on data from one or several RRD
 void grow(int rraNum, int rows)
          grow used if you want to add extra rows to an RRA.
 java.lang.String info()
          info return info about a round robin database
 Time last()
          last return the date of the last data sample in an RRD
private  void printCmd(java.lang.String[] cmd)
          printCmd display a command line
 RoundRobinDataBaseItf restore(java.lang.String xmlFilename)
          restore the contents of an RRD from its XML dump format
private  java.lang.String rrdToolCmd(java.lang.String[] cmd)
          rrdToolCmd execute un rrdtool commande
 void setDataSourceName(java.lang.String oldDsName, java.lang.String newDsName)
          setDataSourceName modify the name of data source of this RRD
 void setDataSourceType(java.lang.String dsName, java.lang.String dataSourceType)
          setDataSourceType modify the type of data source of this RRD
 void setHeartbeat(java.lang.String dsName, int heartbeat)
          setHeartbeat modify the heartbeat of this RRD
 void setMaximum(java.lang.String dsName, int maximum)
          setMaximum modify the maximum of this RRD
 void setMinimum(java.lang.String dsName, int minimum)
          setMinimum modify the minimum of this RRD
 void shrink(int rraNum, int rows)
          shrink used if you want to remove rows from an RRA.
 void update(Data data)
          Update update a round robin database
 void update(DataContainer dataContainer)
          Update update a round robin database
 void update(Template template, DataContainer dataContainer)
          Update update a round robin database
 
Methods inherited from class rrdService.service.RoundRobin
getAbsolutePath, getLock, getMountFile, getName, getStatus, getType, isRoundRobinDataBase, isRoundRobinDataBase, isRoundRobinLibrary, isRoundRobinLibrary, isValideType, lockDelete, lockRead, lockWrite, setLock, setMountFile, setType, throwException, throwRemoteException, unLockRead, unLockWrite
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
, clone, exportObject, exportObject, exportObject, exportObject, readObject, reexport, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub, writeObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface rrdService.service.RoundRobinItf
getName, getType, isRoundRobinDataBase, isRoundRobinLibrary
 

Field Detail

mutex

private static Mutex mutex
Mutex allowing the synchronisation of graph method

RRDTOOL_CMD

private static final java.lang.String RRDTOOL_CMD
RRDTOOL_CMD command of rrdtool.exe

RRDTOOL_CMD_BAT

private static final java.lang.String RRDTOOL_CMD_BAT
RRDTOOL_CMD_BAT command of rrdtool.bat
Constructor Detail

RoundRobinDataBase

public RoundRobinDataBase(java.lang.String fileName)
                   throws java.lang.Exception
Constructor of class RoundRobinDataBase
Parameters:
fileName - the name of the RoundRobinDataBase

RoundRobinDataBase

public RoundRobinDataBase(java.lang.String fileName,
                          Time startTime,
                          int steps,
                          DataSourceContainer dataSourceContainer,
                          RoundRobinArchiveContainer roundRobinArchiveContainer)
                   throws java.lang.Exception
Constructor of class RoundRobinDataBase
Parameters:
fileName - the name of the RoundRobinDataBase
startTime - Specifies the time in seconds since 1970-01-01 UTC when the first value should be added to the RRD (default null)
steps - Specifies the base interval in seconds with which data will be fed into the RRD (default 0)
dataSourceContainer - a collection of the data source of the RRD
roundRobinArchiveContainer - a collection the RRA of the RRD
Method Detail

createRoundRobinInfo

private RoundRobinInfo createRoundRobinInfo()
                                     throws java.lang.Exception
createInfoFile create the file of info on this RRD

delete

public int delete()
           throws java.rmi.RemoteException
delete delete a rrd
Specified by:
delete in interface RoundRobinDataBaseItf
Overrides:
delete in class RoundRobin
Returns:
int the number of rrd deleted

dump

public java.io.File dump(java.lang.String xmlFilename)
                  throws java.rmi.RemoteException
dump dump a round robin database The dump function prints the contents of an RRD in human readable (?) XML format. This format can be read by rrdrestore. Together they allow you to transfer your files from one architecture to another as well as manipulating the contents of an RRD file in a somewhat more convenient manner.
Specified by:
dump in interface RoundRobinDataBaseItf
Parameters:
xmlFilename - the name of the output xlm file

fetch

public java.lang.String fetch(java.lang.String cf)
                       throws java.rmi.RemoteException
fetch fetch a round robin database
Specified by:
fetch in interface RoundRobinDataBaseItf
Parameters:
cf - which consolidation function should have been applied to the data you want to fetch? (AVERAGE,MIN,MAX,LAST)

fetch

public java.lang.String fetch(java.lang.String cf,
                              int resolution)
                       throws java.rmi.RemoteException
fetch fetch a round robin database
Specified by:
fetch in interface RoundRobinDataBaseItf
Parameters:
cf - which consolidation function should have been applied to the data you want to fetch? (AVERAGE,MIN,MAX,LAST)
resolution - what interval should the values have (seconds per value). rrdfetch will try to match your request, but it will return data even if no absolute match is possible.
startTime - when should the data begin. A time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time. By default one day worth of data will be fetched. See also AT-STYLE TIME SPECIFICATION section for a detailed explanation on ways to specify start time.

fetch

public java.lang.String fetch(java.lang.String cf,
                              int resolution,
                              Time startTime)
                       throws java.rmi.RemoteException
fetch fetch a round robin database
Specified by:
fetch in interface RoundRobinDataBaseItf
Parameters:
cf - which consolidation function should have been applied to the data you want to fetch? (AVERAGE,MIN,MAX,LAST)
resolution - what interval should the values have (seconds per value). rrdfetch will try to match your request, but it will return data even if no absolute match is possible.
startTime - when should the data begin. A time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time. By default one day worth of data will be fetched. See also AT-STYLE TIME SPECIFICATION section for a detailed explanation on ways to specify start time.

fetch

public java.lang.String fetch(java.lang.String cf,
                              int resolution,
                              Time startTime,
                              Time endTime)
                       throws java.rmi.RemoteException
fetch fetch a round robin database
Specified by:
fetch in interface RoundRobinDataBaseItf
Parameters:
cf - which consolidation function should have been applied to the data you want to fetch? (AVERAGE,MIN,MAX,LAST)
resolution - what interval should the values have (seconds per value). rrdfetch will try to match your request, but it will return data even if no absolute match is possible.
startTime - when should the data begin. A time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time. By default one day worth of data will be fetched. See also AT-STYLE TIME SPECIFICATION section for a detailed explanation on ways to specify start time.
endTime - when should the data end. Time in seconds since epoch. See also AT-STYLE TIME SPECIFICATION section for a detailed explanation of how to specify end time.

fetch

public java.lang.String fetch(java.lang.String cf,
                              Time startTime)
                       throws java.rmi.RemoteException
fetch fetch a round robin database
Specified by:
fetch in interface RoundRobinDataBaseItf
Parameters:
cf - which consolidation function should have been applied to the data you want to fetch? (AVERAGE,MIN,MAX,LAST)
startTime - when should the data begin. A time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time. By default one day worth of data will be fetched. See also AT-STYLE TIME SPECIFICATION section for a detailed explanation on ways to specify start time.

fetch

public java.lang.String fetch(java.lang.String cf,
                              Time startTime,
                              Time endTime)
                       throws java.rmi.RemoteException
fetch fetch a round robin database
Specified by:
fetch in interface RoundRobinDataBaseItf
Parameters:
cf - which consolidation function should have been applied to the data you want to fetch? (AVERAGE,MIN,MAX,LAST)
startTime - when should the data begin. A time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time. By default one day worth of data will be fetched. See also AT-STYLE TIME SPECIFICATION section for a detailed explanation on ways to specify start time.
endTime - when should the data end. Time in seconds since epoch. See also AT-STYLE TIME SPECIFICATION section for a detailed explanation of how to specify end time.

getDataSourceContainer

public DataSourceContainer getDataSourceContainer()
                                           throws java.rmi.RemoteException
Returns the data source container of the round robin
Specified by:
getDataSourceContainer in interface RoundRobinDataBaseItf

getRoundRobinArchiveContainer

public RoundRobinArchiveContainer getRoundRobinArchiveContainer()
                                                         throws java.rmi.RemoteException
Returns the round robin archive container of the round robin
Specified by:
getRoundRobinArchiveContainer in interface RoundRobinDataBaseItf

getRoundRobineVersion

public java.lang.String getRoundRobineVersion()
                                       throws java.rmi.RemoteException
Returns the version of the round robin
Specified by:
getRoundRobineVersion in interface RoundRobinDataBaseItf

getSize

public long getSize()
             throws java.rmi.RemoteException
getSize return the size of RoundRobinDataBase
Specified by:
getSize in interface RoundRobinDataBaseItf
Overrides:
getSize in class RoundRobin
Returns:
long

getStep

public int getStep()
            throws java.rmi.RemoteException
Returns the step of the round robin
Specified by:
getStep in interface RoundRobinDataBaseItf

graph

public RoundRobinImage graph(RoundRobinGraphic roundRobinGraphic)
                      throws java.rmi.RemoteException
graph Create a graph based on data from one or several RRD
Specified by:
graph in interface RoundRobinDataBaseItf
Parameters:
roundRobinGraphic - the roundRobinGraphic which represent the graph
Returns:
Image the file of the image

grow

public void grow(int rraNum,
                 int rows)
          throws java.rmi.RemoteException
grow used if you want to add extra rows to an RRA. The extra rows will be inserted as the rows that are oldest.
Specified by:
grow in interface RoundRobinDataBaseItf
Parameters:
rraNum - the RRA you want to alter. You can find the number using rrdtool info.
rows - the number of rows you want to add.

info

public java.lang.String info()
                      throws java.rmi.RemoteException
info return info about a round robin database
Specified by:
info in interface RoundRobinDataBaseItf

last

public Time last()
          throws java.rmi.RemoteException
last return the date of the last data sample in an RRD
Specified by:
last in interface RoundRobinDataBaseItf

printCmd

private void printCmd(java.lang.String[] cmd)
printCmd display a command line
Parameters:
cmd: - command line to display

restore

public RoundRobinDataBaseItf restore(java.lang.String xmlFilename)
                              throws java.rmi.RemoteException
restore the contents of an RRD from its XML dump format
Specified by:
restore in interface RoundRobinDataBaseItf
Parameters:
xmlFilename - the name of the input xlm file

rrdToolCmd

private java.lang.String rrdToolCmd(java.lang.String[] cmd)
                             throws java.lang.Exception
rrdToolCmd execute un rrdtool commande
Parameters:
commande: - the commande to execute

setDataSourceName

public void setDataSourceName(java.lang.String oldDsName,
                              java.lang.String newDsName)
                       throws java.rmi.RemoteException
setDataSourceName modify the name of data source of this RRD
Specified by:
setDataSourceName in interface RoundRobinDataBaseItf
Parameters:
oldDsName - the ds-name of data source of this RRD to modify
newDsName - the new name of data source of this RRD

setDataSourceType

public void setDataSourceType(java.lang.String dsName,
                              java.lang.String dataSourceType)
                       throws java.rmi.RemoteException
setDataSourceType modify the type of data source of this RRD
Specified by:
setDataSourceType in interface RoundRobinDataBaseItf
Parameters:
dsName - the ds-name of data source of this RRD to modify
dataSourceType - the new type of data source of this RRD

setHeartbeat

public void setHeartbeat(java.lang.String dsName,
                         int heartbeat)
                  throws java.rmi.RemoteException
setHeartbeat modify the heartbeat of this RRD
Specified by:
setHeartbeat in interface RoundRobinDataBaseItf
Parameters:
dsName - the ds-name of data source of this RRD to modify
heartbeat - the new heartbeat of this RRD

setMaximum

public void setMaximum(java.lang.String dsName,
                       int maximum)
                throws java.rmi.RemoteException
setMaximum modify the maximum of this RRD
Specified by:
setMaximum in interface RoundRobinDataBaseItf
Parameters:
dsName - the ds-name of data source of this RRD to modify
maximum - the new maximum of this RRD

setMinimum

public void setMinimum(java.lang.String dsName,
                       int minimum)
                throws java.rmi.RemoteException
setMinimum modify the minimum of this RRD
Specified by:
setMinimum in interface RoundRobinDataBaseItf
Parameters:
dsName - the ds-name of data source of this RRD to modify
minimum - the new minimum of this RRD

shrink

public void shrink(int rraNum,
                   int rows)
            throws java.rmi.RemoteException
shrink used if you want to remove rows from an RRA. The rows that will be removed are the oldest rows.
Specified by:
shrink in interface RoundRobinDataBaseItf
Parameters:
rraNum - the RRA you want to alter. You can find the number using rrdtool info.
rows - the number of rows you want to remove.

update

public void update(Data data)
            throws java.rmi.RemoteException
Update update a round robin database
Specified by:
update in interface RoundRobinDataBaseItf
Parameters:
data - The data used for updating the RRD was acquired at a certain time.

update

public void update(DataContainer dataContainer)
            throws java.rmi.RemoteException
Update update a round robin database
Specified by:
update in interface RoundRobinDataBaseItf
Parameters:
dataContainer - The data used for updating the RRD was acquired at a certain time.

update

public void update(Template template,
                   DataContainer dataContainer)
            throws java.rmi.RemoteException
Update update a round robin database
Specified by:
update in interface RoundRobinDataBaseItf
Parameters:
template - The template switch allows you to specify which data sources you are going to update and in which order.
dataContainer - The data used for updating the RRD was acquired at a certain time.

Copyright 1885-2001 FIRMENICH SA, Geneva

Submit a bug or feature
Copyright 1885-2001 FIRMENICH SA, Geneva,
All Rights Reserved.