FileDocCategorySizeDatePackage
ContextBookQuery.javaAPI DocExample2023Fri Oct 18 14:28:16 BST 2002ora.jwsnut.chapter6.contextbookservice

ContextBookQuery.java

package ora.jwsnut.chapter6.contextbookservice;

import java.rmi.Remote;
import java.rmi.RemoteException;
import javax.xml.rpc.holders.StringHolder;

/**
 * The interface definition for the context-handling
 * book web service.
 */
public interface ContextBookQuery extends Remote {

    /**
     * Sets whether book titles returned by the
     * getBookTitle() method should be in upper case.
     * @param cond <code>true</code> if all book titles should
     * be in upper case, <code>false</code> for title case.
     */
    public abstract void setUpperCase(boolean cond) throws RemoteException;
    
    /**
     * Returns whether book titles are being forced to
     * upper case.
     * @return <code>true</code> if book titles are forced to
     * upper case, <code>false</code> if not.
     */
    public abstract boolean isUpperCase() throws RemoteException;
    
    /**
     * 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 title of a given book.
     * @param index the index of the book whose title is required
     * @return the title of the given book, or <code>null</code> if
     * the index is not valid.
     */
    public abstract String getBookTitle(int index) throws RemoteException;
    
    /**
     * Gets the author for a books with a given title
     * @param title the titles of the book
     * @param author an output parameter that will be set to the author of the given book
     * @throws ContextBookServiceException if the book title is unknown
     */
    public abstract void getBookAuthor(String title, StringHolder author) 
                                        throws ContextBookServiceException, RemoteException;
    
    /**
     * Makes a log entry.
     * @param value the value to be logged.
     */
    public abstract void log(String value) throws RemoteException;
}