Process Class Relationships

filenet.vw.api
Class VWQueueQuery

java.lang.Object
  |
  +--filenet.vw.api.VWQuery
        |
        +--filenet.vw.api.VWQueueQuery

public final class VWQueueQuery
extends filenet.vw.api.VWQuery

Use this class to perform queries for queue elements, work objects, or Instruction elements. An instance of this class returns only one type of item. For example, if a query object's next( ) iterator has fetched work objects, an error occurs when next( ) attempts to fetch a different fetchType of query item.

The query ends when next( ) returns null values.

VWQueueQuery implements Iterator methods next() and hasNext(), emulating the new collection model in Java 2.

See Also:
VWQueue, VWQueueElement, VWWorkObject, VWStepElement

Field Summary
static int QUERY_GET_TRANSLATED_SYSTEM_FIELDS
           
static int QUERY_LOCK_OBJECTS
          Value of 16 Flag used to specify that items returned from a query should become locked.
static int QUERY_MAX_VALUES_INCLUSIVE
          Value of 64 Flag used to specify that maximum values passed in a query are inclusive, i.e.
static int QUERY_MIN_VALUES_INCLUSIVE
          Value of 32 Flag used to specify that minimum values passed in a query are inclusive, i.e.
static int QUERY_READ_BOUND
          Value of 2 Flag used to specify that items returned from a query should include those that are already bound to a user or machine.
static int QUERY_READ_LOCKED
          Value of 1 Flag used to specify that items returned from a query should include those that are already locked.
static int QUERY_READ_UNWRITABLE
          Value of 4 Flag used to specify that items returned from a query should include those that are read-only.
 
Method Summary
 int fetchCount()
          Gets the integer value indicating the number of records that can be retrieved, using this queueQuery definition.
 VWInstructionElement[] fetchInstructionElements(int bufferSize)
          Deprecated. Replaced by next()
 VWQueueElement[] fetchQueueElements(int bufferSize)
          Deprecated. Replaced by next()
 VWWorkObject[] fetchWorkObjects(int bufferSize)
          Deprecated. Replaced by next()
 int getElementType()
          Gets the fetch type of this VWQueueQuery object.
 VWQueue getQueue()
          Gets the queue retrieved by the VWQueue.startQuery() method.
 boolean hasNext()
          Indicates whether the current VWQueueQuery object contains an element that can be returned by an additional invocation of the next( ) iterator.
 boolean isDone()
          Deprecated. Replaced by next()
 java.lang.Object next()
          Retrieves the next queue element.
 void resetFetch()
          Resets the last element fetched for this queue query object.
 java.lang.String toString()
          Retrieves a string version of the current query's queue name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERY_READ_LOCKED

public static final int QUERY_READ_LOCKED
Value of 1 Flag used to specify that items returned from a query should include those that are already locked.
See the queryFlags parameter of VWRoster.startQuery(..), VWQueue.createQuery(..), and VWQueue.startQuery(..)(deprecated)

QUERY_READ_BOUND

public static final int QUERY_READ_BOUND
Value of 2 Flag used to specify that items returned from a query should include those that are already bound to a user or machine.
See the queryFlags parameter of VWRoster.startQuery(..), VWQueue.createQuery(..), and VWQueue.startQuery(..)(deprecated)

QUERY_READ_UNWRITABLE

public static final int QUERY_READ_UNWRITABLE
Value of 4 Flag used to specify that items returned from a query should include those that are read-only.
See the queryFlags parameter of VWRoster.startQuery(..), VWQueue.createQuery(..), and VWQueue.startQuery(..)(deprecated)

QUERY_LOCK_OBJECTS

public static final int QUERY_LOCK_OBJECTS
Value of 16 Flag used to specify that items returned from a query should become locked. See the queryFlags parameter of VWRoster.startQuery(..), VWQueue.createQuery(..), and VWQueue.startQuery(..)(deprecated)

QUERY_MIN_VALUES_INCLUSIVE

public static final int QUERY_MIN_VALUES_INCLUSIVE
Value of 32 Flag used to specify that minimum values passed in a query are inclusive, i.e. the comparison should be "greater than or equal to" rather than "greater than" (which is the default).
See the queryFlags parameter of VWRoster.startQuery(..), VWQueue.createQuery(..), and VWQueue.startQuery(..)(deprecated)

QUERY_MAX_VALUES_INCLUSIVE

public static final int QUERY_MAX_VALUES_INCLUSIVE
Value of 64 Flag used to specify that maximum values passed in a query are inclusive, i.e. the comparison should be "less than or equal to" rather than "less than" (which is the default).
See the queryFlags parameter of VWRoster.startQuery(..), VWQueue.createQuery(..), and VWQueue.startQuery(..)(deprecated)

QUERY_GET_TRANSLATED_SYSTEM_FIELDS

public static final int QUERY_GET_TRANSLATED_SYSTEM_FIELDS
Method Detail

fetchWorkObjects

public VWWorkObject[] fetchWorkObjects(int bufferSize)
                                throws VWException
Deprecated. Replaced by next()

Fetches a specific number of work objects. Call the method once for each work object the query being fetched. If the number of requested elements (specified in the bufferSize parameter) is greater than the number of elements returned in the query, all remaining elements return in a single fetch. An instance of this class returns only one type of item. Therefore, an error occurs if this call follows a call to the deprecated fetchInstructionElements or the fetchQueueElements methods.
Parameters:
bufferSize - An integer value specifying the maximum number of Work Objects to return for each fetch operation. The value must be greater than zero (0). The server imposes a maximum; therefore, the number of returned work objects might be smaller than the number specified here.
Returns:
An array of VWWorkObjects that represents the fetched items. If no more objects are available to fetch, the method returns a null value.
Throws:
VWException - Thrown if it cannot fetch a specific number of work objects.

