org.oreodata
Class DataEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--org.oreodata.DataEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Transaction

public class DataEvent
extends java.util.EventObject
implements java.io.Serializable

An event that encapsulates something happening in an OreoDataSource -- the insertion, deletion or updating of a record

Author:
Jonathan Revusky
See Also:
Serialized Form

Field Summary
 Record newRecord
          record being added
 Record oldRecord
          Record being deleted or displaced
static int RECORD_DELETED
          event type for deleting a record
static int RECORD_INSERTED
          event type for inserting a record
static int RECORD_UPDATED
          event type for replacing a record
 int type
          either RECORD_INSERTED, RECORD_DELETED or RECORD_UPDATED
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
protected DataEvent(java.lang.Object source)
           
  DataEvent(java.lang.Object source, int type, Record newRecord, Record oldRecord)
           
  DataEvent(java.lang.Object source, int type, Record newRecord, Record oldRecord, java.util.Date timeStamp)
          Create a new DataEvent
 
Method Summary
 java.util.Date getTimeStamp()
           
 void setSource(java.lang.Object source)
           
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RECORD_INSERTED

public static final int RECORD_INSERTED
event type for inserting a record

See Also:
Constant Field Values

RECORD_DELETED

public static final int RECORD_DELETED
event type for deleting a record

See Also:
Constant Field Values

RECORD_UPDATED

public static final int RECORD_UPDATED
event type for replacing a record

See Also:
Constant Field Values

type

public final int type
either RECORD_INSERTED, RECORD_DELETED or RECORD_UPDATED


newRecord

public final Record newRecord
record being added


oldRecord

public final Record oldRecord
Record being deleted or displaced

Constructor Detail

DataEvent

public DataEvent(java.lang.Object source,
                 int type,
                 Record newRecord,
                 Record oldRecord)

DataEvent

protected DataEvent(java.lang.Object source)

DataEvent

public DataEvent(java.lang.Object source,
                 int type,
                 Record newRecord,
                 Record oldRecord,
                 java.util.Date timeStamp)
Create a new DataEvent

Parameters:
source - The OreoDataSource that is the originator of the event.
type - The type of the event, either DataEvent.RECORD_INSERTED or DataEvent.RECORD_DELETED or DataEvent.RECORD_UPDATED
newRecord - the new record in the case of an insertion or update, null in the case of a deletion.
oldRecord - the old record in the case of a deletion or an update, null in the case of an insertion.
timeStamp - a time stamp.
Method Detail

setSource

public void setSource(java.lang.Object source)

getTimeStamp

public java.util.Date getTimeStamp()