Enterprise Information Portal APIs

com.ibm.mm.sdk.server
Class DKResultSetCursorDES

java.lang.Object
  |
  +--com.ibm.mm.sdk.server.dkAbstractResultSetCursor
        |
        +--com.ibm.mm.sdk.server.dkAbstractResultSetCursorScrollable
              |
              +--com.ibm.mm.sdk.server.DKResultSetCursorDES
All Implemented Interfaces:
DKConstant, DKConstantDES, DKMessageId, DKMessageIdDES, dkResultSetCursor, dkResultSetCursorScrollable

public class DKResultSetCursorDES
extends dkAbstractResultSetCursorScrollable
implements DKConstantDES, DKMessageId, DKMessageIdDES

This class is a cursor on a result set for a DES query (DKResults). DES does not stage the results of a query, so the entire result is returned at once.

See Also:
DKResults, DKDatastoreDES.execute(java.lang.String, short, com.ibm.mm.sdk.common.DKNVPair[])

Fields inherited from interface com.ibm.mm.sdk.common.DKConstantDES
DK_DES_APPID_HANDLE, DK_DES_APPINFO_HANDLE, DK_DES_BROKER_HANDLE, DK_DES_CMBROOT, DK_DES_DATASOURCE, DK_DES_DLL_NAME, DK_DES_DSTYPE, DK_DES_GQL_QL_TYPE, DK_DES_INIFILE, DK_DES_ITEMID_SEPARATOR, DK_DES_PORT, DK_DES_PROPERTY_DISPNAME, DK_DES_PROPERTY_HELPTEXT, DK_DES_PROPERTY_LANGUAGE, DK_DES_PROPERTY_RETRIEVABLE, DK_DES_PROPERTY_SEARCHABLE, DK_DES_PROPERTY_SEARCHOPERATOR, DK_DES_PROPERTY_VALUECOUNT, DK_DES_REPOSITORIES_HANDLE, DK_DES_RMIREF_HANDLE, DK_DES_SESSION_HANDLE, DK_FILESYSTEM_ENTITY, DK_NOTES_ENTITY, DK_NOTESPUMP_ENTITY, DK_WEB_ENTITY
 
Fields inherited from interface com.ibm.mm.sdk.common.DKConstant
    For details, see the class or interface
 
Fields inherited from interface com.ibm.mm.sdk.common.DKMessageId
    For details, see the class or interface
 
Fields inherited from interface com.ibm.mm.sdk.common.DKMessageIdDES
DK_DES_MSG_MSGID_NOT_FOUND
 
Method Summary
 void addObject(DKDDO newDDO)
          Adds a new element of the same type, represented by the given DDO, to the datastore.
 int cardinality()
          Gets the number of query results if supported.
 void close()
          Closes the cursor, and invalidates the result set.
 java.lang.String datastoreName()
          Gets the datastore name
 java.lang.String datastoreType()
          Gets the datastore type
 void deleteObject()
          Deletes a DDO object at current position from result set from server.
 void destroy()
          Destroys the resultSetCursor.
 DKDDO fetchFirst()
          fetchFirst will fetch the first DDO item in the cursor
 DKDDO fetchLast()
          Retrieves the last object in the result set
 DKDDO fetchNext()
          Retrieves the next object in the result set
 java.lang.Object fetchNextByName(java.lang.String dataItemName)
          Get a data item contained within the DDO at the next position in the result.
 boolean fetchNextN(int how_many, dkCollection collection)
          Retrieves the next N objects in the result set
 boolean fetchNextNByName(java.lang.String dataItemName, int how_many, java.lang.Object[] array)
          For the next DDO's in the result, fetch the Value for a data Item named and add it to .
 DKDDO fetchObject()
          Retrieves an object at the current position in the result set Does not change cursor position.
 java.lang.Object fetchObjectByName(java.lang.String dataItemName)
          Retrieves the dataItem value from current DDO with the given dataItemName Does not change cursor position.
 DKDDO fetchPrevious()
          Retrieves the previous object in the result set
 java.lang.Object fetchPreviousByName(java.lang.String dataItemName)
          Get a data item contained within the DDO at the previous position in the result.
 boolean fetchPreviousN(int how_many, dkCollection collection)
          Retrieves the previous N objects in the result set
 boolean fetchPreviousNByName(java.lang.String dataItemName, int how_many, java.lang.Object[] array)
          For the previous DDO's in the result, fetch the Value for a data Item named and add it to .
 DKDDO findObject(int position, java.lang.String predicate)
          Retrieves a DDO object from result set at given start location
 int getPosition()
          Gets the current position of the cursor within the result list
 boolean isBegin()
          Checks to see if the cursor at the beginning of the search result set cursor.
 boolean isEnd()
          Checks if the cursor is currently at the end of result
 boolean isInBetween()
          Checks if the cursor at the middle of result list
 boolean isOpen()
          Open indicator
 boolean isScrollable()
          Checks if the search result is scrollable
 boolean isValid()
          Checks to see if the content of this search result set cursor is valid.
 DKDDO newObject()
          Creates a new DDO object.
 java.lang.String objectType()
          Gets the cursor object type
 void open()
          Opens the cursor, and if necessary, execute the query to get the result set.
 void open(DKNVPair[] parms)
          Opens the cursor, and if necessary, execute the query to get the result set.
 void setPosition(int position, java.lang.Object value)
          Sets the value of cursor to the given position value
 void setToNext()
          Sets the cursor to the next position
 void setToPrevious()
          Sets the cursor to the prevoius position
 void updateObject(DKDDO ddo)
          Updates element at the current position in the datastore, using the given DDO.
 
