com.ibm.db.beans
Class DBEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.ibm.db.beans.DBEvent
All Implemented Interfaces:
java.io.Serializable

public class DBEvent
extends java.util.EventObject

All of the methods in the DBBeforeListener and DBAfterListener interfaces pass a DBEvent as a parameter. Methods in this class extend the information available from the parent class EventObject with a reason code, a modifier, and a sub-modifier.

See Also:
Serialized Form

Field Summary
static int MODIFIER_NONE
          Constant to be returned by getModifier() or getSubModifier() if value is not applicable.
static int REASON_COLUMN_VALUE
          Constant to be returned by getReason() for rowSetChanged or aboutToChangeRowSet events when a column value is changing in the cache.
static int REASON_DELETE
          Constant to be returned by getReason() for rowChanged or aboutToChangeRow events when a row is being deleted from the database.
static int REASON_DELETE_CACHE_ROW
          Constant to be returned by getReason() for rowSetChanged or aboutToChangeRowSet events when a row is being deleted from the cache.
static int REASON_EXECUTE
          Constant to be returned by getReason() for rowSetChanged or aboutToChangeRowSet events when an SQL statement is being executed.
static int REASON_FETCH_CACHE_ROW
          Constant to be returned by getReason() for rowSetChanged or aboutToChangeRowSet events when one or more rows are being fetched into in the cache.
static int REASON_INSERT
          Constant to be returned by getReason() for rowChanged or aboutToChangeRow events when a row is being inserted in the database.
static int REASON_NEW_CACHE_ROW
          Constant to be returned by getReason() for rowSetChanged or aboutToChangeRowSet events when a new empty row is being added to the cache.
static int REASON_NONE
          Constant to be returned by getReason() if value is not applicable.
static int REASON_UPDATE
          Constant to be returned by getReason() for rowChanged or aboutToChangeRow events when a row is being updated in the database.
 
Constructor Summary
DBEvent(com.ibm.db.beans.DBStatement source)
          Constructs a new DBEvent, without providing a reason code, a modifier, or a sub-modifier.
DBEvent(com.ibm.db.beans.DBStatement source, int reason)
          Constructs a new DBEvent, without providing a modifier or a sub-modifier.
DBEvent(com.ibm.db.beans.DBStatement source, int reason, int modifier)
          Constructs a new DBEvent, without providing a sub-modifier.
DBEvent(com.ibm.db.beans.DBStatement source, int reason, int modifier, int subModifier)
          Constructs a new DBEvent, providing a source, a reason, a modifier, and a sub-modifier.
 
Method Summary
 int getModifier()
          Returns a modifier amplifying on the reason for the event.
 int getReason()
          Returns a code for the reason the event was fired.
 int getSubModifier()
          Returns a sub-modifier amplifying on the reason and modifier for the event.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REASON_NONE

public static final int REASON_NONE
Constant to be returned by getReason() if value is not applicable.

See Also:
Constant Field Values

REASON_DELETE

public static final int REASON_DELETE
Constant to be returned by getReason() for rowChanged or aboutToChangeRow events when a row is being deleted from the database.

See Also:
Constant Field Values

REASON_UPDATE

public static final int REASON_UPDATE
Constant to be returned by getReason() for rowChanged or aboutToChangeRow events when a row is being updated in the database.

See Also:
Constant Field Values

REASON_INSERT

public static final int REASON_INSERT
Constant to be returned by getReason() for rowChanged or aboutToChangeRow events when a row is being inserted in the database.

See Also:
Constant Field Values

REASON_COLUMN_VALUE

public static final int REASON_COLUMN_VALUE
Constant to be returned by getReason() for rowSetChanged or aboutToChangeRowSet events when a column value is changing in the cache.

See Also:
Constant Field Values

REASON_NEW_CACHE_ROW

public static final int REASON_NEW_CACHE_ROW
Constant to be returned by getReason() for rowSetChanged or aboutToChangeRowSet events when a new empty row is being added to the cache.