fetchQueueElements

public VWQueueElement[] fetchQueueElements(int bufferSize)
                                    throws VWException
Deprecated. Replaced by next()

Fetches a specific number of queue elements. Call the method once for each queue element being fetched. If the number of requested elements (specified in the bufferSize parameter) is greater than the number of elements returned in the query, all remaining elements return in a single fetch. An instance of this class returns only one type of item. Therefore, an error occurs if this call follows a call to the deprecated fetchInstructionElements or the fetchWorkObjects methods.
Parameters:
bufferSize - An integer value specifying the maximum number of elements to return for each fetch operation. The value must be greater than zero (0). The server imposes a maximum; therefore, the number of returned elements might be smaller than the number specified in the parameter.
Returns:
An array of VWQueueElements object that represent the fetched items. If no more objects are available to fetch, the method returns a null value.
Throws:
VWException - Thrown if it cannot fetch a specific number of queue elements.

fetchInstructionElements

public VWInstructionElement[] fetchInstructionElements(int bufferSize)
                                                throws VWException
Deprecated. Replaced by next()

Fetches a specific number of Instruction elements. Call the method once for each Instruction element the query being fetched. If the number of requested elements (specified in the bufferSize parameter) is greater than the number of elements returned in the query, all remaining elements return in a single fetch. An instance of this class returns only one type of item. Therefore, an error occurs if this call follows a call to the deprecated fetchQueueElements or the fetchWorkObjects methods.
Parameters:
bufferSize - An integer value specifying the maximum number of elements to return for each fetch operation. The value must be greater than zero (0). The server imposes a maximum; therefore, the number of returned elements might be smaller than the number specified in the parameter.
Returns:
An array of VWInstructionElement objects that represent the fetched items. If no more objects are available to fetch, the method returns a null value.
Throws:
VWException - Thrown if it cannot fetch a specific number of Instruction elements.

getQueue

public VWQueue getQueue()
Gets the queue retrieved by the VWQueue.startQuery() method.
Returns:
A Queue object retrieved by the VWQueue.startQuery() method.
See Also:
VWQueue

isDone

public boolean isDone()
Deprecated. Replaced by next()

Indicates whether the query completed.
Returns:
A Boolean value. The method returns true if no elements to fetch; otherwise, the method returns false, which indicates there are more elements to fetch.

toString

public java.lang.String toString()
Retrieves a string version of the current query's queue name.
Overrides:
toString in class java.lang.Object
Returns:
A string that contains the name of the queue.

resetFetch

public void resetFetch()
Resets the last element fetched for this queue query object. New fetch results include previously fetched elements.
Returns:
Nothing
Since:
VWWS3.10

getElementType

public int getElementType()
Gets the fetch type of this VWQueueQuery object.
Returns:
An integer value indicating the type of the elements.

Fetch types are:

  • -1: VWFetchType.FETCH_TYPE_NONE
  • 1: VWFetchType.FETCH_TYPE_WORKOBJECT
  • 2: VWFetchType.FETCH_TYPE_INSTRUCTION_ELEMENT
  • 3: VWFetchType.FETCH_TYPE_QUEUE_ELEMENT
  • 5: VWFetchType.FETCH_TYPE_STEP_ELEMENT

If VWFetchType.FETCH_TYPE_NONE (-1) returns, the application used the deprecated VWQueue.startQuery() method to create this object.

Since:
VWWS3.10

next

public java.lang.Object next()
                      throws VWException
Retrieves the next queue element. Call the method repeatedly to retrieve the number of elements required by the query. If no more queue elements are available, the method returns null.

The system retrieves elements from the database in the blocks specified in VWQueue.setBufferSize() and returns them sequentially (one-by-one) to the user. The application queries the server for the next block of data as long as objects matching the specified query exist in the database.

Optimize performance on retrieval from the server by respecifying buffer size with VWQueue and create a new VWQueueQuery object. Before using this method, create the VWQueueQuery object with the VWQueue.startQuery() method, which requires type specification. Set the retrieval buffer size in the VWQueue object before creating the VWQueueQuery object.

Returns:
An object that represents the items of the fetch type specified in the VWQueueQuery.startQuery() method (Cast the object to the fetch type specified.) If no more items exist, the method returns null.
Throws:
VWException - The method throws an exception if the application uses the deprecated startQuery() method to create the VWQueueQuery. An instance of this class returns only one type of item, and an exception is thrown when next( ) attempts to fetch a different fetchType of query item.
Since:
VWWS3.10

hasNext

public boolean hasNext()
                throws VWException
Indicates whether the current VWQueueQuery object contains an element that can be returned by an additional invocation of the next( ) iterator.
Returns:
A Boolean value. The method returns true if the queue contains an element that can be returned by an additional invocation of the next( ) iterator; otherwise, the method returns false.
Warning Note: If the buffer size to fetch is one (1), the result is unpredictable.
Throws:
VWException - The method throws an exception if it cannot indicate whether the current VWQueueQuery object contains an element that can be returned by an additional invocation of the next( ) iterator. Exceptions may be caused by incorrect createQuery parameters, network errors, data base errors, or general system errors.

fetchCount

public int fetchCount()
               throws VWException
Gets the integer value indicating the number of records that can be retrieved, using this queueQuery definition. Results are approximate because the record set may change before the query returns.
Returns:
An integer value indicating the number of records that could be retrieved in the queue, using this queueQuery object queue.
Throws:
VWException - Thrown if it cannot get the integer value indicating the number of records that can be retrieved, using this queueQuery object queue. One cause of this is an incorrect query parameter.
Since:
VWWS3.10

Process Class Relationships

Copyright © 2002 FileNET Corporation. All rights reserved.