Source code: com/eireneh/bible/book/BibleDriver.java
1
2 package com.eireneh.bible.book;
3
4 import java.util.*;
5
6 /**
7 * The BibleDriver class is an gateway to all the instances of the Books
8 * controlled by this driver.
9 *
10 * <table border='1' cellPadding='3' cellSpacing='0' width="100%">
11 * <tr><td bgColor='white'class='TableRowColor'><font size='-7'>
12 * Distribution Licence:<br />
13 * Project B is free software; you can redistribute it
14 * and/or modify it under the terms of the GNU General Public License,
15 * version 2 as published by the Free Software Foundation.<br />
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.<br />
20 * The License is available on the internet
21 * <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, by writing to
22 * <i>Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
23 * MA 02111-1307, USA</i>, Or locally at the Licence link below.<br />
24 * The copyright to this program is held by it's authors.
25 * </font></td></tr></table>
26 * @see <a href='http://www.eireneh.com/servlets/Web'>Project B Home</a>
27 * @see docs.Licence
28 * @author Joe Walker
29 * @version D6.I6.T2
30 * @stereotype role
31 */
32 public interface BibleDriver
33 {
34 /**
35 * A simple driver description name. This should be callable before
36 * init() is called, so that we can find the friendly name of a
37 * Bible without having to fully initialize it.
38 * @return A short identifing string
39 */
40 public String getDriverName();
41
42 /**
43 * Get a list of the Books available from the driver
44 * @return an array of book names
45 */
46 public String[] getBibleNames() throws BookException;
47
48 /**
49 * How many Bibles does this driver own
50 * @return A count of the Bibles
51 */
52 public int countBibles();
53
54 /**
55 * Does the named Bible exist?
56 * @param name The name of the version to test for
57 * @return true if the Bible exists
58 */
59 public boolean exists(String name);
60
61 /**
62 * Fetch a currently existing Bible, read-only
63 * @param name The name of the version to create
64 * @exception BookException If the name is not valid
65 */
66 public Bible getBible(String name) throws BookException;
67
68 /**
69 * Create a new blank Bible ready for writing
70 * @param name The name of the version to create
71 * @exception BookException If the name is not valid
72 */
73 public Bible createBible(String name) throws BookException;
74
75 /**
76 * Rename a Book.
77 * @param old_name The current name for the version
78 * @param new_name The name we would like the driver to have
79 */
80 public void renameBible(String old_name, String new_name) throws BookException;
81
82 /**
83 * Delete Book
84 * @param name The name of the version to delete
85 */
86 public void deleteBible(String name) throws BookException;
87 }