SQLFire 1.0.1

com.vmware.sqlfire.callbacks
Interface Event


public interface Event

Encapsulates information about an event captured by a callback object.


Nested Class Summary
static class Event.Type
          Enumeration of the types of callback events.
 
Method Summary
 int[] getModifiedColumns()
          Get the positions of the columns that were updated.
 List<Object> getNewRow()
          Get the new or updated row as a List of the column values.
 List<Object> getOldRow()
          Get the old row being updated as a List of the column values.
 Object[] getPrimaryKey()
          Returns the Primary key of the manipulated row.
 ResultSetMetaData getResultSetMetaData()
          Gets the metadata information for the table being updated.
 Event.Type getType()
          Get the Type of the event.
 boolean isEviction()
          Returns whether the event is generated due to eviction of a row.
 boolean isExpiration()
          Returns whether the event is generated due to expiration of a row.
 boolean isLoad()
          Returns whether the event is generated due to a RowLoader invocation
 boolean isOriginRemote()
          Indicates whether this event originated in a VM other than this one.
 boolean isPossibleDuplicate()
          Indicates whether the event received is possibly a duplicate.
 

Method Detail

getType

Event.Type getType()
Get the Type of the event.

Returns:
the Type of the event.

getOldRow

List<Object> getOldRow()
Get the old row being updated as a List of the column values.

Returns:
the old row values or null if the old row is not available.

getNewRow

List<Object> getNewRow()
Get the new or updated row as a List of the column values.

Returns:
the new or updated row values, or null if this is a delete operation.

getResultSetMetaData

ResultSetMetaData getResultSetMetaData()
Gets the metadata information for the table being updated.

Returns:
the ResultSetMetaData of the table being updated.

isOriginRemote

boolean isOriginRemote()
Indicates whether this event originated in a VM other than this one. When using JDBC clients, this will be false on the server to which the client is connected and true on other servers when the event is propagated.

Returns:
true if this event originated in another VM or false if originated in this VM.

isPossibleDuplicate

boolean isPossibleDuplicate()
Indicates whether the event received is possibly a duplicate. Duplicate events may be received when a fail-over happens during DML statement execution.

Returns:
true if the event is a possible duplicate.

getModifiedColumns

int[] getModifiedColumns()
Get the positions of the columns that were updated. The details of the modified columns can be retrieved from the meta-data from getResultSetMetaData(). The modified column values can be obtained from the new value from getNewRow() using index as column position -1.

Returns:
the int[] of 1-based column positions for the columns that were updated.

getPrimaryKey

Object[] getPrimaryKey()
Returns the Primary key of the manipulated row. If the table has no primary key defined, then a long value uniquely identifying the row would be returned. In such cases, users can correlate the row ID during creation with that during update & delete.

Returns:
the Object[] of values of the primary key fields.

isLoad

boolean isLoad()
Returns whether the event is generated due to a RowLoader invocation

Returns:
true if the event got generated as a result of RowLoader invocation or false otherwise

isExpiration

boolean isExpiration()
Returns whether the event is generated due to expiration of a row.

Returns:
true if yes false otherwise

isEviction

boolean isEviction()
Returns whether the event is generated due to eviction of a row.

Returns:
true if yes false otherwise

SQLFire 1.0.1

Copyright © 2010-2011 VMware, Inc. All rights reserved.