Methods inherited from class com.ibm.mm.sdk.server.dkAbstractResultSetCursor
handle, handle, isUpdatable
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.mm.sdk.common.dkResultSetCursor
handle, handle, isUpdatable
 

Method Detail

isScrollable

public boolean isScrollable()
                     throws DKException,
                            java.lang.Exception
Checks if the search result is scrollable
Overrides:
isScrollable in class dkAbstractResultSetCursor
Returns:
true is scrollable, false otherwise
Throws:
DKDatastoreError - if there is no connection to server.
DKUsageError - if the result set cursor is invalid

isValid

public boolean isValid()
                throws DKException,
                       java.lang.Exception
Checks to see if the content of this search result set cursor is valid.
Overrides:
isValid in class dkAbstractResultSetCursor
Returns:
true if content is valid, false otherwise

isOpen

public boolean isOpen()
               throws DKException,
                      java.lang.Exception
Description copied from interface: dkResultSetCursor
Open indicator
Overrides:
isOpen in class dkAbstractResultSetCursor
Following copied from interface: com.ibm.mm.sdk.common.dkResultSetCursor
Returns:
true is cursor is in an opened state

isBegin

public boolean isBegin()
                throws DKException,
                       java.lang.Exception
Checks to see if the cursor at the beginning of the search result set cursor.
Overrides:
isBegin in class dkAbstractResultSetCursor
Returns:
true if the cursor is at the beginning of the result list, false otherwise.
Throws:
DKDatastoreError - if there is no connection to server.
DKUsageError - if the result set cursor is invalid

isEnd

public boolean isEnd()
              throws DKException,
                     java.lang.Exception
Checks if the cursor is currently at the end of result
Overrides:
isEnd in class dkAbstractResultSetCursor
Returns:
true if the cursor is at the end, false otherwise
Throws:
DKDatastoreError - if there is no connection to server.
DKUsageError - if the result set cursor is invalid

isInBetween

public boolean isInBetween()
                    throws DKException,
                           java.lang.Exception
Checks if the cursor at the middle of result list
Overrides:
isInBetween in class dkAbstractResultSetCursor
Returns:
true if it is at the middle, false otherwise
Throws:
DKDatastoreError - if there is no connection to server.
DKUsageError - if the result set cursor is invalid

getPosition

public int getPosition()
                throws DKException,
                       java.lang.Exception
Gets the current position of the cursor within the result list
Overrides:
getPosition in class dkAbstractResultSetCursor
Returns:
a zero-based position value of the cursor
Throws:
DKDatastoreError - if there is no connection to server.
DKUsageError - if the result set cursor is invalid

setPosition

public void setPosition(int position,
                        java.lang.Object value)
                 throws DKException,
                        java.lang.Exception
Sets the value of cursor to the given position value
Overrides:
setPosition in class dkAbstractResultSetCursor
Parameters:
position - either DK_CM_NEXT or DK_CM_RELATIVE.
value - Integer object represents the relative position from current cursor position.
Throws:
DKDatastoreError - if there is no connection to server.
DKUsageError - if cursor is invalid, new position is invalid, or "value" is not Integer object

setToNext

public void setToNext()
               throws DKException,
                      java.lang.Exception
Sets the cursor to the next position
Overrides:
setToNext in class dkAbstractResultSetCursor
Throws:
DKUsageError - if current cursor position is invalid or the next cursor position is invalid

setToPrevious

public void setToPrevious()
                   throws DKException,
                          java.lang.Exception
Sets the cursor to the prevoius position
Overrides:
setToPrevious in class dkAbstractResultSetCursorScrollable
Throws:
DKUsageError - if current cursor position is invalid or the previous cursor position is invalid

fetchObject

public DKDDO fetchObject()
                  throws DKException,
                         java.lang.Exception
Retrieves an object at the current position in the result set Does not change cursor position.
Overrides:
fetchObject in class dkAbstractResultSetCursor
Returns:
a DDO
Throws:
DKUsageError - if the result set cursor is invalid

fetchObjectByName

