rrdService.service
Class RoundRobin

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

public abstract class RoundRobin
extends java.rmi.server.UnicastRemoteObject
implements RoundRobinItf, LockItf

The class RoundRobin allows to share methodes between RoundRobinLibrary and RoundRobinDataBase

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

Field Summary
protected  java.io.File mountFile
          File representing the RoundRobin
protected static java.lang.String RRD_FILE
          Type RoundRobin FILE
static java.lang.String RRD_FILE_EXTENTION
          Extention of mountFile rrd
protected static java.lang.String RRD_LIBRARY
          Type RoundRobin LIBRARY
protected  java.lang.String type
          The type of the RoundRobin
 
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
RoundRobin(java.lang.String name, java.lang.String type)
          Constructor of class RoundRobin
 
Method Summary
abstract  int delete()
          delete delete a rrd
protected  java.lang.String getAbsolutePath()
          getAbsolutePath return the ablosulte path of RoundRobin mount file
protected  Lock getLock()
          getLock return the lock of RoundRobin
protected  java.io.File getMountFile()
          getMountFile return the mount file of RoundRobin
 java.lang.String getName()
          getName return the name of RoundRobin
abstract  long getSize()
          getSize return the size of RoundRobin
 int getStatus()
          getStatus return the status of lock return int reprsenting the status READ_WRITE or DELETE
 java.lang.String getType()
          getType return the type of a RoundRobin
 boolean isRoundRobinDataBase()
          isRoundRobinDataBase return true if RoundRobin is a RoundRobinDataBase
protected  boolean isRoundRobinDataBase(java.io.File mountFile)
          isRoundRobinDataBase return true if RoundRobin is a RoundRobinDataBase
 boolean isRoundRobinLibrary()
          isRoundRobinLibrary return true if RoundRobin is a RoundRobinlibrary
protected  boolean isRoundRobinLibrary(java.io.File mountFile)
          isRoundRobinLibrary return true if RoundRobin is a RoundRobinlibrary
protected  boolean isValideType(java.lang.String type)
          isValideType return true if the type is valide
 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
protected  void setLock(Lock lock)
          setLock specify the lock
protected  void setMountFile(java.lang.String nameOfMountFile)
          setMountFile specify the mount file of RoundRobin
protected  void setType(java.lang.String type)
          setType specify the type of a RoundRobin
protected  void throwException(java.lang.String message, java.lang.Exception e)
          throwException throw a exception with the specific message
protected  void throwRemoteException(java.lang.String message, java.lang.Exception e)
          throwRemoteException throw a remote exception with the specific message
 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 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
 

Field Detail

mountFile

protected java.io.File mountFile
File representing the RoundRobin

RRD_FILE

protected static final java.lang.String RRD_FILE
Type RoundRobin FILE

RRD_FILE_EXTENTION

public static final java.lang.String RRD_FILE_EXTENTION
Extention of mountFile rrd

RRD_LIBRARY

protected static final java.lang.String RRD_LIBRARY
Type RoundRobin LIBRARY

type

protected java.lang.String type
The type of the RoundRobin
Constructor Detail

RoundRobin

public RoundRobin(java.lang.String name,
                  java.lang.String type)
           throws java.lang.Exception
Constructor of class RoundRobin
Method Detail

delete

public abstract int delete()
                    throws java.rmi.RemoteException
delete delete a rrd
Specified by:
delete in interface RoundRobinItf
Returns:
int the number of rrd delete

getAbsolutePath

protected java.lang.String getAbsolutePath()
getAbsolutePath return the ablosulte path of RoundRobin mount file
Returns:
String representing the ablosulte path of RoundRobin mount file

getLock

protected Lock getLock()
                throws java.lang.Exception
getLock return the lock of RoundRobin
Returns:
Lock the lock of RoundRobin

getMountFile

protected java.io.File getMountFile()
getMountFile return the mount file of RoundRobin
Returns:
the mount file of RoundRobin

