IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.plugins
Interface LogElement

All Superinterfaces:
Serializable
All Known Subinterfaces:
FailedUpdateElement

public interface LogElement
extends Serializable

LogElements are the individual entries within a LogSequence. A LogElement has attributes such as operation type (delete, insert, update, etc.), current value, last access time, versioned value, etc. A LogElement is created during a transaction to record in-flight operations. For a LogElement on an ObjectMap that is configured to use OutputFormat.RAW for the keys or values, the keys or values objects in the LogElement will be SerializedKey or SerializedValue objects respectively. If required, you can use the SerializedEntry.getObject() method to retrieve (possibly inflating the serialized object) the original key or value object. To override the map's output format configuration, use the PluginOutputFormat annotation in the caller of the LogElement.

Since:
WAS XD 6.0, XC10
See Also:
LogSequence

Nested Class Summary
static class LogElement.Type
          The Type class is used to represent a LogElement type.
 
Field Summary
static LogElement.Type CLEAR
          The Type that represents the CLEAR operation.
static int CODE_CLEAR
          The type code constant for CLEAR.
static int CODE_DELETE
          The type code constant for DELETE.
static int CODE_EVICT
          The type code constant for EVICT.
static int CODE_FETCH
          The type code constant for FETCH.
static int CODE_INSERT
          The type code constant for INSERT.
static int CODE_LOCK
          The type code constant for LOCK.
static int CODE_TOUCH
          The type code constant for TOUCH.
static int CODE_UNDO_NOT_NEEDED
          The code constant for UNDO_NOT_NEEDED.
static int CODE_UPDATE
          The type code constant for UPDATE.
static int CODE_UPSERT
          The type code constant for UPSERT.
static LogElement.Type DELETE
          The Type that represents the DELETE operation.
static LogElement.Type EVICT
          The Type that represents the EVICT operation.
static LogElement.Type FETCH
          The Type that represents the FETCH operation.
static LogElement.Type INSERT
          The Type that represents the INSERT operation.
static LogElement.Type LOCK
          The Type that represents the LOCK operation.
static LogElement.Type TOUCH
          The Type that represents the TOUCH operation.
static LogElement.Type UNDO_NOT_NEEDED
          The Type that represents an UNDO action is NOT required for this LogElement.
static LogElement.Type UPDATE
          The Type that represents the UPDATE operation.
static LogElement.Type UPSERT
          The Type that represents the UPSERT operation.
 
Method Summary
 Object getAfterImage()
          Gets the "after image" value object.
 Object getBeforeImage()
          Gets the "before image" of the value object.
 CacheEntry getCacheEntry()
          Returns the CacheEntry for this key.
 Object getCurrentValue()
          Gets the value for this LogElement.
 Object getKey()
          Returns the key for this LogElement.
 long getLastAccessTime()
          Returns the last access time associated with this LogElement.
 LogElement.Type getType()
          Gets the type of this LogElement.
 LogElement.Type getUndoType()
          Returns what operation must be performed to "undo" a prior change the transaction made to the map entry.
 Object getVersionedValue()
          Gets the versioned object at the time the object was first associated with the transaction.
 boolean isCascaded()
          Answers true if this LogElement is a result of a cascade operation.
 boolean isPending()
          Answers true if this change has NOT been applied to the loader.
 void setVersionedValue(Object v)
          Used to update the versioned object after an update of map entry occurs.
 

Field Detail

CODE_INSERT

static final int CODE_INSERT
The type code constant for INSERT.

See Also:
INSERT, LogElement.Type.getCode(), Constant Field Values

CODE_UPDATE

static final int CODE_UPDATE
The type code constant for UPDATE.

See Also:
UPDATE, LogElement.Type.getCode(), Constant Field Values

CODE_DELETE

static final int CODE_DELETE
The type code constant for DELETE.

See Also:
DELETE, LogElement.Type.getCode(), Constant Field Values

CODE_EVICT

