org.apache.ignite.internal.processors.cache.transactions

## Class IgniteTxEntry

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry

All Implemented Interfaces:
  Serializable, GridPeerDeployAware, Message

    public class IgniteTxEntry
    extends Object
    implements GridPeerDeployAware, Message

Transaction entry. Note that it is essential that this class does not override `Object.equals(Object)` method, as transaction entries should use referential equality.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`IgniteTxEntry()` Required by `Externalizable`
`IgniteTxEntry(GridCacheContext<?,?> ctx, IgniteInternalTx tx, GridCacheOperation op, CacheObject val, javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor, Object[] invokeArgs, long ttl, GridCacheEntryEx entry, CacheEntryPredicate[] filters, GridCacheVersion conflictVer)` This constructor is meant for local transactions.
`IgniteTxEntry(GridCacheContext<?,?> ctx, IgniteInternalTx tx, GridCacheOperation op, CacheObject val, long ttl, long conflictExpireTime, GridCacheEntryEx entry, GridCacheVersion conflictVer)` This constructor is meant for remote transactions.

### Method Summary

Methods
`void` `addEntryProcessor(javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor, Object[] invokeArgs)`
`CacheObject` `applyEntryProcessors(CacheObject cacheVal)`
`GridCacheEntryEx` `cached()`
`void` `cached(GridCacheEntryEx entry)`
`int` `cacheId()`
`ClassLoader` `classLoader()` Gets class loader for the class.
`IgniteTxEntry` `cleanCopy(GridCacheContext<?,?> ctx)`
`long` `conflictExpireTime()`
`void` `conflictExpireTime(long conflictExpireTime)`
`GridCacheVersion` `conflictVersion()`
`void` `conflictVersion(GridCacheVersion conflictVer)`
`GridCacheContext<?,?>` `context()`
`Class<?>` `deployClass()` Gets top level user class being deployed.
`GridCacheVersion` `dhtVersion()`
`void` `dhtVersion(GridCacheVersion dhtVer)`
`byte` `directType()` Gets message type.
`Collection<T2<javax.cache.processor.EntryProcessor<Object,Object,Object>,Object[]>>` `entryProcessors()`
`void` `entryProcessors(Collection<T2<javax.cache.processor.EntryProcessor<Object,Object,Object>,Object[]>> entryProcessorsCol)`
`javax.cache.expiry.ExpiryPolicy` `expiry()`
`void` `expiry(javax.cache.expiry.ExpiryPolicy expiryPlc)`
`GridCacheVersion` `explicitVersion()`
`void` `explicitVersion(GridCacheVersion explicitVer)`
`byte` `fieldsCount()` Gets fields count.
`CacheEntryPredicate[]` `filters()`
`void` `filters(CacheEntryPredicate[] filters)`
`boolean` `filtersPassed()`
`void` `filtersPassed(boolean filtersPassed)`
`boolean` `filtersSet()`
`void` `filtersSet(boolean filtersSet)`
`boolean` `groupLockEntry()`
`void` `groupLockEntry(boolean grpLock)`
`boolean` `hasReadValue()`
`boolean` `hasValue()`
`boolean` `hasWriteValue()`
`boolean` `isRead()`
`KeyCacheObject` `key()`
`boolean` `locallyMapped()`
`void` `locallyMapped(boolean locMapped)`
`boolean` `locked()`
`void` `markLocked()` Marks tx entry as locked.
`void` `marshal(GridCacheSharedContext<?,?> ctx, boolean transferExpiry)`
`UUID` `nodeId()`
`void` `nodeId(UUID nodeId)`
`GridCacheOperation` `op()`
`void` `op(GridCacheOperation op)`
`GridCacheOperation` `previousOperation()`
`CacheObject` `previousValue()`
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`void` `readValue(CacheObject val)` Sets read value if this tx entry does not have write value yet.
`String` `toString()`
`long` `ttl()`
`void` `ttl(long ttl)`
`IgniteTxKey` `txKey()`
`void` `unmarshal(GridCacheSharedContext<?,?> ctx, boolean near, ClassLoader clsLdr)` Unmarshalls entry.
`CacheObject` `value()`
`void` `value(CacheObject val, boolean writeVal, boolean readVal)`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### IgniteTxEntry

    public IgniteTxEntry()

Required by `Externalizable`

#### IgniteTxEntry

    public IgniteTxEntry(GridCacheContext<?,?> ctx,
                 IgniteInternalTx tx,
                 GridCacheOperation op,
                 CacheObject val,
                 long ttl,
                 long conflictExpireTime,
                 GridCacheEntryEx entry,
                 @Nullable
                 GridCacheVersion conflictVer)

This constructor is meant for remote transactions.

