/* * ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version: 1.3.19 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.sleepycat.db; /** * The DbLogc object is the handle for a cursor into the log files, * supporting sequential access to the records stored in log files. * The handle is not free-threaded. Once the {@link * com.sleepycat.db.DbLogc#close DbLogc.close} method is called, the * handle may not be accessed again, regardless of that method's * return.
*/ public class DbLogc { private long swigCPtr; protected boolean swigCMemOwn; protected DbLogc(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } protected DbLogc() { this(0, false); } protected void delete() { if (swigCPtr != 0 && swigCMemOwn) { swigCMemOwn = false; } swigCPtr = 0; } protected static long getCPtr(DbLogc obj) { return (obj == null) ? 0 : obj.swigCPtr; } /** * The DbLogc.close method discards the log cursor. After * DbLogc.close has been called, regardless of its return, the * cursor handle may not be used again. * * @param flags currently unused, and must * be set to 0. * @throws IllegalArgumentException The DbLogc.close method will * fail and throw a IllegalArgumentException exception if the * cursor was previously closed; or if an invalid flag value * or parameter was specified. */ public synchronized void close(int flags) throws DbException { try { close0(flags); } finally { swigCPtr = 0; } } void close0(int flags) { db_javaJNI.DbLogc_close0(swigCPtr, flags); } /** * The DbLogc.get method returns records from the log. * * @param data The data field of the * data structure is set to the record retrieved, and the * size field indicates the number of bytes in the record. * See {@link com.sleepycat.db.Dbt Dbt} for a description of * other fields in the data structure. The {@link * com.sleepycat.db.Db#DB_DBT_MALLOC Db.DB_DBT_MALLOC}, * {@link com.sleepycat.db.Db#DB_DBT_REALLOC * Db.DB_DBT_REALLOC} and {@link * com.sleepycat.db.Db#DB_DBT_USERMEM Db.DB_DBT_USERMEM} * flags may be specified for any {@link com.sleepycat.db.Dbt * Dbt} used for data retrieval. * @param flags must be set to one of the * following values: ** * Return the log record to which the log currently refers. *
* * The first record from any of the log files found in the * log directory is returned in the data parameter. * overwritten with the {@link com.sleepycat.db.DbLsn * DbLsn} of the record returned.
* * The last record in the log is returned in the data * parameter. overwritten with the {@link * com.sleepycat.db.DbLsn DbLsn} of the record returned. *
* * The current log position is advanced to the next record * in the log, and that record is returned in the data * parameter. overwritten with the {@link * com.sleepycat.db.DbLsn DbLsn} of the record returned. *
* * If the cursor has not been initialized via DB_FIRST, * DB_LAST, DB_SET, DB_NEXT, or DB_PREV, DbLogc.get will * return the first record in the log.
* * The current log position is advanced to the previous * record in the log, and that record is returned in the * data parameter. overwritten with the {@link * com.sleepycat.db.DbLsn DbLsn} of the record returned. *
* * If the cursor has not been initialized via DB_FIRST, * DB_LAST, DB_SET, DB_NEXT, or DB_PREV, DbLogc.get will * return the last record in the log.
* * Retrieve the record specified by the lsn * parameter.
*
* The DbLogc.get method will return
* Db.DB_NOTFOUND if Db.DB_FIRST
* is set and the log is empty.
*
* The DbLogc.get method will return
* Db.DB_NOTFOUND if Db.DB_LAST
* is set and the log is empty.
*
* The DbLogc.get method will return
* Db.DB_NOTFOUND if Db.DB_NEXT
* is set and the last log record has already been returned
* or the log is empty.
*
* The DbLogc.get method will return
* Db.DB_NOTFOUND if Db.DB_PREV
* is set and the first log record has already been
* returned or the log is empty.