dbXML API

com.dbxml.db.common.scripting
Class ScriptTrigger

java.lang.Object
  extended bycom.dbxml.util.SimpleConfigurable
      extended bycom.dbxml.db.core.trigger.SimpleTrigger
          extended bycom.dbxml.db.common.scripting.ScriptTrigger
All Implemented Interfaces:
Configurable, Trigger
Direct Known Subclasses:
JavaScriptTrigger, PythonTrigger

public abstract class ScriptTrigger
extends SimpleTrigger

ScriptTrigger is the base class for all script-interpreted Triggers.


Constructor Summary
ScriptTrigger()
           
 
Method Summary
 void afterDelete(Transaction tx, Key key, java.lang.Object oldObj)
          afterDelete is fired after a Object is deleted from the Collection.
 void afterGet(Transaction tx, Key key, java.lang.Object obj)
          afterGet is fired after a Object is retrieved from the Collection, but before it is actually returned.
 void afterInsert(Transaction tx, Key key, java.lang.Object newObj)
          afterInsert is fired after a new Object is inserted into the Collection.
 void afterUpdate(Transaction tx, Key key, java.lang.Object oldObj, java.lang.Object newObj)
          afterUpdate is fired after a Object is updated in the Collection.
 void beforeDelete(Transaction tx, Key key, java.lang.Object oldObj)
          beforeDelete is fired before a Object is deleted from the Collection.
 void beforeGet(Transaction tx, Key key)
          beforeGet is fired before a Object is retrieved from the Collection.
 java.lang.Object beforeInsert(Transaction tx, Key key, java.lang.Object newObj)
          beforeInsert is fired before a new Object is inserted into the Collection.
 java.lang.Object beforeUpdate(Transaction tx, Key key, java.lang.Object oldObj, java.lang.Object newObj)
          beforeUpdate is fired before a Object is updated in the Collection.
 void setConfig(Configuration config)
          setConfig sets the configuration information for the Configurable object instance.
 
Methods inherited from class com.dbxml.db.core.trigger.SimpleTrigger
getCollection, getName, setCollection
 
Methods inherited from class com.dbxml.util.SimpleConfigurable
getConfig
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.dbxml.util.Configurable
getConfig
 

Constructor Detail

ScriptTrigger

public ScriptTrigger()
Method Detail

setConfig

public void setConfig(Configuration config)
               throws dbXMLException
Description copied from interface: Configurable
setConfig sets the configuration information for the Configurable object instance.

Specified by:
setConfig in interface Configurable
Overrides:
setConfig in class SimpleTrigger
Throws:
dbXMLException

beforeInsert

public java.lang.Object beforeInsert(Transaction tx,
                                     Key key,
                                     java.lang.Object newObj)
                              throws DBException
Description copied from interface: Trigger
beforeInsert is fired before a new Object is inserted into the Collection. Throw a CancelOperationException to cancel the Object insertion.

Specified by:
beforeInsert in interface Trigger
Overrides:
beforeInsert in class SimpleTrigger
Throws:
DBException

afterInsert

public void afterInsert(Transaction tx,
                        Key key,
                        java.lang.Object newObj)
                 throws DBException
Description copied from interface: Trigger
afterInsert is fired after a new Object is inserted into the Collection.

Specified by:
afterInsert in interface Trigger
Overrides:
afterInsert in class SimpleTrigger
Throws:
DBException

beforeUpdate

public java.lang.Object beforeUpdate(Transaction tx,
                                     Key key,
                                     java.lang.Object oldObj,
                                     java.lang.Object newObj)
                              throws DBException
Description copied from interface: Trigger
beforeUpdate is fired before a Object is updated in the Collection. Throw a CancelOperationException to cancel the Object update.

Specified by:
beforeUpdate in interface Trigger
Overrides:
beforeUpdate in class SimpleTrigger
Throws:
DBException

afterUpdate

public void afterUpdate(Transaction tx,
                        Key key,
                        java.lang.Object oldObj,
                        java.lang.Object newObj)
                 throws DBException
Description copied from interface: Trigger
afterUpdate is fired after a Object is updated in the Collection.

Specified by:
afterUpdate in interface Trigger
Overrides:
afterUpdate in class SimpleTrigger
Throws:
DBException

beforeDelete

public void beforeDelete(Transaction tx,
                         Key key,
                         java.lang.Object oldObj)
                  throws DBException
Description copied from interface: Trigger
beforeDelete is fired before a Object is deleted from the Collection. Throw a CancelOperationException to cancel the delete operation.

Specified by:
beforeDelete in interface Trigger
Overrides:
beforeDelete in class SimpleTrigger
Throws:
DBException

afterDelete

public void afterDelete(Transaction tx,
                        Key key,
                        java.lang.Object oldObj)
                 throws DBException
Description copied from interface: Trigger
afterDelete is fired after a Object is deleted from the Collection.

Specified by:
afterDelete in interface Trigger
Overrides:
afterDelete in class SimpleTrigger
Throws:
DBException

beforeGet

public void beforeGet(Transaction tx,
                      Key key)
               throws DBException
Description copied from interface: Trigger
beforeGet is fired before a Object is retrieved from the Collection. At this point, the Object hasn't even been loaded, so there is no reference to the actual Object Node.

Specified by:
beforeGet in interface Trigger
Overrides:
beforeGet in class SimpleTrigger
Throws:
DBException

afterGet

public void afterGet(Transaction tx,
                     Key key,
                     java.lang.Object obj)
              throws DBException
Description copied from interface: Trigger
afterGet is fired after a Object is retrieved from the Collection, but before it is actually returned.

Specified by:
afterGet in interface Trigger
Overrides:
afterGet in class SimpleTrigger
Throws:
DBException

dbXML API

Copyright (c) 2004 The dbXML Group