rrdService.service
Class RoundRobinLibrary

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

public class RoundRobinLibrary
extends RoundRobin
implements RoundRobinLibraryItf

The class RoundRobinLibrary allows the managment of a group of rrd

Version:
1.0 date : 18/06/01
Author:
Pellier Damien FIRMENICH SA
See Also:
RoundRobinLibrary, RoundRobinLibraryItf, Serialized Form

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
RoundRobinLibrary(java.lang.String name)
          Constructor of class RoundRobinLibrary
 
Method Summary
 RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName, DataSourceContainer DSContainer, RoundRobinArchive roundRobinArchive)
          createRoundRobinDataBase create a round robin database
 RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName, DataSourceContainer DSContainer, RoundRobinArchiveContainer RRAContainer)
          createRoundRobinDataBase create a round robin database
 RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName, DataSource dataSource, RoundRobinArchive roundRobinArchive)
          createRoundRobinDataBase create a round robin database
 RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName, DataSource dataSource, RoundRobinArchiveContainer RRAContainer)
          createRoundRobinDataBase create a round robin database
 RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName, int steps, DataSourceContainer DSContainer, RoundRobinArchive roundRobinArchive)
          createRoundRobinDataBase create a round robin database
 RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName, int steps, DataSourceContainer DSContainer, RoundRobinArchiveContainer RRAContainer)
          createRoundRobinDataBase create a round robin database
 RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName, int steps, DataSource dataSource, RoundRobinArchive roundRobinArchive)
          createRoundRobinDataBase create a round robin database
 RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName, int steps, DataSource dataSource, RoundRobinArchiveContainer RRAContainer)
          createRoundRobinDataBase create a round robin database
 RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName, Time startTime, DataSourceContainer DSContainer, RoundRobinArchive roundRobinArchive)
          createRoundRobinDataBase create a round robin database
 RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName, Time startTime, DataSourceContainer DSContainer, RoundRobinArchiveContainer RRAContainer)
          createRoundRobinDataBase create a round robin database
 RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName, Time startTime, DataSource dataSource, RoundRobinArchive roundRobinArchive)
          createRoundRobinDataBase create a round robin database
 RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName, Time startTime, DataSource dataSource, RoundRobinArchiveContainer RRAContainer)
          createRoundRobinDataBase create a round robin database
 RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName, Time startTime, int steps, DataSourceContainer DSContainer, RoundRobinArchive roundRobinArchive)
          createRoundRobinDataBase create a round robin database
 RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName, Time startTime, int steps, DataSourceContainer DSContainer, RoundRobinArchiveContainer RRAContainer)
          createRoundRobinDataBase create a round robin database
 RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName, Time startTime, int steps, DataSource dataSource, RoundRobinArchive roundRobinArchive)
          createRoundRobinDataBase create a round robin database
 RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName, Time startTime, int steps, DataSource dataSource, RoundRobinArchiveContainer RRAContainer)
          createRoundRobinDataBase create a round robin database
 RoundRobinLibraryItf createSubLibrary(java.lang.String name)
          createSubLibrary create a sub library in the current library
 int delete()
          delete delete a rrd
private  int delete(java.io.File directory)
          delete delete a rrd
 RoundRobinLibraryItf findLibrary(java.lang.String libraryName)
          Returns RoundRobinLibraryItf according to its name null otherwise
 RoundRobinDataBaseItf findRRD(java.lang.String RRDName)
          Returns RoundRobindataBaseItf according to its name null otherwise
private  long getRoundRobinLibrarySize(java.io.File directory)
          getRoundRobinLibrarySize return the size in bytes of RRD
 long getSize()
          getSize return the size in bytes of RRD
 RoundRobinContainer listRoundRobin()
          ListRoundRobin returns an RoundRobinContainer
 RoundRobinDataBaseContainer listRoundRobinDataBase()
          ListRoundRobinDataBase returns RoundRobinDataBaseContainer
 RoundRobinLibraryContainer listRoundRobinLibrary()
          ListLibrary returns RoundRobinLibraryContainer
private  boolean lock(java.io.File directory, int mode)
          Lock a library acces return boolean true if the lock is taken
 boolean lockDelete()
          Lock in deleting acces return boolean true if the lock is taken
 boolean lockRead()
          Lock in reading acces return boolean true if the lock is taken
 boolean lockWrite()
          Lock in writting acces return boolean true if the lock is taken
