com.sleepycat.je
Interface DatabaseTrigger

All Known Implementing Classes:
ForeignKeyTrigger, SecondaryTrigger

interface DatabaseTrigger

Implemented to receive database update notifications.

The databaseUpdated() method may perform additional database operations using the transaction passed to it, or by starting a new transaction. The transaction passed may not be explicitly committed or aborted.


Method Summary
 void databaseUpdated(Database db, Locker locker, DatabaseEntry priKey, DatabaseEntry oldData, DatabaseEntry newData)
          Notifies the trigger that a put or delete operation has been performed on the database.
 void triggerAdded(Database db)
          Notifies the trigger that it has been added and will start receiving update notifications.
 void triggerRemoved(Database db)
          Notifies the trigger that it has been removed and will stop receiving update notifications.
 

Method Detail

triggerAdded

void triggerAdded(Database db)
Notifies the trigger that it has been added and will start receiving update notifications.

Parameters:
db - the database to which the trigger was added.

triggerRemoved

void triggerRemoved(Database db)
Notifies the trigger that it has been removed and will stop receiving update notifications.

Parameters:
db - the database from which the trigger was removed.

databaseUpdated

void databaseUpdated(Database db,
                     Locker locker,
                     DatabaseEntry priKey,
                     DatabaseEntry oldData,
                     DatabaseEntry newData)
                     throws DatabaseException
Notifies the trigger that a put or delete operation has been performed on the database.

When a new entry is inserted, oldData will be null and newData will be non-null.

When an existing entry is updated, oldData and newData will be non-null.

When an existing entry is deleted, oldData will be non-null and newData will be null.

Parameters:
db - the database that was modified.
locker - the internal locker.
priKey - the primary key, which is never null.
oldData - the primary data before the change, or null if the record did not previously exist.
newData - the primary data after the change, or null if the record has been deleted.
Throws:
DatabaseException


Copyright 2004-2005 Sleepycat, Inc. All Rights Reserved.