Class VWLogQuery
- java.lang.Object
-
- filenet.vw.api.VWLogQuery
-
public final class VWLogQuery extends java.lang.ObjectUse this class to query for log elements.The class implements the next() and hasNext() methods to iteratively search, similar to the Java 2 collection model. The query ends when either method returns a null value.
Supports distributed transactions
- Since:
- VWWS3.10
- See Also:
VWLog,VWLogElement
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intfetchCount()Gets the integer value indicating the number of records that can be retrieved, using this logQuery definition.java.lang.StringgetLastRecord()Gets the last record in the query results.VWLoggetLog()Gets the log retrieved by the VWLog.startQuery() method.booleanhasNext()Determines whether or not more elements exist beyond the current element.VWLogElementnext()Gets the next log element in the collection (if one exists).voidresetFetch()Resets the last element fetched for the log query object.voidsetLastRecord(java.lang.String lastWorkRecStr)Set the last record in the query resultjava.lang.StringtoString()Gets the string version of the name of the log the query retrieved.
-
-
-
Method Detail
-
next
public VWLogElement next() throws VWException
Gets the next log element in the collection (if one exists).Supports distributed transactions
Call the method repeatedly, once for each log element you require from the query. When there are no more log elements available, the method returns null.
The system retrieves elements from the database in blocks of the size you specify in VWLog.setBufferSize() method. Items return one-by-one to the user via this method. If the application requests more items, this API queries the server for the next block of data. An element returns as long as there is an object in the database that matches the specified query conditions.
Respecify buffer size with VWLog and create a new VWLogQuery object to optimize performance during retrieval from the server.
- Returns:
- A VWLogElement object, specified by the startQuery method of VWLog. If there are no more log elements after the last one fetched, the method returns null.
- Throws:
VWException- The method throws an exception if it cannot get the next existing log element in the collection.
-
getLog
public VWLog getLog()
Gets the log retrieved by the VWLog.startQuery() method.- Returns:
- A VWLog object.
-
toString
public java.lang.String toString()
Gets the string version of the name of the log the query retrieved. If log is the system log, this method does not return a name.- Overrides:
toStringin classjava.lang.Object- Returns:
- String that is the name of the log
-
resetFetch
public void resetFetch()
Resets the last element fetched for the log query object. The new fetch results include previously fetched elements.- Since:
- VWWS3.10
-
hasNext
public boolean hasNext() throws VWExceptionDetermines whether or not more elements exist beyond the current element. The fetch buffer size must be greater than 1 (one).- Returns:
- A Boolean value. The method returns true if there are more log elements. If no more elements exist beyond the current element, the method returns false.
- Throws:
VWException
-
fetchCount
public int fetchCount() throws VWExceptionGets the integer value indicating the number of records that can be retrieved, using this logQuery 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 log, using this logQuery object.
- Throws:
VWException- The method throws an exception if it cannot get the integer value indicating the number of records that can be retrieved, using this logQuery definition. One cause of this is an incorrect query parameter.- Since:
- CPE 5.2.0.3
-
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.
-
-