01: /*
02: * This file or a portion of this file is licensed under the terms of
03: * the Globus Toolkit Public License, found in file ../GTPL, or at
04: * http://www.globus.org/toolkit/download/license.html. This notice must
05: * appear in redistributions of this file, with or without modification.
06: *
07: * Redistributions of this Software, with or without modification, must
08: * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
09: * some other similar material which is provided with the Software (if
10: * any).
11: *
12: * Copyright 1999-2004 University of Chicago and The University of
13: * Southern California. All rights reserved.
14: */
15: package org.griphyn.vdl.euryale;
16:
17: import java.io.*;
18:
19: /**
20: * This interface describes what file factories should look like.
21: *
22: * @author Kavitha Ranganathan
23: * @author Jens-S. Vöckler
24: * @author Yong Zhao
25: * @version $Revision: 289 $
26: *
27: * @see DAX2DAG
28: */
29: public interface FileFactory {
30: /**
31: * Virtual constructor: Creates the next file with the given basename.
32: * @param basename is the filename to create. Don't specify dirs here.
33: * @return a File structure which points to the new file.
34: * @see #getCount()
35: */
36: public File createFile(String basename) throws IOException;
37:
38: /**
39: * Returns the number of times the regular virtual constructor for
40: * structured entries was called.
41: * @return the count for createFile invocations.
42: * @see #createFile( String )
43: */
44: public int getCount();
45:
46: /**
47: * Virtual constructor: Creates the next file with the given basename
48: * which is guaranteed to be created in the base directory, and never
49: * in any structured directories that child classes may implement.
50: * @param basename is the filename to create. Don't specify dirs here.
51: * @return a File structure which points to the new file.
52: * @see #getFlatCount()
53: */
54: public File createFlatFile(String basename) throws IOException;
55:
56: /**
57: * Returns the number of times the virtual constructor for flat files
58: * was called.
59: * @return the count for createFlatFile invocations.
60: * @see #createFlatFile( String )
61: */
62: public int getFlatCount();
63:
64: /**
65: * Resets the helper structures after changing layout parameters. You
66: * will also need to call this function after you invoked the virtual
67: * constructors, but want to change parameter pertaining to the
68: * directory structure. The file counters will also be reset!
69: */
70: public void reset();
71: }
|