org.crosswire.jsword.book.install
Interface Installer

All Superinterfaces:
BookList
All Known Implementing Classes:
AbstractSwordInstaller, FtpSwordInstaller, HttpSwordInstaller

public interface Installer
extends BookList

An interface that allows us to download from a specific source of Bible data. It is important that implementor of this interface define equals() and hashcode() properly.

To start with I only envisage that we use Sword sourced Bible data however the rest of the system is designed to be able to use data from e-Sword, OLB, etc.

Distribution Licence:
JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
The copyright to this program is held by it's authors.

Version:
$Id: Installer.java,v 1.10 2005/03/19 01:56:47 dmsmith Exp $
Author:
Joe Walker [joe at eireneh dot com]
See Also:
Licence

Method Summary
 void downloadSearchIndex(Book book, URL tempDest)
          Download a search index for the given Book.
 List getBooks()
          Get a list of BookMetaData objects that represent downloadable modules.
 String getURL()
          Accessor for the URL
 void install(Book book)
          Download and install a module locally.
 boolean isNewer(Book book)
          Return true if the module is not installed or there is a newer version to install.
 void reloadBookList()
          Refetch a list of names from the remote source.
 URL toRemoteURL(Book book)
           
 
Methods inherited from interface org.crosswire.jsword.book.BookList
addBooksListener, getBooks, removeBooksListener
 

Method Detail

getURL

String getURL()
Accessor for the URL

Returns:
the source url

toRemoteURL

URL toRemoteURL(Book book)
Parameters:
book - The book meta-data to get a URL from.
Returns:
the remote url for the BookMetaData

getBooks

List getBooks()
Get a list of BookMetaData objects that represent downloadable modules. If no list has been retrieved from the remote source using reloadIndex() then we should just return an empty list and not attempt to contact the remote source. See notes on reload for more information.

Specified by:
getBooks in interface BookList
See Also:
reloadBookList()

isNewer

boolean isNewer(Book book)
Return true if the module is not installed or there is a newer version to install.

Parameters:
book - The book meta-data to check on.
Returns:
whether there is a newer version to install

reloadBookList

void reloadBookList()
                    throws InstallException
Refetch a list of names from the remote source. It would make sense if the user was warned about the implications of this action. If the user lives in a country that persecutes Christians then this action might give the game away.

Throws:
InstallException

install

void install(Book book)
             throws InstallException
Download and install a module locally. The name should be one from an index list retrieved from getIndex() or reloadIndex()

Parameters:
book - The module to install
Throws:
InstallException

downloadSearchIndex

void downloadSearchIndex(Book book,
                         URL tempDest)
                         throws InstallException
Download a search index for the given Book. The installation of the search index is the responsibility of the IndexManager.

Parameters:
book - The book to download a search index for.
tempDest - A temporary URL for downloading to. Passed to the IndexManager for installation.
Throws:
InstallException

Copyright ? 2003-2004