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

## Class IgniteTxKey

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

All Implemented Interfaces:
  Serializable, Message

    public class IgniteTxKey
    extends Object
    implements Message

Cache transaction key. This wrapper is needed because same keys may be enlisted in the same transaction for multiple caches.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`IgniteTxKey()` Empty constructor required for `Externalizable`.
`IgniteTxKey(KeyCacheObject key, int cacheId)`

### Method Summary

Methods
`int` `cacheId()`
`byte` `directType()` Gets message type.
`boolean` `equals(Object o)`
`byte` `fieldsCount()` Gets fields count.
`void` `finishUnmarshal(GridCacheContext ctx, ClassLoader ldr)`
`int` `hashCode()`
`KeyCacheObject` `key()`
`void` `prepareMarshal(GridCacheContext ctx)`
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`String` `toString()`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

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

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

### Constructor Detail

#### IgniteTxKey

    public IgniteTxKey()

Empty constructor required for `Externalizable`.

#### IgniteTxKey

    public IgniteTxKey(KeyCacheObject key,
               int cacheId)

Parameters:
  `key` - User key.
  `cacheId` - Cache ID.

### Method Detail

#### key

    public KeyCacheObject key()

Returns:
  User key.

#### cacheId

    public int cacheId()

Returns:
  Cache ID.

#### prepareMarshal

    public void prepareMarshal(GridCacheContext ctx)
                        throws IgniteCheckedException

Parameters:
  `ctx` - Context.
Throws:
  `IgniteCheckedException` - If failed.

#### finishUnmarshal

    public void finishUnmarshal(GridCacheContext ctx,
                       ClassLoader ldr)
                         throws IgniteCheckedException

Parameters:
  `ctx` - Context.
  `ldr` - Class loader.
Throws:
  `IgniteCheckedException` - If failed.

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### 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.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.5.0.final
Release Date | : December 29 2015