Parameters:
  `ctx` - Cache registry.
  `tx` - Owning transaction.
  `op` - Operation.
  `val` - Value.
  `ttl` - Time to live.
  `conflictExpireTime` - DR expire time.
  `entry` - Cache entry.
  `conflictVer` - Data center replication version.

#### IgniteTxEntry

    public IgniteTxEntry(GridCacheContext<?,?> ctx,
                 IgniteInternalTx tx,
                 GridCacheOperation op,
                 CacheObject val,
                 javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor,
                 Object[] invokeArgs,
                 long ttl,
                 GridCacheEntryEx entry,
                 CacheEntryPredicate[] filters,
                 GridCacheVersion conflictVer)

This constructor is meant for local transactions.

Parameters:
  `ctx` - Cache registry.
  `tx` - Owning transaction.
  `op` - Operation.
  `val` - Value.
  `entryProcessor` - Entry processor.
  `invokeArgs` - Optional arguments for EntryProcessor.
  `ttl` - Time to live.
  `entry` - Cache entry.
  `filters` - Put filters.
  `conflictVer` - Data center replication version.

### Method Detail

#### context

    public GridCacheContext<?,?> context()

Returns:
  Cache context for this tx entry.

#### locallyMapped

    public boolean locallyMapped()

Returns:
  Flag indicating if this entry is affinity mapped to the same node.

#### locallyMapped

    public void locallyMapped(boolean locMapped)

Parameters:
  `locMapped` - Flag indicating if this entry is affinity mapped to the same node.

#### groupLockEntry

    public boolean groupLockEntry()

Returns:
  `True` if this entry was added in group lock transaction and this is not a group lock entry.

#### groupLockEntry

    public void groupLockEntry(boolean grpLock)

Parameters:
  `grpLock` - `True` if this entry was added in group lock transaction and this is not a group lock entry.

#### cleanCopy

    public IgniteTxEntry cleanCopy(GridCacheContext<?,?> ctx)

Parameters:
  `ctx` - Context.
Returns:
  Clean copy of this entry.

#### nodeId

    public UUID nodeId()

Returns:
  Node ID.

#### nodeId

    public void nodeId(UUID nodeId)

Parameters:
  `nodeId` - Node ID.

#### dhtVersion

    public GridCacheVersion dhtVersion()

Returns:
  DHT version.

#### dhtVersion

    public void dhtVersion(GridCacheVersion dhtVer)

Parameters:
  `dhtVer` - DHT version.

#### locked

    public boolean locked()

Returns:
  `True` if tx entry was marked as locked.

#### markLocked

    public void markLocked()

Marks tx entry as locked.

#### key

    public KeyCacheObject key()

Returns:
  Entry key.

#### cacheId

    public int cacheId()

Returns:
  Cache ID.

#### txKey

    public IgniteTxKey txKey()

Returns:
  Tx key.

#### cached

    public GridCacheEntryEx cached()

Returns:
  Underlying cache entry.

#### cached

    public void cached(GridCacheEntryEx entry)

Parameters:
  `entry` - Cache entry.

#### value

    @Nullable
    public CacheObject value()

Returns:
  Entry value.

#### hasValue

    public boolean hasValue()

Returns:
  `True` if has value explicitly set.

#### hasWriteValue

    public boolean hasWriteValue()

Returns:
  `True` if has write value set.

#### hasReadValue

    public boolean hasReadValue()

Returns:
  `True` if has read value set.

#### previousValue

    @Nullable
    public CacheObject previousValue()

Returns:
  Value visible for peek.

#### previousOperation

    @Nullable
    public GridCacheOperation previousOperation()

Returns:
  Previous operation to revert entry in case of filter failure.

#### ttl

    public long ttl()

Returns:
  Time to live.

#### ttl

    public void ttl(long ttl)

Parameters:
  `ttl` - Time to live.

#### conflictExpireTime

    public long conflictExpireTime()

Returns:
  Conflict expire time.

#### conflictExpireTime

    public void conflictExpireTime(long conflictExpireTime)

Parameters:
  `conflictExpireTime` - Conflict expire time.

#### value

    public void value(@Nullable
             CacheObject val,
             boolean writeVal,
             boolean readVal)

Parameters:
  `val` - Entry value.
  `writeVal` - Write value flag.
  `readVal` - Read value flag.

#### readValue

    public void readValue(@Nullable
                 CacheObject val)

Sets read value if this tx entry does not have write value yet.

Parameters:
  `val` - Read value to set.

#### addEntryProcessor

    public void addEntryProcessor(javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor,
                         Object[] invokeArgs)

Parameters:
  `entryProcessor` - Entry processor.
  `invokeArgs` - Optional arguments for EntryProcessor.

#### entryProcessors

    public Collection<T2<javax.cache.processor.EntryProcessor<Object,Object,Object>,Object[]>> entryProcessors()

