package ora.jwsnut.chapter2.bookservice;
import java.util.HashMap;
import java.rmi.Remote;
import java.rmi.RemoteException;
/**
* The interface definition for the book
* web service.
*/
public interface BookQuery extends Remote {
/**
* Gets the number of books known to the service
* @return the number of books known to the service.
*/
public abstract int getBookCount() throws RemoteException;
/**
* Get the author for a book with a given name.
* @param name the name of the book.
* @return the author of the book, or <code>null</code>
* if no matching book can be found.
*/
public abstract String getAuthor(String name) throws RemoteException;
/**
* Gets the name of the editor for a book.
* @param name the name of the book.
* @return the editor of the book, or <code>null</code>
* if no matching book can be found.
*/
public abstract String getEditor(String name) throws RemoteException;
/**
* Gets the price of a book with a given name. If the given
* name does not match with a known book, a <code>BookServiceException</code>
* is thrown.
* @param name the name of the book.
* @return the price of the book.
*/
public abstract double getPrice(String name) throws BookServiceException,
RemoteException;
/**
* Gets information for all known books, in the form of an
* array.
* @return an array of <code>BookInfo</code> objects with one
* entry for each book.
*/
public abstract BookInfo[] getBookInfo() throws RemoteException;
/**
* Returns all of the books known to the book
* service in the form of a <code>HashMap</code> where the
* key to each entry is the book title in upper case
* and the value is a <code>BookInfo</code> object.
*/
public abstract HashMap getBookMap() throws RemoteException;
}
|