org.ow2.clif.storage.lib.filestorage
Class FileStorageProxyImpl

java.lang.Object
  extended by org.ow2.clif.storage.lib.filestorage.FileStorageProxyImpl
All Implemented Interfaces:
StorageProxyAdmin, StorageWrite

public class FileStorageProxyImpl
extends java.lang.Object
implements StorageWrite, StorageProxyAdmin

Proxy part of a file-based storage system.

Author:
Julien Buret, Nicolas Droze, Bruno Dillenseger

Field Summary
protected  java.lang.String bladeId
           
protected  long dateOrigin
           
 
Fields inherited from interface org.ow2.clif.storage.api.StorageWrite
STORAGE_WRITE
 
Fields inherited from interface org.ow2.clif.storage.api.StorageProxyAdmin
STORAGEPROXY_ADMIN
 
Constructor Summary
FileStorageProxyImpl()
           
 
Method Summary
 void closeCollect(UniqueKey key)
           
 void closeTest()
          Terminates the file storage system by closing every file stream.
 java.io.Serializable collect(UniqueKey key)
          Performs one collect step forward.
 java.lang.String getBladeId()
          Get the hostName of this interface
 long getCollectSize(UniqueKey key)
           
 void init(java.lang.String bladeId)
          Initializes the storage system
 UniqueKey initCollect(java.io.Serializable testId)
          Initializes a new collect for a given test
 void newTest(java.io.Serializable testId)
          Initializes the storage directories for the new test
 void write(BladeEvent event)
          Writes a blade event in the storage system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bladeId

protected java.lang.String bladeId

dateOrigin

protected long dateOrigin
Constructor Detail

FileStorageProxyImpl

public FileStorageProxyImpl()
Method Detail

write

public void write(BladeEvent event)
           throws ClifException
Writes a blade event in the storage system.

Specified by:
write in interface StorageWrite
Parameters:
event - The event to write
Throws:
ClifException - the event couldn't be written to the corresponding file or the corresponding file could not be opened. This exception is thrown only once for current test. Then, subsequent calls to write() method are ignored for current test.

newTest

public void newTest(java.io.Serializable testId)
             throws ClifException
Initializes the storage directories for the new test

Specified by:
newTest in interface StorageProxyAdmin
Parameters:
testId - test unique identifier
Throws:
ClifException

closeTest

public void closeTest()
Terminates the file storage system by closing every file stream.

Specified by:
closeTest in interface StorageProxyAdmin

getBladeId

public java.lang.String getBladeId()
Description copied from interface: StorageProxyAdmin
Get the hostName of this interface

Specified by:
getBladeId in interface StorageProxyAdmin
Returns:
The identifier of the blade containing the storage proxy component

init

public void init(java.lang.String bladeId)
Initializes the storage system

Specified by:
init in interface StorageProxyAdmin

initCollect

public UniqueKey initCollect(java.io.Serializable testId)
Initializes a new collect for a given test

Specified by:
initCollect in interface StorageProxyAdmin
Parameters:
testId - the test identifier whose data must be collected
Returns:
a UniqueKey object identifying this collect, or null if the test identifier does not designate a valid test
See Also:
UniqueKey

getCollectSize

public long getCollectSize(UniqueKey key)
Specified by:
getCollectSize in interface StorageProxyAdmin

collect

public java.io.Serializable collect(UniqueKey key)
Description copied from interface: StorageProxyAdmin
Performs one collect step forward. Repeated calls to this method may be done to achieve a full collect (until it returns a null value).

Specified by:
collect in interface StorageProxyAdmin
Parameters:
key - the collect identifier
Returns:
null if the collect is completed, or an arbitrary serializable object whose interpretation depends on the StorageProxy implementation.

closeCollect

public void closeCollect(UniqueKey key)
Specified by:
closeCollect in interface StorageProxyAdmin