public java.lang.Object fetchObjectByName(java.lang.String dataItemName)
                                   throws DKException,
                                          java.lang.Exception
Retrieves the dataItem value from current DDO with the given dataItemName Does not change cursor position.
Overrides:
fetchObjectByName in class dkAbstractResultSetCursor
Returns:
value of the dataItem
Throws:
DKUsageError - if the result set cursor is invalid

fetchNext

public DKDDO fetchNext()
                throws DKException,
                       java.lang.Exception
Retrieves the next object in the result set
Overrides:
fetchNext in class dkAbstractResultSetCursor
Returns:
a next DDO object
Throws:
DKUsageError - if the result set cursor is invalid

fetchPrevious

public DKDDO fetchPrevious()
                    throws DKException,
                           java.lang.Exception
Retrieves the previous object in the result set
Overrides:
fetchPrevious in class dkAbstractResultSetCursorScrollable
Returns:
a next DDO object
Throws:
DKUsageError - if the result set cursor is invalid

fetchNextN

public boolean fetchNextN(int how_many,
                          dkCollection collection)
                   throws DKException,
                          java.lang.Exception
Retrieves the next N objects in the result set
Overrides:
fetchNextN in class dkAbstractResultSetCursor
Parameters:
how_many - number of next objects to retrieve; 0 means all the rest
collection - a container to receive these N objects
Returns:
true if there are objects in the given collection
Throws:
DKUsageError - if the result set cursor is invalid

fetchPreviousN

public boolean fetchPreviousN(int how_many,
                              dkCollection collection)
                       throws DKException,
                              java.lang.Exception
Retrieves the previous N objects in the result set
Overrides:
fetchPreviousN in class dkAbstractResultSetCursorScrollable
Parameters:
how_many - number of previous objects to retrieve; 0 means all the rest
collection - a container to receive these N objects
Returns:
true if there are objects in the given collection
Throws:
DKUsageError - if the result set cursor is invalid

fetchNextByName

public java.lang.Object fetchNextByName(java.lang.String dataItemName)
                                 throws DKException,
                                        java.lang.Exception
Get a data item contained within the DDO at the next position in the result.

The cursor is moved to the next object in the result and the data item is retrieved.

Overrides:
fetchNextByName in class dkAbstractResultSetCursor
Parameters:
dataItemName - data item name
Returns:
Object is the value of the named data item. The object type depends on the data type of the item (String, number, date, etc.)
Throws:
DKException - Trying to go past the end of the result will cause an excpetion to be thrown, or trying to call this method when the result is not valid will cause an exception to be thrown.

fetchPreviousByName

public java.lang.Object fetchPreviousByName(java.lang.String dataItemName)
                                     throws DKException,
                                            java.lang.Exception
Get a data item contained within the DDO at the previous position in the result.

The cursor is moved to the previous object in the result and the data item is retrieved.

Overrides:
fetchPreviousByName in class dkAbstractResultSetCursorScrollable
Parameters:
dataItemName - data item name
Returns:
Object is the value of the named data item. The object type depends on the data type of the item (String, number, date, etc.)
Throws:
DKException - Trying to go past the end of the result will cause an excpetion to be thrown, or trying to call this method when the result is not valid will cause an exception to be thrown.

fetchNextNByName

public boolean fetchNextNByName(java.lang.String dataItemName,
                                int how_many,
                                java.lang.Object[] array)
                         throws DKException,
                                java.lang.Exception
For the next DDO's in the result, fetch the Value for a data Item named and add it to .
Overrides:
fetchNextNByName in class dkAbstractResultSetCursor
Parameters:
dataItemName - data item name
how_many - how many data item values the user wants to be returned in the collection.
array - the array where the data item values that are fetched are stored.
Returns:
true if there is at least one data item value returned.

fetchPreviousNByName

public boolean fetchPreviousNByName(java.lang.String dataItemName,
                                    int how_many,
                                    java.lang.Object[] array)
                             throws DKException,
                                    java.lang.Exception
For the previous DDO's in the result, fetch the Value for a data Item named and add it to .
Overrides:
fetchPreviousNByName in class dkAbstractResultSetCursorScrollable
Parameters:
dataItemName - data item name
how_many - how many data item values the user wants to be returned in the collection.
array - the array where the data item values that are fetched are stored.
Returns:
true if there is at least one data item value returned.

fetchFirst

public DKDDO fetchFirst()
                 throws DKException,
                        java.lang.Exception
fetchFirst will fetch the first DDO item in the cursor
Overrides:
fetchFirst in class dkAbstractResultSetCursorScrollable

fetchLast

public DKDDO fetchLast()
                throws DKException,
                       java.lang.Exception
Retrieves the last object in the result set
Overrides:
fetchLast in class dkAbstractResultSetCursorScrollable
Returns:
a next DDO object
Throws:
DKUsageError - if the result set cursor is invalid