static final int CODE_EVICT
The type code constant for EVICT.

See Also:
EVICT, LogElement.Type.getCode(), Constant Field Values

CODE_FETCH

static final int CODE_FETCH
The type code constant for FETCH.

See Also:
FETCH, LogElement.Type.getCode(), Constant Field Values

CODE_TOUCH

static final int CODE_TOUCH
The type code constant for TOUCH.

See Also:
TOUCH, LogElement.Type.getCode(), Constant Field Values

CODE_CLEAR

static final int CODE_CLEAR
The type code constant for CLEAR.

Since:
WAS XD 6.1.0.3
See Also:
CLEAR, LogElement.Type.getCode(), Constant Field Values

CODE_LOCK

static final int CODE_LOCK
The type code constant for LOCK.

Since:
8.6
See Also:
LOCK, LogElement.Type.getCode(), Constant Field Values

CODE_UPSERT

static final int CODE_UPSERT
The type code constant for UPSERT.

Since:
8.6
See Also:
UPSERT, LogElement.Type.getCode(), Constant Field Values

CODE_UNDO_NOT_NEEDED

static final int CODE_UNDO_NOT_NEEDED
The code constant for UNDO_NOT_NEEDED. Used to indicate no operation is needed to undo the changes for this LogElement since this LogElement was never processed or it was an operation that does not require an undo operation.

See Also:
Constant Field Values

INSERT

static final LogElement.Type INSERT
The Type that represents the INSERT operation.


UPDATE

static final LogElement.Type UPDATE
The Type that represents the UPDATE operation.


DELETE

static final LogElement.Type DELETE
The Type that represents the DELETE operation.


EVICT

static final LogElement.Type EVICT
The Type that represents the EVICT operation.


FETCH

static final LogElement.Type FETCH
The Type that represents the FETCH operation.


TOUCH

static final LogElement.Type TOUCH
The Type that represents the TOUCH operation.


CLEAR

static final LogElement.Type CLEAR
The Type that represents the CLEAR operation.

Since:
WAS XD 6.1.0.3

LOCK

static final LogElement.Type LOCK
The Type that represents the LOCK operation.

Since:
8.6

UPSERT

static final LogElement.Type UPSERT
The Type that represents the UPSERT operation.

Since:
8.6

UNDO_NOT_NEEDED

static final LogElement.Type UNDO_NOT_NEEDED
The Type that represents an UNDO action is NOT required for this LogElement.

Method Detail

getType

LogElement.Type getType()
Gets the type of this LogElement. The type indicates what operation needs to be applied to the map entry.

Returns:
the type of this LogElement. It can be one of: INSERT, UPDATE, DELETE, EVICT, FETCH, or TOUCH.
See Also:
LogElement.Type

getCurrentValue

Object getCurrentValue()
Gets the value for this LogElement.

For a LogElement on an ObjectMap that is configured to use a ValueSerializerPlugin, the values in the LogSequence will be SerializedValue objects. If required, you can use the SerializedEntry.getObject() method to retrieve (possibly inflating the serialized object) the original value object.

The original value represents the new value that should be applied to the BackingMap and Loader. This value can be cast to ValueProxyInfo when a value interface is in use in order to determine the set of dirty attributes.

Returns:
the value in case of INSERT, UPDATE, or FETCH, null in the case of DELETE or EVICT.
See Also:
ValueProxyInfo

getCacheEntry

CacheEntry getCacheEntry()
Returns the CacheEntry for this key. The key, current committed value, etc. can be accessed from the CacheEntry.

Returns:
the entry in the cache that is requested to be updated.
See Also:
CacheEntry.getCommittedValue(), getKey()

isPending

boolean isPending()
Answers true if this change has NOT been applied to the loader.

Changes can previously be applied to a loader using the ObjectMap.flush() or Session.flush() methods. This method reveals whether the change in this LogElement has already been applied to the Loader using one of those methods.

