00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 package com.sleepycat.db;
00011
00012 import com.sleepycat.db.internal.DbConstants;
00013 import com.sleepycat.db.internal.DbLogc;
00014
00015 public class LogCursor {
00016 protected DbLogc logc;
00017
00018 protected LogCursor(final DbLogc logc) {
00019 this.logc = logc;
00020 }
00021
00022
00023 static LogCursor wrap(DbLogc logc) {
00024 return (logc == null) ? null : new LogCursor(logc);
00025 }
00026
00027 public synchronized void close()
00028 throws DatabaseException {
00029
00030 logc.close(0);
00031 }
00032
00033 public OperationStatus getCurrent(final LogSequenceNumber lsn,
00034 final DatabaseEntry data)
00035 throws DatabaseException {
00036
00037 return OperationStatus.fromInt(
00038 logc.get(lsn, data, DbConstants.DB_CURRENT));
00039 }
00040
00041 public OperationStatus getNext(final LogSequenceNumber lsn,
00042 final DatabaseEntry data)
00043 throws DatabaseException {
00044
00045 return OperationStatus.fromInt(
00046 logc.get(lsn, data, DbConstants.DB_NEXT));
00047 }
00048
00049 public OperationStatus getFirst(final LogSequenceNumber lsn,
00050 final DatabaseEntry data)
00051 throws DatabaseException {
00052
00053 return OperationStatus.fromInt(
00054 logc.get(lsn, data, DbConstants.DB_FIRST));
00055 }
00056
00057 public OperationStatus getLast(final LogSequenceNumber lsn,
00058 final DatabaseEntry data)
00059 throws DatabaseException {
00060
00061 return OperationStatus.fromInt(
00062 logc.get(lsn, data, DbConstants.DB_LAST));
00063 }
00064
00065 public OperationStatus getPrev(final LogSequenceNumber lsn,
00066 final DatabaseEntry data)
00067 throws DatabaseException {
00068
00069 return OperationStatus.fromInt(
00070 logc.get(lsn, data, DbConstants.DB_PREV));
00071 }
00072
00073 public OperationStatus set(final LogSequenceNumber lsn,
00074 final DatabaseEntry data)
00075 throws DatabaseException {
00076
00077 return OperationStatus.fromInt(
00078 logc.get(lsn, data, DbConstants.DB_SET));
00079 }
00080 }