edu.ucsb.adl.middleware.rmi
Interface ResultSet

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
ResultSetImpl

public interface ResultSet
extends java.rmi.Remote

RMI interface to a result set.

Version:
$Header: /export/home/gjanee/middleware/edu/ucsb/adl/middleware/rmi/RCS/ResultSet.java,v 1.3 2004/03/15 20:38:13 gjanee Exp $

$Log: ResultSet.java,v $ Revision 1.3 2004/03/15 20:38:13 gjanee
Added method getQuery.

Revision 1.2 2003/06/10 16:01:35 gjanee
Query results are now Result objects, i.e., triplets of standard metadata views.

Revision 1.1 2001/03/15 22:37:46 gjanee
Initial revision

Author:
Greg Janée
Alexandria Digital Library

Method Summary
 long getCompletionTime()
          Returns the result set's completion time.
 long getCreationTime()
          Returns the result set's creation time.
 java.lang.Exception getException()
          Returns the exception that terminated the associated query.
 int getID()
          Returns the result set's ID.
 int getNumResults()
          Returns the current number of results in the result set.
 java.lang.String getQuery()
          Returns the XML query associated with the result set.
 edu.ucsb.adl.middleware.Result getResult(int index)
          Returns a result from the result set.
 edu.ucsb.adl.middleware.Result[] getResults(int from, int to)
          Returns a range of results from the result set.
 int getTotalResultCount()
          Returns the total result count.
 boolean isComplete()
          Tests if the result set is complete.
 void release()
          Removes the result set from the system-wide registry.
 void waitForCompletion()
          Returns when the result set is complete.
 

Method Detail

getID

public int getID()
          throws java.rmi.RemoteException
Returns the result set's ID.

Returns:
The ID.
Throws:
java.rmi.RemoteException - If an RMI error occurs.

getCreationTime

public long getCreationTime()
                     throws java.rmi.RemoteException
Returns the result set's creation time.

Returns:
The time in the semantics of System.currentTimeMillis.
Throws:
java.rmi.RemoteException - If an RMI error occurs.

getQuery

public java.lang.String getQuery()
                          throws java.rmi.RemoteException
Returns the XML query associated with the result set.

Returns:
The query.
Throws:
java.rmi.RemoteException - If an RMI error occurs.

getNumResults

public int getNumResults()
                  throws java.rmi.RemoteException
Returns the current number of results in the result set.

Returns:
The current number of results.
Throws:
java.rmi.RemoteException - If an RMI error occurs.

getResult

public edu.ucsb.adl.middleware.Result getResult(int index)
                                         throws java.rmi.RemoteException
Returns a result from the result set.

Parameters:
index - The index of the result to return.
Returns:
The query result.
Throws:
java.lang.ArrayIndexOutOfBoundsException - If index is out of bounds.
java.rmi.RemoteException - If an RMI error occurs.

getResults

public edu.ucsb.adl.middleware.Result[] getResults(int from,
                                                   int to)
                                            throws java.rmi.RemoteException
Returns a range of results from the result set.

Parameters:
from - The starting index, inclusive.
to - The ending index, exclusive.
Returns:
The query results.
Throws:
java.lang.ArrayIndexOutOfBoundsException - If from or to are out of bounds or if from is greater than to.
java.rmi.RemoteException - If an RMI error occurs.

isComplete

public boolean isComplete()
                   throws java.rmi.RemoteException
Tests if the result set is complete.

Returns:
true if the result set is complete.
Throws:
java.rmi.RemoteException - If an RMI error occurs.

getCompletionTime

public long getCompletionTime()
                       throws java.rmi.RemoteException
Returns the result set's completion time.

Returns:
The time in the semantics of System.currentTimeMillis or a negative value if the result set is incomplete.
Throws:
java.rmi.RemoteException - If an RMI error occurs.

getTotalResultCount

public int getTotalResultCount()
                        throws java.rmi.RemoteException
Returns the total result count.

Returns:
The total result count, or a negative value if the total result count is unknown or the result set is incomplete.
Throws:
java.rmi.RemoteException - If an RMI error occurs.

getException

public java.lang.Exception getException()
                                 throws java.rmi.RemoteException
Returns the exception that terminated the associated query.

Returns:
The exception, or null if the query completed successfully or the result set is incomplete.
Throws:
java.rmi.RemoteException - If an RMI error occurs.

waitForCompletion

public void waitForCompletion()
                       throws java.rmi.RemoteException
Returns when the result set is complete.

Throws:
java.rmi.RemoteException - If an RMI error occurs.

release

public void release()
             throws java.rmi.RemoteException
Removes the result set from the system-wide registry. The result set is otherwise unchanged so that threads that are already referencing the result set may continue to do so without problem.

Throws:
java.rmi.RemoteException - If an RMI error occurs.