findObject

public DKDDO findObject(int position,
                        java.lang.String predicate)
                 throws DKException,
                        java.lang.Exception
Retrieves a DDO object from result set at given start location
Overrides:
findObject in class dkAbstractResultSetCursor
Parameters:
position - start location where to retrieve the DDO object from
predicate - search condition
Returns:
a DDO object
Throws:
DKDatastoreError - if there is no connection to server
DKUsageError - if the result is not valid, "predicate" condition or postion is not valid.

deleteObject

public void deleteObject()
                  throws DKException
Deletes a DDO object at current position from result set from server.
Overrides:
deleteObject in class dkAbstractResultSetCursor
Throws:
DKDatastoreError - if there is no connection to server
DKUsageError - if one of the following conditions occurred:
  • result set is invalid
  • result set is not updatable
  • DDO object at the current position is null

updateObject

public void updateObject(DKDDO ddo)
                  throws DKException
Updates element at the current position in the datastore, using the given DDO. The type of cursor element must match with the type of DDO. Only the annotation and views of this document is updated, document data will not be updated since since function is not support by server.
Overrides:
updateObject in class dkAbstractResultSetCursor
Parameters:
ddo - a new data object to use to update the current cursor object from server.
Throws:
DKDatastoreError - if there is no connection to server.
DKUsageError - if cursor is invalid, or is not updatable, or the given "ddo" is null.

newObject

public DKDDO newObject()
                throws DKException
Creates a new DDO object.
Overrides:
newObject in class dkAbstractResultSetCursor
Returns:
an DDO object
Throws:
DKDatastoreError - if there is no connection to server.

addObject

public void addObject(DKDDO newDDO)
               throws DKException
Adds a new element of the same type, represented by the given DDO, to the datastore.
Overrides:
addObject in class dkAbstractResultSetCursor
Parameters:
newDDO - a new data object to add to server.
Throws:
DKDatastoreError - if there is no connection to server.
DKUsageError - if cursor is invalid, or is not updatable, or the given "newDDO" is null.

open

public void open()
          throws DKException,
                 java.lang.Exception
Opens the cursor, and if necessary, execute the query to get the result set. Open resets the position to the beginning. This method should only be called when query string is set.
Overrides:
open in class dkAbstractResultSetCursor
Throws:
DKUsageError - if the cursor is already opened or the query string is invalid.
DKDatastoreError - if there is no connection to the server
DKDatastoreAccessError - if error occurs inside datastore

open

public void open(DKNVPair[] parms)
          throws DKException,
                 java.lang.Exception
Opens the cursor, and if necessary, execute the query to get the result set. Open reset the position to the beginning.
Overrides:
open in class dkAbstractResultSetCursor
Parameters:
parms - name/value pairs options
Throws:
DKDatastoreError - if there is no connection to server.
DKUsageError - if the result set cursor is invalid

datastoreName

public java.lang.String datastoreName()
                               throws DKException,
                                      java.lang.Exception
Description copied from interface: dkResultSetCursor
Gets the datastore name
Overrides:
datastoreName in class dkAbstractResultSetCursor
Following copied from interface: com.ibm.mm.sdk.common.dkResultSetCursor
Returns:
datastore name

datastoreType

public java.lang.String datastoreType()
                               throws DKException,
                                      java.lang.Exception
Description copied from interface: dkResultSetCursor
Gets the datastore type
Overrides:
datastoreType in class dkAbstractResultSetCursor
Following copied from interface: com.ibm.mm.sdk.common.dkResultSetCursor
Returns:
datastore type

objectType

public java.lang.String objectType()
                            throws java.lang.Exception
Description copied from interface: dkResultSetCursor
Gets the cursor object type
Overrides:
objectType in class dkAbstractResultSetCursor
Following copied from interface: com.ibm.mm.sdk.common.dkResultSetCursor
Returns:
cursor object type

cardinality

public int cardinality()
                throws java.lang.Exception
Description copied from interface: dkResultSetCursor
Gets the number of query results if supported. This number may be an approximation for some back end datastores.

Note:DKUsageError exception thrown if method is not implemented

Overrides:
cardinality in class dkAbstractResultSetCursor
Following copied from interface: com.ibm.mm.sdk.common.dkResultSetCursor
Returns:
number of query results. May be approximation.

close

public void close()
           throws DKException,
                  java.lang.Exception
Closes the cursor, and invalidates the result set.
Overrides:
close in class dkAbstractResultSetCursor

destroy

public void destroy()
             throws DKException,
                    java.lang.Exception
Destroys the resultSetCursor. This method will do all neccessary cleanup before the resultSetCursor is deleted.
Overrides:
destroy in class dkAbstractResultSetCursor
Throws:
DKDatastoreError - if there is no connection to server

EIP Java APIs

(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.