Class FileStorageProxyImpl
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description protected java.lang.StringbladeIdprotected longdateOrigin-
Fields inherited from interface org.ow2.clif.storage.api.StorageProxyAdmin
STORAGEPROXY_ADMIN
-
Fields inherited from interface org.ow2.clif.storage.api.StorageWrite
STORAGE_WRITE
-
-
Constructor Summary
Constructors Constructor Description FileStorageProxyImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseCollect(UniqueKey key)voidcloseTest()Terminates the file storage system by closing every file stream.java.io.Serializablecollect(UniqueKey key)Performs one collect step forward.java.lang.StringgetBladeId()Get the hostName of this interfacelonggetCollectSize(UniqueKey key)voidinit(java.lang.String bladeId)Initializes the storage systemUniqueKeyinitCollect(java.io.Serializable testId)Initializes a new collect for a given testvoidnewTest(java.io.Serializable testId)Initializes the storage directories for the new testvoidwrite(BladeEvent event)Writes a blade event in the storage system.
-
-
-
Method Detail
-
write
public void write(BladeEvent event) throws ClifException
Writes a blade event in the storage system.- Specified by:
writein interfaceStorageWrite- 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 ClifExceptionInitializes the storage directories for the new test- Specified by:
newTestin interfaceStorageProxyAdmin- Parameters:
testId- test unique identifier- Throws:
ClifException
-
closeTest
public void closeTest()
Terminates the file storage system by closing every file stream.- Specified by:
closeTestin interfaceStorageProxyAdmin
-
getBladeId
public java.lang.String getBladeId()
Description copied from interface:StorageProxyAdminGet the hostName of this interface- Specified by:
getBladeIdin interfaceStorageProxyAdmin- 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:
initin interfaceStorageProxyAdmin
-
initCollect
public UniqueKey initCollect(java.io.Serializable testId)
Initializes a new collect for a given test- Specified by:
initCollectin interfaceStorageProxyAdmin- 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:
getCollectSizein interfaceStorageProxyAdmin
-
collect
public java.io.Serializable collect(UniqueKey key)
Description copied from interface:StorageProxyAdminPerforms 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:
collectin interfaceStorageProxyAdmin- 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:
closeCollectin interfaceStorageProxyAdmin
-
-