ozone core API

org.ozoneDB.core.storage.gammaStore
Interface StorageFactory

All Known Implementing Classes:
FileStorageFactory

public interface StorageFactory

Factory for creating Storage instances.

Because of the large number of 'files' that

Version:
$Id: StorageFactory.java,v 1.1 2004/01/02 09:24:38 leomekenkamp Exp $
Author:
Leo Mekenkamp (mind the anti sp@m)

Method Summary
 Storage createStorage(java.lang.String name)
          Creates an input stream that is uniquely identified by the specified name.
 void delete(java.lang.String name)
          Deletes the data in the namespace of this instance specified by name.
 void deleteAll()
          Deletes all data that are in the namespace of this instance.
 

Method Detail

createStorage

public Storage createStorage(java.lang.String name)
                      throws java.io.IOException

Creates an input stream that is uniquely identified by the specified name. Implementing classes typically have a separate namespace (subdirectory in case of files) for each instance. The name parameter uniquely and inambiguously specifies the exact location to read/write data: this method returns a Storage to the same location if and only if the name is equal.

Note: because it is impossible to know what characters are supported by the specific implementation, one is advised to be conservative in the use of the name parameter; keep it short, use either lowercase or uppercase characters, do not use '+', '-', '&', '>', etc.

Parameters:
name - name of the Storage instance
Throws:
java.io.IOException

deleteAll

public void deleteAll()
               throws java.io.IOException

Deletes all data that are in the namespace of this instance. Typical file-based implementations would delete all files in the directory this instance uses.

Returns:
true if data was deleted, false if otherwise.
Throws:
java.io.IOException

delete

public void delete(java.lang.String name)
            throws java.io.IOException

Deletes the data in the namespace of this instance specified by name. Typical file-based implementations would delete the file specified by name from the directory this instance uses.

Should not throw any exception if the specified file does not exist.

Parameters:
name - name of the data to delete
Throws:
java.io.IOException

ozone core API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.