See Also:
Constant Field Values

REASON_DELETE_CACHE_ROW

public static final int REASON_DELETE_CACHE_ROW
Constant to be returned by getReason() for rowSetChanged or aboutToChangeRowSet events when a row is being deleted from the cache.

See Also:
Constant Field Values

REASON_FETCH_CACHE_ROW

public static final int REASON_FETCH_CACHE_ROW
Constant to be returned by getReason() for rowSetChanged or aboutToChangeRowSet events when one or more rows are being fetched into in the cache.

See Also:
Constant Field Values

REASON_EXECUTE

public static final int REASON_EXECUTE
Constant to be returned by getReason() for rowSetChanged or aboutToChangeRowSet events when an SQL statement is being executed.

See Also:
Constant Field Values

MODIFIER_NONE

public static final int MODIFIER_NONE
Constant to be returned by getModifier() or getSubModifier() if value is not applicable.

See Also:
Constant Field Values
Constructor Detail

DBEvent

public DBEvent(com.ibm.db.beans.DBStatement source)
Constructs a new DBEvent, without providing a reason code, a modifier, or a sub-modifier.

Parameters:
source - the object which fired the event

DBEvent

public DBEvent(com.ibm.db.beans.DBStatement source,
               int reason)
Constructs a new DBEvent, without providing a modifier or a sub-modifier.

Parameters:
source - the object which fired the event
reason - the reason the event was fired
See Also:
REASON_NONE, REASON_DELETE, REASON_UPDATE, REASON_INSERT, REASON_COLUMN_VALUE, REASON_NEW_CACHE_ROW, REASON_DELETE_CACHE_ROW, REASON_FETCH_CACHE_ROW, REASON_EXECUTE

DBEvent

public DBEvent(com.ibm.db.beans.DBStatement source,
               int reason,
               int modifier)
Constructs a new DBEvent, without providing a sub-modifier.

Parameters:
source - the object which fired the event
reason - the reason the event was fired
modifier - a modifier for the reason the event was fired
See Also:
REASON_NONE, REASON_DELETE, REASON_UPDATE, REASON_INSERT, REASON_COLUMN_VALUE, REASON_NEW_CACHE_ROW, REASON_DELETE_CACHE_ROW, REASON_FETCH_CACHE_ROW, REASON_EXECUTE, MODIFIER_NONE

DBEvent

public DBEvent(com.ibm.db.beans.DBStatement source,
               int reason,
               int modifier,
               int subModifier)
Constructs a new DBEvent, providing a source, a reason, a modifier, and a sub-modifier.

Parameters:
source - the object which fired the event
reason - the reason the event was fired
modifier - a modifier for the reason the event was fired
See Also:
REASON_NONE, REASON_DELETE, REASON_UPDATE, REASON_INSERT, REASON_COLUMN_VALUE, REASON_NEW_CACHE_ROW, REASON_DELETE_CACHE_ROW, REASON_FETCH_CACHE_ROW, REASON_EXECUTE, MODIFIER_NONE
Method Detail

getModifier

public int getModifier()
Returns a modifier amplifying on the reason for the event. In most cases, the modifier is the number of a row in the RowSet. The index of the first row is 1.

Returns:
the modifier for the event
See Also:
MODIFIER_NONE

getReason

public int getReason()
Returns a code for the reason the event was fired.

Returns:
the reason for the event
See Also:
REASON_NONE, REASON_DELETE, REASON_UPDATE, REASON_INSERT, REASON_COLUMN_VALUE, REASON_NEW_CACHE_ROW, REASON_DELETE_CACHE_ROW, REASON_FETCH_CACHE_ROW, REASON_EXECUTE

getSubModifier

public int getSubModifier()
Returns a sub-modifier amplifying on the reason and modifier for the event. In most cases, the sub-modifier is the number of a column in a row. The index of the first column is 1.

Returns:
the sub-modifier for the event
See Also:
MODIFIER_NONE