KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > datashare > PersistenceInterface


1 /* ----- BEGIN LICENSE BLOCK -----
2  * Version: MPL 1.1
3  *
4  * The contents of this file are subject to the Mozilla Public License Version
5  * 1.1 (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  * http://www.mozilla.org/MPL/
8  *
9  * Software distributed under the License is distributed on an "AS IS" basis,
10  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11  * for the specific language governing rights and limitations under the
12  * License.
13  *
14  * The Original Code is the DataShare server.
15  *
16  * The Initial Developer of the Original Code is
17  * Ball Aerospace & Technologies Corp, Fairborn, Ohio
18  * Portions created by the Initial Developer are Copyright (C) 2001
19  * the Initial Developer. All Rights Reserved.
20  *
21  * Contributor(s): Charles Wood <cwood@ball.com>
22  *
23  * ----- END LICENSE BLOCK ----- */

24 /* RCS $Id: PersistenceInterface.java,v 1.1.1.1 2001/10/23 13:37:18 lizellaman Exp $
25  * $Log: PersistenceInterface.java,v $
26  * Revision 1.1.1.1 2001/10/23 13:37:18 lizellaman
27  * initial sourceforge release
28  *
29  */

30
31 package org.datashare;
32
33 import java.util.Enumeration JavaDoc;
34 import java.util.Hashtable JavaDoc;
35
36 /**
37  * this interface shall be implemented by the class that provides the ability to save/retrieve
38  * any data that is to be persisted by DataShare.
39  * @date July 25, 2001
40  * @author Charles Wood
41  * @version 1.0
42  */

43 public interface PersistenceInterface
44    {
45    /**
46     * must be called first, initializes any required databases/tables, etc.
47     * The database is ready to use after a successful call to this method.
48     * @return true if successful, false otherwise.
49     */

50    boolean initialize();
51
52    /**
53     * Returns an Enumeration of Objects, the value of which is set to the 'userObject' field of the
54     * properties attribute that was used to create the persisted object. (in English, if you create a
55     * pesisted object with a properties key='userObject', value=(SessionInfo instance), the Enumeration
56     * will return the SessionInfo object as an Object).
57     */

58    Enumeration JavaDoc
59    searchForUserObjects(String JavaDoc table, String JavaDoc searchString);
60
61    /**
62     *
63     */

64    void
65    delete(String JavaDoc table, String JavaDoc searchString);
66
67    ///**
68
// *
69
// */
70
//Enumeration
71
//retreive(String table, String key);
72

73    /**
74     *
75     */

76    String JavaDoc
77    save(String JavaDoc table, Hashtable JavaDoc properties);
78
79    /**
80     *
81     */

82    String JavaDoc
83    update(String JavaDoc table, String JavaDoc key, Object JavaDoc object);
84
85    /**
86     *
87     */

88    int findCount(String JavaDoc table, String JavaDoc searchString);
89
90    /** THIS IS ADS SPECIFIC
91     * saves the file on the server's disk drive.
92     * @param ownerKeyString the user whose copy folder we wish to save the file into
93     * @param si Session that had this function
94     * @param ci Channel that had this function
95     * @param fileExtension the part of the filename that comes after the '.'
96     * @param fileContents the text file converted to
97     * @param mimeType the type of file to be saved, see second column of ads\config\types.cfg
98     */

99    void
100    saveFunctionDataToDisk(String JavaDoc ownerKeyString, SessionInfo si, ChannelInfo ci, String JavaDoc fileExtension, byte[] fileContents, String JavaDoc mimeType);
101    }
102
Popular Tags