filenet.vw.api

Class VWRosterQuery

  • java.lang.Object
    • filenet.vw.api.VWRosterQuery
    • Method Detail

      • fetchRosterElements

        public VWRosterElement[] fetchRosterElements(int bufferSize)
                                              throws VWException
        Deprecated. Replaced by VWRosterQuery.next()
        Fetches a specified number of roster elements. Call the method repeatedly to retrieve the needed number of roster elements for the query. If the number of requested elements (specified in the bufferSize parameter) is greater than the number of elements returned in the query, the remaining elements are returned in a single fetch.

        An instance of this class can only return a single item type. Therefore, an error occurs if the next() method has previously been called.

        Parameters:
        bufferSize - A positive integer value specifying the maximum number of elements to return in a fetch operation. The final number of returned elements will be the lesser of this value, the Process Server's size limit, and the total number of roster elements remaining to be fetched.
        Returns:
        An array of VWRosterElement objects that represents the fetched items. If no more elements can be fetched, the method returns null.
        Throws:
        VWException - Various causes. A possible cause may be the creation of the current VWRosterQuery object by the VWRoster.createQuery method.
      • fetchWorkObjects

        public VWWorkObject[] fetchWorkObjects(int bufferSize)
                                        throws VWException
        Deprecated. Replaced by VWRosterQuery.next()
        Fetches a specified number of work objects. Call this method repeatedly to retrieve the needed number of work objects for the query. 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 are returned in a single fetch.

        An instance of this class can return only one type of item. Therefore, an error occurs if the next or fetchRosterElements method has previously been called.

        Parameters:
        bufferSize - An integer value specifying the maximum number of elements to return in a fetch operation. Specify a value greater than 0 (zero). The server imposes a maximum limit; therefore, the number of returned elements might be smaller than the number specified in this parameter - if the number of work objects is large enough.
        Returns:
        An array of VWWorkObject objects that represent the fetched items. If no more elements can be fetched, the method returns null.
        Throws:
        VWException - Thrown if it cannot fetch a specified number of work objects.
      • getRoster

        public VWRoster getRoster()
        Gets a roster that was retrieved by the query initiated by either the VWRoster.createQuery() or VWRoster#startQuery(String, Object[], Object[], int, String, Object[]) methods.
        Returns:
        A VWRoster object that represents the query result for either the VWRoster.createQuery() or VWRoster#startQuery(String, Object[], Object[], int, String, Object[]) methods.
        See Also:
        VWRoster
      • toString

        public java.lang.String toString()
        Gets the name of the roster retrieved in a query.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The name of the roster retrieved as a result of a query.
      • getElementType

        public int getElementType()
        Gets the fetch type for the VWRosterQuery object.
        Returns:
        An integer value associated with the element type to be retrieved.

        Valid fetch type values are as follows:

        • -1: None (VWFetchType.FETCH_TYPE_NONE); this value is returned only if the deprecated method VWRoster.startQuery was used to create this object.
        • 1: work object (VWFetchType.FETCH_TYPE_WORKOBJECT)
        • 4: Roster element (VWFetchType.FETCH_TYPE_ROSTER_ELEMENT)

        See Also:
        VWFetchType.FETCH_TYPE_WORKOBJECT, VWFetchType.FETCH_TYPE_ROSTER_ELEMENT
      • next

        public java.lang.Object next()
                              throws VWException
        Retrieves the subsequent element for this VWRosterQuery instance. Invoke this method repeatedly to retrieve a series of objects that can be cast to the fetch type of this VWRosterQuery object, as specified by the VWRoster.createQuery(String, Object[], Object[], int, String, Object[], int) call that created this VWRosterQuery instance. Returns null when no more objects can be returned.

        Supports distributed transactions

        To use this method, create a VWRosterQuery object with a VWRoster.createQuery(String, Object[], Object[], int, String, Object[], int) call, which specifies a range of objects to be fetched, a SQL filter expression, and the type of object to be fetched. The resulting query object will use a default buffer size of 50 retrieved items.

        After a set of items in the current retrieval buffer is exhausted, additional items will be retrieved from the Process server and buffered. The effective buffer block size is the lesser of the number specified with a preceding VWRoster.setBufferSize(int) call and the number imposed by the Process server limit.

        You can modify retrieval performance by changing the retrieval buffer size. To change the current retrieval buffer size, set it with a VWRoster.setBufferSize(int) call from the same instance of the VWRoster class that created the current VWRosterQuery object. In other words, after you reset the buffer size, you must create a new VWRosterQuery object (which will contain this next() method) with VWRoster.createQuery(String, Object[], Object[], int, String, Object[], int). In the new instance of VWRosterQuery, the next() method will use the new buffer size.
        Note
        This method requires a buffer size greater than 1 to operate properly.

        Returns:
        An object that represents an item of the fetch type specified in the VWRoster.createQuery(String, Object[], Object[], int, String, Object[], int) method that created the current VWRosterQuery object, or null (indicating there are no more objects in the series).
        Note
        The returned object should be cast to the fetch type specified by the creating VWRoster.createQuery(String, Object[], Object[], int, String, Object[], int) call.
        Throws:
        VWException - Various causes. A possible cause may be using the deprecated VWRoster.startQuery(String, Object[], Object[], int, String, Object[]) method to create the current VWRosterQuery instance, instead of a VWRoster.createQuery(String, Object[], Object[], int, String, Object[], int) call.
        See Also:
        VWRosterQuery.hasNext()
      • resetFetch

        public void resetFetch()
        Resets the last element fetched for this RosterQuery object. Previously fetched elements will be included in the new fetch results.
        Since:
        VWWS3.10
      • fetchCount

        public int fetchCount()
                       throws VWException
        Returns the number of records that can be retrieved for the current VWRosterQuery object.
        Returns:
        The number of records that could be retrieved in the roster for the current VWRosterQuery object.
        Note
        The record set may change before the query returns, so the result should be treated as approximate.
        Throws:
        VWException - Various causes. A possible cause may be an unsupported fetch type.
        Since:
        VWWS3.10
      • getBufferSize

        public int getBufferSize()
        Gets the maximum number of elements set by the user to return in a fetch. The default value is 50.
        Returns:
        An integer value indicating the maximum number of elements to return in a fetch.
        Since:
        VWWS4.0
      • setBufferSize

        public void setBufferSize(int newSize)
                           throws VWException
        Sets the maximum number of elements to return in a fetch (defaults to 50). The server imposes a maximum limit of 100. The number returned may be smaller if the items are very large.
        Parameters:
        newSize - This must be greater than zero.
        Throws:
        VWException - Thrown if buffer size is less than or equal to 0 (zero).
      • getLastRecord

        public java.lang.String getLastRecord()
        Gets the last record in the query results.
        Returns:
        A base64-encoded String containing the last record of the query results. Null is returned if no last record.
        Since:
        CPE 5.2.0.3
      • setLastRecord

        public void setLastRecord(java.lang.String lastWorkRecStr)
        Set the last record in the query result
        Parameters:
        lastWorkRecStr - A base64-encoded String containing the last record of the query results. If this value is null, the query starts from the beginning.
        Since:
        CPE 5.2.0.3

© Copyright IBM Corporation 2002, 2019. All rights reserved.