Returns:
true if this change has NOT been applied to the loader.
See Also:
ObjectMap.flush(), Session.flush()

getVersionedValue

Object getVersionedValue()
Gets the versioned object at the time the object was first associated with the transaction.

For a LogElement on an ObjectMap that is configured to use a or ValueSerializerPlugin, the versioned object will be returned as an XsDataInputStream, read will be SerializedKey or SerializedValue objects respectively. If required, you can use the SerializedEntry.getObject() method to retrieve (possibly inflating the serialized object) the original key or value object. For a LogElement on an ObjectMap that is configured to use a ValueSerializerPlugin that generates version objects, the version object will be the data stream representing the data.

Returns:
The versioned object.
See Also:
OptimisticCallback

setVersionedValue

void setVersionedValue(Object v)
Used to update the versioned object after an update of map entry occurs.

The Loader can use this method when it is using an optimistic strategy and uses the OptimisticCallback.updateVersionedObjectForValue(Object) method to get an updated version object.

Parameters:
v - The versioned object.
See Also:
OptimisticCallback.updateVersionedObjectForValue(Object)

getLastAccessTime

long getLastAccessTime()
Returns the last access time associated with this LogElement.

Returns:
last access time

getUndoType

LogElement.Type getUndoType()
Returns what operation must be performed to "undo" a prior change the transaction made to the map entry.

Note, an undo type of UNDO_NOT_NEEDED is returned if nothing needs to be undone for this LogElement.

Returns:
the "undo" type of this LogElement. It can be one of: INSERT, UPDATE, DELETE, or UNDO_NOT_NEEDED

getBeforeImage

Object getBeforeImage()
Gets the "before image" of the value object.

The "before image" is the value object that existed in map entry prior to applying a change to map entry. Note, it is possible for a null reference to be returned (e.g. in the case where a new map entry is created).

For a LogElement on an ObjectMap that is configured to use OutputFormat.RAW for the values, the value will be a SerializedValue object. If required, you can use the SerializedEntry.getObject() method to retrieve (possibly inflating the serialized object) the original value object.

To override the map's output format configuration, use the PluginOutputFormat annotation in the caller of the LogElement.

Returns:
the value prior to applying the change

getAfterImage

Object getAfterImage()
Gets the "after image" value object.

The "after image" is the value object that existed in map entry after applying a change to the map entry. Note, it is possible for a null reference to be returned (e.g. in the case where an existing map entry is removed/evicted).

For a LogElement on an ObjectMap that is configured to use OutputFormat.RAW for the value, the value will be a SerializedValue object. If required, you can use the SerializedEntry.getObject() method to retrieve (possibly inflating the serialized object) the original value object.

To override the map's output format configuration, use the PluginOutputFormat annotation in the caller of the LogElement.

Returns:
the value after applying the change

isCascaded

boolean isCascaded()
Answers true if this LogElement is a result of a cascade operation. This only applies to ObjectGrid EntityManager programming model.

ObjectGrid EntityManager supports cascade operations. For example, when persisting an entity P, if P has a relation to entity C with CascadeType.PERSIST enabled, C will also be persisted as a result of the cascade operation. The method isCascaded() returns true for the LogElement object which represents C, and the method returns false for the LogElement object which represents P.

Returns:
true if the LogElement object is a result of cascade operation.
Since:
6.1.0.5 FIX1
See Also:
EntityManager

getKey

Object getKey()
Returns the key for this LogElement.

For a LogElement on an ObjectMap that is configured to use OutputFormat.RAW for the keys, the value will be a SerializedKey object. If required, you can use the SerializedEntry.getObject() method to retrieve (possibly inflating the serialized object) the original key object.

To override the map's output format configuration, use the PluginOutputFormat annotation in the caller of the LogElement.

This method can be used instead of LogElement.getCacheEntry().getKey().

Returns:
the key for this LogElement.
Since:
7.0
See Also:
CacheEntry.getKey()

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.