|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DASResult<E>
DASResult represents the result of invoking a data service operation or an ad-hoc query on a data service. It is an iterator, allowing forward-only access to each item in the result in turn. (The definition of "item" is consistent with the definition in the XQuery Data Model specification.)
Field Summary | |
---|---|
static int |
EXTRA_DATA_SERVICE_AUDIT
Constant for getExtraData() requesting the DataServiceAudit for the execution be returned. |
static int |
EXTRA_QUERY_PLAN
Constant for getExtraData() requesting the Query Plan be returned (as a String containing XML). |
static int |
EXTRA_STRUCTURAL_TYPE
Constant for getExtraData() requesting the structural type of the result be returned. |
static int |
EXTRA_TOPLEVEL_TYPE
Constant for getExtraData() requesting the result top-level return type be returned (as a String containing XML). |
Method Summary | ||
---|---|---|
void |
dispose()
Call when you do not intend to request any more results from this DASResult. |
|
java.lang.Object |
getExtraData(int datatype)
Obtain extra "out of band" data from the DASResult. |
|
E[] |
getItems()
Returns all items represented by this result. |
|
|
getItems(java.lang.Class<C> component)
Returns all items represented by this result. |
|
boolean |
hasNext()
Returns true if there are any remaining items in this result. |
|
boolean |
isDisposed()
Inquire whether this DASResult has been disposed (see dispose() ). |
|
E |
next()
Returns the next item in the result. |
|
java.lang.String |
nextAsString()
Returns the next item in the result as a simple String. |
|
|
setGenericClass(java.lang.Class<C> generic_class)
Specify a default component class for the array returned from getItems(). |
Field Detail |
---|
static final int EXTRA_QUERY_PLAN
static final int EXTRA_TOPLEVEL_TYPE
static final int EXTRA_STRUCTURAL_TYPE
static final int EXTRA_DATA_SERVICE_AUDIT
Method Detail |
---|
boolean hasNext() throws DASException
DASException
- if there is an unexpected problem
determining if there are more items.E next() throws DASException
DASException
- if there is a problem retrieving the next
item.
java.lang.IllegalStateException
- if getItems() has previously been
called on this DASResult.java.lang.String nextAsString() throws DASException
DASException
- if there is a problem retrieving the next
item.
java.lang.IllegalStateException
- if getItems() has previously been
called on this DASResult.E[] getItems() throws DASException
After this method is called, the DASResult will be disposed automatically.
Note that the component type of the returned array will be
the same as the generic type E - that is, Object if this
DASResult was obtained from a dynamic DataAccessService or
PreparedExpression, or the specified type if the DASResult was
obtained from a static DataAccessService subclass. If you wish
to control the component type of the array more directly - for
instance, if you know that all returned Objects will be
DataObjects and you'd like to cast the return value to
DataObject[] - use getItems(Class)
.
DASException
- if there is a problem retrieving the
results.
java.lang.IllegalStateException
- if next() has previously been
called on this DASResult.<C> C[] getItems(java.lang.Class<C> component) throws DASException
After this method is called, the DASResult will be disposed automatically.
component
- The class to use as the component type of the
returned array. Must not be null. Must represent a legitimate
superclass of all objects that will be returned.
DASException
- if there is a problem retrieving the
results.
java.lang.IllegalStateException
- if next() has previously been
called on this DASResult.
java.lang.ArrayStoreException
- if component represents a class
which is not a superclass of all elements of the array.<C> DASResult<E> setGenericClass(java.lang.Class<C> generic_class)
void dispose() throws DASException
isDisposed()
); this method will silently return in
that case.
DASException
- if there are unexpected problems in
attempting to free up server resources.boolean isDisposed()
dispose()
). If it has not yet been disposed, it may still be
holding open resources on the server. Note that being
disposed does NOT necessarily mean that no more results can
be returned from next(); in particular, a DASResult obtained
when the RequestConfig option RequestConfig.FETCH_ALL_IMMEDIATELY
is specified
will be disposed before it is returned to the client.
java.lang.Object getExtraData(int datatype) throws DASException
datatype
- One of the DASResult.EXTRA_* constants.
DASException
- if there is some problem obtaining the
data. Note that implementations should NOT throw an exception
if the requested datatype is not known to them, but should just
return null; this provides for seamless additions of more types
later.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |