KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > core > storage > gammaStore > StorageFactory


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Core License version 1 published by ozone-db.org.
3
//
4
// Copyright (C) 2003-@year@, Leo Mekenkamp. All rights reserved.
5
//
6
// $Id: StorageFactory.java,v 1.1 2004/01/02 09:24:38 leomekenkamp Exp $
7

8 package org.ozoneDB.core.storage.gammaStore;
9
10 import java.io.IOException JavaDoc;
11
12 /**
13  * <p>Factory for creating <code>Storage</code> instances.</p>
14  * <p>Because of the large number of 'files' that
15
16  * @author <a HREF="mailto:leoATmekenkampD0Tcom">Leo Mekenkamp (mind the anti sp@m)</a>
17  * @version $Id: StorageFactory.java,v 1.1 2004/01/02 09:24:38 leomekenkamp Exp $
18  */

19 public interface StorageFactory {
20     
21     /**
22      * <p>Creates an input stream that is uniquely identified by the specified
23      * name. Implementing classes typically have a separate namespace
24      * (subdirectory in case of files) for each instance. The name
25      * parameter uniquely and inambiguously specifies the exact location to
26      * read/write data: this method returns a <code>Storage</code> to the same location if and
27      * only if the name is equal.</p>
28      * <p>Note: because it is impossible to know what characters are supported
29      * by the specific implementation, one is advised to be conservative in the
30      * use of the name parameter; keep it short, use either lowercase or
31      * uppercase characters, do not use '+', '-', '&', '>', etc.</p>
32      *
33      * @param name name of the <code>Storage</code> instance
34      */

35     public Storage createStorage(String JavaDoc name) throws IOException JavaDoc;
36     
37     /**
38      * <p>Deletes all data that are in the namespace of this instance. Typical
39      * file-based implementations would delete all files in the directory this
40      * instance uses.</p>
41      *
42      * @return <code>true</code> if data was deleted, <code>false</code> if
43      * otherwise.
44      */

45     public void deleteAll() throws IOException JavaDoc;
46     
47     /**
48      * <p>Deletes the data in the namespace of this instance specified by name.
49      * Typical file-based implementations would delete the file specified by
50      * name from the directory this instance uses.</p>
51      * <p>Should not throw any exception if the specified file does not exist.</p>
52      *
53      * @param name name of the data to delete
54      * @throws IOException
55      */

56     public void delete(String JavaDoc name) throws IOException JavaDoc;
57     
58     
59 }
60
Popular Tags