getName

public java.lang.String getName()
                         throws java.rmi.RemoteException
getName return the name of RoundRobin
Specified by:
getName in interface RoundRobinItf

getSize

public abstract long getSize()
                      throws java.rmi.RemoteException
getSize return the size of RoundRobin
Specified by:
getSize in interface RoundRobinItf
Returns:
long

getStatus

public int getStatus()
              throws java.lang.Exception
getStatus return the status of lock return int reprsenting the status READ_WRITE or DELETE
Specified by:
getStatus in interface LockItf

getType

public java.lang.String getType()
                         throws java.rmi.RemoteException
getType return the type of a RoundRobin
Specified by:
getType in interface RoundRobinItf
Following copied from interface: rrdService.service.RoundRobinItf
Returns:
String

isRoundRobinDataBase

public boolean isRoundRobinDataBase()
                             throws java.rmi.RemoteException
isRoundRobinDataBase return true if RoundRobin is a RoundRobinDataBase
Specified by:
isRoundRobinDataBase in interface RoundRobinItf
Following copied from interface: rrdService.service.RoundRobinItf
Returns:
boolean

isRoundRobinDataBase

protected boolean isRoundRobinDataBase(java.io.File mountFile)
isRoundRobinDataBase return true if RoundRobin is a RoundRobinDataBase

isRoundRobinLibrary

public boolean isRoundRobinLibrary()
                            throws java.rmi.RemoteException
isRoundRobinLibrary return true if RoundRobin is a RoundRobinlibrary
Specified by:
isRoundRobinLibrary in interface RoundRobinItf
Following copied from interface: rrdService.service.RoundRobinItf
Returns:
boolean

isRoundRobinLibrary

protected boolean isRoundRobinLibrary(java.io.File mountFile)
isRoundRobinLibrary return true if RoundRobin is a RoundRobinlibrary

isValideType

protected boolean isValideType(java.lang.String type)
isValideType return true if the type is valide
Parameters:
type - the type of RoundRobin to test

lockDelete

public boolean lockDelete()
                   throws java.lang.Exception
Lock in deleting acces return boolean true if the lock is taken
Specified by:
lockDelete in interface LockItf

lockRead

public boolean lockRead()
                 throws java.lang.Exception
Lock in reading acces return boolean true if the lock is taken
Specified by:
lockRead in interface LockItf

lockWrite

public boolean lockWrite()
                  throws java.lang.Exception
Lock in writting acces return boolean true if the lock is taken
Specified by:
lockWrite in interface LockItf

setLock

protected void setLock(Lock lock)
setLock specify the lock
Parameters:
lock - the lock to associate to the RoundRobin

setMountFile

protected void setMountFile(java.lang.String nameOfMountFile)
setMountFile specify the mount file of RoundRobin
Parameters:
nameOfMountFile - the name of the mount file

setType

protected void setType(java.lang.String type)
                throws java.lang.Exception
setType specify the type of a RoundRobin
Parameters:
type - the type of RoundRobin

throwException

protected void throwException(java.lang.String message,
                              java.lang.Exception e)
                       throws java.lang.Exception
throwException throw a exception with the specific message
Parameters:
message - the exception message
e - the exception which occurs

throwRemoteException

protected void throwRemoteException(java.lang.String message,
                                    java.lang.Exception e)
                             throws java.rmi.RemoteException
throwRemoteException throw a remote exception with the specific message
Parameters:
message - the exception message
e - the exception which occurs

unLockRead

public boolean unLockRead()
                   throws java.lang.Exception
Unlock in reading acces return boolean true if the lock is left
Specified by:
unLockRead in interface LockItf

unLockWrite

public boolean unLockWrite()
                    throws java.lang.Exception
Unlock in writting acces return boolean true if the lock is left
Specified by:
unLockWrite in interface LockItf

Copyright 1885-2001 FIRMENICH SA, Geneva

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