private  boolean unLock(java.io.File directory, int mode)
          unLock a library access return boolean true if the unlock is well done
 boolean unLockDelete()
          Unlock in delete acces return boolean true if the lock is left
 boolean unLockRead()
          Unlock in reading acces return boolean true if the lock is left
 boolean unLockWrite()
          Unlock in writting acces return boolean true if the lock is left
 
Methods inherited from class rrdService.service.RoundRobin
getAbsolutePath, getLock, getMountFile, getName, getStatus, getType, isRoundRobinDataBase, isRoundRobinDataBase, isRoundRobinLibrary, isRoundRobinLibrary, isValideType, setLock, setMountFile, setType, throwException, throwRemoteException
 
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
 

Constructor Detail

RoundRobinLibrary

public RoundRobinLibrary(java.lang.String name)
                  throws java.lang.Exception
Constructor of class RoundRobinLibrary
Parameters:
name - the name of the RoundRobinLibrary
Method Detail

createRoundRobinDataBase

public RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName,
                                                      DataSourceContainer DSContainer,
                                                      RoundRobinArchive roundRobinArchive)
                                               throws java.rmi.RemoteException
createRoundRobinDataBase create a round robin database
Specified by:
createRoundRobinDataBase in interface RoundRobinLibraryItf
Parameters:
fileName - the name of the RoundRobinDataBase
DSContainer - a collection of the data source of the RRD
roundRobinArchive - the RRA of the RRD

createRoundRobinDataBase

public RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName,
                                                      DataSourceContainer DSContainer,
                                                      RoundRobinArchiveContainer RRAContainer)
                                               throws java.rmi.RemoteException
createRoundRobinDataBase create a round robin database
Specified by:
createRoundRobinDataBase in interface RoundRobinLibraryItf
Parameters:
fileName - the name of the RoundRobinDataBase
DSContainer - a collection of the data source of the RRD
RRAContainer - a collection of the RRA of the RRD

createRoundRobinDataBase

public RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName,
                                                      DataSource dataSource,
                                                      RoundRobinArchive roundRobinArchive)
                                               throws java.rmi.RemoteException
createRoundRobinDataBase create a round robin database
Specified by:
createRoundRobinDataBase in interface RoundRobinLibraryItf
Parameters:
fileName - the name of the RoundRobinDataBase
dataSource - the data source of the RRD
roundRobinArchive - the RRA of the RRD
Returns:
RoundRobinDataBaseItf

createRoundRobinDataBase

public RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName,
                                                      DataSource dataSource,
                                                      RoundRobinArchiveContainer RRAContainer)
                                               throws java.rmi.RemoteException
createRoundRobinDataBase create a round robin database
Specified by:
createRoundRobinDataBase in interface RoundRobinLibraryItf
Parameters:
fileName - the name of the RoundRobinDataBase
dataSource - the data source of the RRD
RRAContainer - a collection of the RRA of the RRD

createRoundRobinDataBase

public RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName,
                                                      int steps,
                                                      DataSourceContainer DSContainer,
                                                      RoundRobinArchive roundRobinArchive)
                                               throws java.rmi.RemoteException
createRoundRobinDataBase create a round robin database
Specified by:
createRoundRobinDataBase in interface RoundRobinLibraryItf
Parameters:
fileName - the name of the RoundRobinDataBase
steps - Specifies the base interval in seconds with which data will be fed into the RRD (default 0)
DSContainer - a collection of the data source of the RRD
roundRobinArchive - the RRA of the RRD

createRoundRobinDataBase

public RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName,
                                                      int steps,
                                                      DataSourceContainer DSContainer,
                                                      RoundRobinArchiveContainer RRAContainer)
                                               throws java.rmi.RemoteException
createRoundRobinDataBase create a round robin database
Specified by:
createRoundRobinDataBase in interface RoundRobinLibraryItf
Parameters:
fileName - the name of the RoundRobinDataBase
steps - Specifies the base interval in seconds with which data will be fed into the RRD (default 0)
DSContainer - a collection of the data source of the RRD
RRAContainer - a collection of the RRA of the RRD

createRoundRobinDataBase

public RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName,
                                                      int steps,
                                                      DataSource dataSource,
                                                      RoundRobinArchive roundRobinArchive)
                                               throws java.rmi.RemoteException
