package ora.jwsnut.chapter6.extendedbookservice;
import java.awt.Image;
import java.rmi.Remote;
import java.rmi.RemoteException;
import javax.activation.DataHandler;
import javax.mail.internet.MimeMultipart;
import javax.xml.transform.Source;
/**
* The interface definition for the extended
* book web service.
*/
public interface EBookQuery 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;
/**
* Gets the set of book titles.
* @return the set of book titles.
*/
public abstract String[] getBookTitles() throws RemoteException;
/**
* Gets the images for books with given titles
* @param titles the titles of the books
* @param gif <code>true</code> to request a GIF, <code>false</code> for JPEG
* @return an array of images for the named books.
* @throws EBookServiceException if any book title is unknown
*/
public abstract Image[] getImages(String[] titles, boolean gif) throws EBookServiceException,
RemoteException;
/**
* Gets book images in the form of a DataHandler
* @param titles the titles of the books
* @param gif <code>true</code> to request GIF, <code>false</code> for JPEG
* @return an array of DataHandlers for the cover images for the named books.
* @throws EBookServiceException if any book title is unknown
*/
public abstract DataHandler[] getImageHandlers(String[] titles, boolean gif) throws EBookServiceException,
RemoteException;
/**
* Gets the book images in MimeMultipart form
* @return a MimeMultipart object containing the book images.
*/
public abstract MimeMultipart getAllImages() throws EBookServiceException, RemoteException;
/**
* Gets XML details for a given list of books.
* @param titles the titles of the books.
* @return an array of Source object containing XML details for
* the given list of books.
* @throws EBookServiceException if the book title is unknown
*/
public abstract Source[] getBookDetails(String[] titles) throws EBookServiceException,
RemoteException;
}
|