com.sleepycat.je.dbi
Class TriggerManager

java.lang.Object
  extended by com.sleepycat.je.dbi.TriggerManager

public class TriggerManager
extends Object

Class that invokes the triggers associated with a database. It encapsulates the mechanics associated with actually invoking a trigger.


Nested Class Summary
static class TriggerManager.MapOver<R,E>
          Lisp inspired Map function.
 
Constructor Summary
TriggerManager()
           
 
Method Summary
static void invokeAddRemoveTriggers(Locker locker, List<Trigger> oldTriggers, List<Trigger> newTriggers)
          Invoke the triggers associated with the addition or removal of the trigger itself.
static void runAbortTriggers(Txn txn)
          Invokes the trigger methods associated with the abort of a transaction.
static void runCloseTriggers(Locker locker, DatabaseImpl dbImpl)
          Invokes the trigger methods associated with the closing of a database.
static void runCommitTriggers(Txn txn)
          Invokes the trigger methods associated with the commit of a transaction.
static void runDeleteTriggers(Locker locker, DatabaseImpl dbImpl, DatabaseEntry key, DatabaseEntry oldData)
          Invokes the trigger methods associated with a delete operation.
static void runOpenTriggers(Locker locker, Database db, boolean isNew)
          Invokes the trigger methods associated with the opening of a database.
static void runOpenTriggers(Locker locker, DatabaseImpl dbImpl, boolean isNew)
          Invokes the trigger methods associated with the opening of a database.
static void runPutTriggers(Locker locker, DatabaseImpl dbImpl, DatabaseEntry key, DatabaseEntry oldData, DatabaseEntry newData)
          Invokes the trigger methods associated with a put operation.
static void runRemoveTriggers(Locker locker, DatabaseImpl dbImpl)
          Invokes the trigger methods associated with the removal of a database.
static void runRenameTriggers(Locker locker, DatabaseImpl dbImpl, String newName)
          Invokes the trigger methods associated with the renaming of a database.
static void runTruncateTriggers(Locker locker, DatabaseImpl newDb)
          Invokes the trigger methods associated with the truncation of a database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TriggerManager

public TriggerManager()
Method Detail

runOpenTriggers

public static void runOpenTriggers(Locker locker,
                                   Database db,
                                   boolean isNew)
Invokes the trigger methods associated with the opening of a database.


runOpenTriggers

public static void runOpenTriggers(Locker locker,
                                   DatabaseImpl dbImpl,
                                   boolean isNew)
Invokes the trigger methods associated with the opening of a database.


runCloseTriggers

public static void runCloseTriggers(Locker locker,
                                    DatabaseImpl dbImpl)
Invokes the trigger methods associated with the closing of a database. Note that this also results in the invocation of removeTrigger methods, for transient triggers.


runRemoveTriggers

public static void runRemoveTriggers(Locker locker,
                                     DatabaseImpl dbImpl)
Invokes the trigger methods associated with the removal of a database. Note that this also results in the invocation of removeTrigger methods.


runTruncateTriggers

public static void runTruncateTriggers(Locker locker,
                                       DatabaseImpl newDb)
Invokes the trigger methods associated with the truncation of a database.


runRenameTriggers

public static void runRenameTriggers(Locker locker,
                                     DatabaseImpl dbImpl,
                                     String newName)
Invokes the trigger methods associated with the renaming of a database.


runCommitTriggers

public static void runCommitTriggers(Txn txn)
Invokes the trigger methods associated with the commit of a transaction. Trigger methods are only invoked if the txn was associated with a trigger invocation.


runAbortTriggers

public static void runAbortTriggers(Txn txn)
Invokes the trigger methods associated with the abort of a transaction. Trigger methods are only invoked if the txn was associated with a trigger invocation.


runPutTriggers

public static void runPutTriggers(Locker locker,
                                  DatabaseImpl dbImpl,
                                  DatabaseEntry key,
                                  DatabaseEntry oldData,
                                  DatabaseEntry newData)
Invokes the trigger methods associated with a put operation.


runDeleteTriggers

public static void runDeleteTriggers(Locker locker,
                                     DatabaseImpl dbImpl,
                                     DatabaseEntry key,
                                     DatabaseEntry oldData)
Invokes the trigger methods associated with a delete operation.


invokeAddRemoveTriggers

public static void invokeAddRemoveTriggers(Locker locker,
                                           List<Trigger> oldTriggers,
                                           List<Trigger> newTriggers)
Invoke the triggers associated with the addition or removal of the trigger itself. They are typically invoked upon database open, or database removal.

Parameters:
locker - the locker associated with the trigger update operation
oldTriggers - the current list of triggers
newTriggers - the new list of triggers


Copyright (c) 2004-2012 Oracle. All rights reserved.