/* * ---------------------------------------------------------------------------- * 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: * * * * * * * * * * * * * @param lsn When the flag * parameter is set to Db.DB_CURRENT, Db.DB_FIRST, * Db.DB_LAST, Db.DB_NEXT or Db.DB_PREV, the lsn * parameter is overwritten with the {@link * com.sleepycat.db.DbLsn DbLsn} value of the record * retrieved. When flag is set to Db.DB_SET, the * lsn parameter is the {@link com.sleepycat.db.DbLsn * DbLsn} value of the record to be retrieved. * @throws IllegalArgumentException The DbLogc.get method will * fail and throw a IllegalArgumentException exception if the * Db.DB_CURRENT flag was set and the log cursor has not yet * been initialized; the Db.DB_CURRENT, Db.DB_NEXT, or * Db.DB_PREV flags were set and the log was opened with the * DB_THREAD flag set; the Db.DB_SET flag was set and the * specified log sequence number does not appear in the log; * or if an invalid flag value or parameter was specified. * @return Unless otherwise specified, * the DbLogc.get method throws an exception that * encapsulates a non-zero error value on failure.

* *

* *

* *

* *

*/ public int get(DbLsn lsn, Dbt data, int flags) throws DbException { return db_javaJNI.DbLogc_get(swigCPtr, DbLsn.getCPtr(lsn), data, flags); } }