/* * - * See the file LICENSE for redistribution information. * * Copyright (c) 2001-2003 * Sleepycat Software. All rights reserved. * * $Id: DbRepTransport.java,v 11.25 2003/11/28 18:35:46 bostic Exp $ */ package com.sleepycat.db; /** * An interface specifying a replication transmit function, which * sends information to other members of the replication group.

*/ public interface DbRepTransport { /** * The DbRepTransport interface is used by the * DbEnv.setReplicationTransport method. This interface defines * the application-specific function to be called during * transaction abort and recovery.

It may sometimes be useful * to pass application-specific data to the send function; * see Environment FAQ * for a discussion on how to do this.

* * @param dbenv the enclosing database environment * handle. * @param control the first of the two data elements to be * transmitted by the send function. * @param rec the second of the two data elements to be * transmitted by the send function. * @param lsn If the type of message to be sent has an * LSN associated with it, then the lsn parameter * contains the LSN of the record being sent. This LSN can be * used to determine that certain records have been processed * successfully by clients. * @param envid a positive integer identifier that * specifies the replication environment to which the message * should be sent (see * Replication environment IDs for more information). * * * * @param flags must be set to 0 or by bitwise * inclusively OR 'ing together one or more of the * following values: * * * * * @throws DbException Signals that an exception of some sort * has occurred. * @return The send function should not call * back down into Berkeley DB. The send function must * return 0 on success and non-zero on failure. If the * send function fails, the message being sent is * necessary to maintain database integrity, and the local * log is not configured for synchronous flushing, the local * log will be flushed; otherwise, any error from the send * function will be ignored.

*/ public int send(DbEnv dbenv, Dbt control, Dbt rec, DbLsn lsn, int flags, int envid) throws DbException; }