public class RecordChangeEvent
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
RecordChangeEvent.Type
Event types
|
Modifier and Type | Field and Description |
---|---|
private Persistable |
dmo
Changed record, reflects current state of DMO
|
private java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> |
properties
Map of property names to extents (for indexed properties)
|
private Persistable |
snapshot
Snapshot of the original DMO, before any change was made
|
private RecordBuffer |
source
Record buffer which generated this event
|
private RecordChangeEvent.Type |
type
Event type
|
Constructor and Description |
---|
RecordChangeEvent(RecordChangeEvent.Type type,
RecordBuffer source,
Persistable dmo,
Persistable snapshot,
java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> properties)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Persistable |
getDMO()
Get the record which represents the post-modification state of
the affected DMO (in the case where the modification is the deletion of
the DMO from the database, this will be the object instance which was
deleted).
|
java.lang.String |
getEntity()
Get the DMO type associated with this event.
|
java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> |
getProperties()
Get a map whose keys are the names of those properties which have been
modified and whose values are lists of the indexes at which those
values are stored (indexed properties only).
|
Persistable |
getSnapshot()
Get a deep copy snapshot of the DMO which reflects the state of the DMO
as it was first set into the record buffer.
|
RecordBuffer |
getSource()
Get the record buffer which is the source of the change event.
|
boolean |
isBulkDelete()
Does this event signify a bulk record delete?
|
boolean |
isDelete()
Does this event signify a record delete?
|
boolean |
isFullBulkDelete()
Does this event signify a full bulk record delete (all records in
a temp table with a given multiplex ID)?
|
boolean |
isIndexedPropertyChangeOnly()
Report whether this change impacts only extent properties, or simple
properties as well.
|
boolean |
isInsert()
Does this event signify a record insert?
|
boolean |
isUpdate()
Does this event signify a modification to one or more of a record's
properties?
|
private final RecordChangeEvent.Type type
private final transient RecordBuffer source
private final Persistable dmo
private final Persistable snapshot
private final java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> properties
public RecordChangeEvent(RecordChangeEvent.Type type, RecordBuffer source, Persistable dmo, Persistable snapshot, java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> properties)
type
- Event type.source
- Record buffer which originated the event.dmo
- Post-modification state of the affected DMO (in the
case where the modification is the deletion of the DMO from
the database, this will be the object instance which was
deleted).snapshot
- A deep copy of the DMO which reflects the state of the DMO as
it was first set into the record buffer. For a newly created
record, this will contain the primary key assigned to the
record. All other properties will be set to their default
values.properties
- A map whose keys are the names of those properties which have
been modified and whose values are the indexes at which those
values are stored (indexed properties only). For a simple
property, the matching value will be null
.public RecordBuffer getSource()
Note: this will be null
if this event has been serialized
and deserialized; RecordBuffer objects cannot travel.
public java.lang.String getEntity()
public Persistable getDMO()
public Persistable getSnapshot()
public java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> getProperties()
null
. If the change
represented by the event was a deletion of the record, the map will be
empty.isIndexedPropertyChangeOnly()
,
isDelete()
public boolean isInsert()
true
if event represents record insert, else
false
.public boolean isDelete()
true
if event represents record delete, else
false
.public boolean isBulkDelete()
true
if event represents bulk record delete, else
false
.public boolean isFullBulkDelete()
true
if event represents full bulk record delete,
else false
.public boolean isUpdate()
true
if event represents record update, else
false
.public boolean isIndexedPropertyChangeOnly()
true
if change impacts only extent properties;
false
if change impacts any simple property in
the affected DMO.