Returns:
  Collection of entry processors.

#### applyEntryProcessors

    public CacheObject applyEntryProcessors(CacheObject cacheVal)

Parameters:
  `cacheVal` - Value.
Returns:
  New value.

#### entryProcessors

    public void entryProcessors(@Nullable
                       Collection<T2<javax.cache.processor.EntryProcessor<Object,Object,Object>,Object[]>> entryProcessorsCol)

Parameters:
  `entryProcessorsCol` - Collection of entry processors.

#### op

    public GridCacheOperation op()

Returns:
  Cache operation.

#### op

    public void op(GridCacheOperation op)

Parameters:
  `op` - Cache operation.

#### isRead

    public boolean isRead()

Returns:
  `True` if read entry.

#### explicitVersion

    public void explicitVersion(GridCacheVersion explicitVer)

Parameters:
  `explicitVer` - Explicit version.

#### explicitVersion

    public GridCacheVersion explicitVersion()

Returns:
  Explicit version.

#### conflictVersion

    @Nullable
    public GridCacheVersion conflictVersion()

Returns:
  Conflict version.

#### conflictVersion

    public void conflictVersion(@Nullable
                       GridCacheVersion conflictVer)

Parameters:
  `conflictVer` - Conflict version.

#### filters

    public CacheEntryPredicate[] filters()

Returns:
  Put filters.

#### filters

    public void filters(CacheEntryPredicate[] filters)

Parameters:
  `filters` - Put filters.

#### filtersPassed

    public boolean filtersPassed()

Returns:
  `True` if filters passed for fast-commit transactions.

#### filtersPassed

    public void filtersPassed(boolean filtersPassed)

Parameters:
  `filtersPassed` - `True` if filters passed for fast-commit transactions.

#### filtersSet

    public boolean filtersSet()

Returns:
  `True` if filters are set.

#### filtersSet

    public void filtersSet(boolean filtersSet)

Parameters:
  `filtersSet` - `True` if filters are set and should not be replaced.

#### marshal

    public void marshal(GridCacheSharedContext<?,?> ctx,
               boolean transferExpiry)
                 throws IgniteCheckedException

Parameters:
  `ctx` - Context.
  `transferExpiry` - `True` if expire policy should be marshalled.
Throws:
  `IgniteCheckedException` - If failed.

#### unmarshal

    public void unmarshal(GridCacheSharedContext<?,?> ctx,
                 boolean near,
                 ClassLoader clsLdr)
                   throws IgniteCheckedException

Unmarshalls entry.

Parameters:
  `ctx` - Cache context.
  `near` - Near flag.
  `clsLdr` - Class loader.
Throws:
  `IgniteCheckedException` - If un-marshalling failed.

#### expiry

    public void expiry(@Nullable
              javax.cache.expiry.ExpiryPolicy expiryPlc)

Parameters:
  `expiryPlc` - Expiry policy.

#### expiry

    @Nullable
    public javax.cache.expiry.ExpiryPolicy expiry()

Returns:
  Expiry policy.

#### writeTo

    public boolean writeTo(ByteBuffer buf,
                  MessageWriter writer)

Writes this message to provided byte buffer.

Specified by:
  `writeTo` in interface `Message`
Parameters:
  `buf` - Byte buffer.
  `writer` - Writer.
Returns:
  Whether message was fully written.

#### readFrom

    public boolean readFrom(ByteBuffer buf,
                   MessageReader reader)

Reads this message from provided byte buffer.

Specified by:
  `readFrom` in interface `Message`
Parameters:
  `buf` - Byte buffer.
  `reader` - Reader.
Returns:
  Whether message was fully read.

#### directType

    public byte directType()

Gets message type.

Specified by:
  `directType` in interface `Message`
Returns:
  Message type.

#### fieldsCount

    public byte fieldsCount()

Gets fields count.

Specified by:
  `fieldsCount` in interface `Message`
Returns:
  Fields count.

#### deployClass

    public Class<?> deployClass()

Gets top level user class being deployed.

Specified by:
  `deployClass` in interface `GridPeerDeployAware`
Returns:
  Top level user deployed class.

#### classLoader

    public ClassLoader classLoader()

Gets class loader for the class. This class loader must be able to load the class returned from `GridPeerDeployAware.deployClass()` as well as all of its dependencies.

Note that in most cases the class loader returned from this method and the class loader for the class returned from `GridPeerDeployAware.deployClass()` method will be the same. If they are not the same, it is required that the class loader returned from this method still has to be able to load the deploy class and all its dependencies.

Specified by:
  `classLoader` in interface `GridPeerDeployAware`
Returns:
  Class loader for the class.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC3
Release Date | : March 24 2015