createRoundRobinDataBase create a round robin database
Specified by:
createRoundRobinDataBase in interface RoundRobinLibraryItf
Parameters:
fileName - the name of the RoundRobinDataBase
steps - Specifies the base interval in seconds with which data will be fed into the RRD (default 0)
dataSource - the data source of the RRD
roundRobinArchive - the RRA of the RRD
Returns:
RoundRobinDataBaseItf

createRoundRobinDataBase

public RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName,
                                                      int steps,
                                                      DataSource dataSource,
                                                      RoundRobinArchiveContainer RRAContainer)
                                               throws java.rmi.RemoteException
createRoundRobinDataBase create a round robin database
Specified by:
createRoundRobinDataBase in interface RoundRobinLibraryItf
Parameters:
fileName - the name of the RoundRobinDataBase
steps - Specifies the base interval in seconds with which data will be fed into the RRD (default 0)
dataSource - the data source of the RRD
RRAContainer - a collection of the RRA of the RRD

createRoundRobinDataBase

public RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName,
                                                      Time startTime,
                                                      DataSourceContainer DSContainer,
                                                      RoundRobinArchive roundRobinArchive)
                                               throws java.rmi.RemoteException
createRoundRobinDataBase create a round robin database
Specified by:
createRoundRobinDataBase in interface RoundRobinLibraryItf
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)
DSContainer - a collection of the data source of the RRD
roundRobinArchive - the RRA of the RRD

createRoundRobinDataBase

public RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName,
                                                      Time startTime,
                                                      DataSourceContainer DSContainer,
                                                      RoundRobinArchiveContainer RRAContainer)
                                               throws java.rmi.RemoteException
createRoundRobinDataBase create a round robin database
Specified by:
createRoundRobinDataBase in interface RoundRobinLibraryItf
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)
DSContainer - a collection of the data source of the RRD
RRAContainer - a collection of the RRA of the RRD

createRoundRobinDataBase

public RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName,
                                                      Time startTime,
                                                      DataSource dataSource,
                                                      RoundRobinArchive roundRobinArchive)
                                               throws java.rmi.RemoteException
createRoundRobinDataBase create a round robin database
Specified by:
createRoundRobinDataBase in interface RoundRobinLibraryItf
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)
dataSource - the data source of the RRD
roundRobinArchive - the RRA of the RRD
Returns:
RoundRobinDataBaseItf

createRoundRobinDataBase

public RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName,
                                                      Time startTime,
                                                      DataSource dataSource,
                                                      RoundRobinArchiveContainer RRAContainer)
                                               throws java.rmi.RemoteException
createRoundRobinDataBase create a round robin database
Specified by:
createRoundRobinDataBase in interface RoundRobinLibraryItf
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)
dataSource - the data source of the RRD
RRAContainer - a collection of the RRA of the RRD

createRoundRobinDataBase

public RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName,
                                                      Time startTime,
                                                      int steps,
                                                      DataSourceContainer DSContainer,
                                                      RoundRobinArchive roundRobinArchive)
                                               throws java.rmi.RemoteException
createRoundRobinDataBase create a round robin database
Specified by:
createRoundRobinDataBase in interface RoundRobinLibraryItf
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)
DSContainer - a collection of the data source of the RRD
roundRobinArchive - the RRA of the RRD

createRoundRobinDataBase

public RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName,
                                                      Time startTime,
                                                      int steps,
                                                      DataSourceContainer DSContainer,
                                                      RoundRobinArchiveContainer RRAContainer)
                                               throws java.rmi.RemoteException
createRoundRobinDataBase create a round robin database
Specified by:
createRoundRobinDataBase in interface RoundRobinLibraryItf
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)
DSContainer - a collection of the data source of the RRD
RRAContainer - a collection of the RRA of the RRD

createRoundRobinDataBase

public RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName,
                                                      Time startTime,
                                                      int steps,
                                                      DataSource dataSource,
                                                      RoundRobinArchive roundRobinArchive)
                                               throws java.rmi.RemoteException
createRoundRobinDataBase create a round robin database
Specified by:
createRoundRobinDataBase in interface RoundRobinLibraryItf
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)
dataSource - the data source of the RRD
roundRobinArchive - the RRA of the RRD
Returns:
RoundRobinDataBaseItf

createRoundRobinDataBase

