• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/timemachine/db-4.7.25.NC/java/src/com/sleepycat/db/
1/*-
2 * See the file LICENSE for redistribution information.
3 *
4 * Copyright (c) 2000,2008 Oracle.  All rights reserved.
5 *
6 * $Id: RecordNumberAppender.java,v 12.7 2008/01/17 05:04:53 mjc Exp $
7 */
8package com.sleepycat.db;
9
10/**
11An interface specifying a callback function that modifies stored data
12based on a generated key.
13*/
14public interface RecordNumberAppender {
15    /**
16    A callback function to modify the stored database based on the
17    generated key.
18    <p>
19    When storing records using {@link com.sleepycat.db.Database#append Database.append} it may be
20    useful to modify the stored data based on the generated key.    This function will be called after the record number has been
21    selected, but before the data has been stored.
22    <p>    The callback function may modify the data {@link com.sleepycat.db.DatabaseEntry DatabaseEntry}.    <p>    The callback function must throw a {@link com.sleepycat.db.DatabaseException DatabaseException} object
23    to encapsulate the error on failure.  That object will be thrown to
24    caller of {@link com.sleepycat.db.Database#append Database.append}.
25    <p>
26    @param db
27    The enclosing database handle.
28    <p>    @param data
29    The data to be stored.
30    <p>
31    @param recno
32    The generated record number.
33    */
34    void appendRecordNumber(Database db, DatabaseEntry data, int recno)
35        throws DatabaseException;
36}
37