public RoundRobinDataBaseItf createRoundRobinDataBase(java.lang.String fileName,
                                                      Time startTime,
                                                      int steps,
                                                      DataSource dataSource,
                                                      RoundRobinArchiveContainer RRAContainer)
                                               throws java.rmi.RemoteException
createRoundRobinDataBase create a round robin database
Specified by:
createRoundRobinDataBase in interface RoundRobinLibraryItf
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)
dataSource - the data source of the RRD
RRAContainer - a collection of the RRA of the RRD

createSubLibrary

public RoundRobinLibraryItf createSubLibrary(java.lang.String name)
                                      throws java.rmi.RemoteException
createSubLibrary create a sub library in the current library
Specified by:
createSubLibrary in interface RoundRobinLibraryItf
Parameters:
name - the name of sub library
Returns:
RoundRobinLibraryItf

delete

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

delete

private int delete(java.io.File directory)
            throws java.lang.Exception
delete delete a rrd
Parameters:
lib - the RoundRobinLibrary to start deleting
Returns:
int the number of rrd deleted

findLibrary

public RoundRobinLibraryItf findLibrary(java.lang.String libraryName)
                                 throws java.rmi.RemoteException
Returns RoundRobinLibraryItf according to its name null otherwise
Specified by:
findLibrary in interface RoundRobinLibraryItf
Parameters:
libraryname - the name of the library to find
Returns:
RoundRobinLibraryItf

findRRD

public RoundRobinDataBaseItf findRRD(java.lang.String RRDName)
                              throws java.rmi.RemoteException
Returns RoundRobindataBaseItf according to its name null otherwise
Specified by:
findRRD in interface RoundRobinLibraryItf
Parameters:
RRDName - the name of the round robin data base to find
Returns:
RoundRobinDataBaseItf

getRoundRobinLibrarySize

private long getRoundRobinLibrarySize(java.io.File directory)
                               throws java.lang.Exception
getRoundRobinLibrarySize return the size in bytes of RRD
Parameters:
directory - the directory to start
Returns:
long

getSize

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

listRoundRobin

public RoundRobinContainer listRoundRobin()
                                   throws java.rmi.RemoteException
ListRoundRobin returns an RoundRobinContainer
Specified by:
listRoundRobin in interface RoundRobinLibraryItf
Returns:
RoundRobinContainer

listRoundRobinDataBase

public RoundRobinDataBaseContainer listRoundRobinDataBase()
                                                   throws java.rmi.RemoteException
ListRoundRobinDataBase returns RoundRobinDataBaseContainer
Specified by:
listRoundRobinDataBase in interface RoundRobinLibraryItf
Returns:
RoundRobinDataBaseContainer

listRoundRobinLibrary

public RoundRobinLibraryContainer listRoundRobinLibrary()
                                                 throws java.rmi.RemoteException
ListLibrary returns RoundRobinLibraryContainer
Specified by:
listRoundRobinLibrary in interface RoundRobinLibraryItf
Returns:
RoundRobinLibraryContainer

lock

private boolean lock(java.io.File directory,
                     int mode)
              throws java.lang.Exception
Lock a library acces return boolean true if the lock is taken

lockDelete

public boolean lockDelete()
                   throws java.lang.Exception
Lock in deleting acces return boolean true if the lock is taken
Overrides:
lockDelete in class RoundRobin

lockRead

public boolean lockRead()
                 throws java.lang.Exception
Lock in reading acces return boolean true if the lock is taken
Overrides:
lockRead in class RoundRobin

lockWrite

public boolean lockWrite()
                  throws java.lang.Exception
Lock in writting acces return boolean true if the lock is taken
Overrides:
lockWrite in class RoundRobin

unLock

private boolean unLock(java.io.File directory,
                       int mode)
                throws java.lang.Exception
unLock a library access return boolean true if the unlock is well done

unLockDelete

public boolean unLockDelete()
                     throws java.lang.Exception
Unlock in delete acces return boolean true if the lock is left

unLockRead

public boolean unLockRead()
                   throws java.lang.Exception
Unlock in reading acces return boolean true if the lock is left
Overrides:
unLockRead in class RoundRobin

unLockWrite

public boolean unLockWrite()
                    throws java.lang.Exception
Unlock in writting acces return boolean true if the lock is left
Overrides:
unLockWrite in class RoundRobin

Copyright 1885-2001 FIRMENICH SA, Geneva

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