org.apache.ignite.internal.processors.cache.distributed

## Class GridDistributedUnlockRequest<K,V>

- java.lang.Object
- - org.apache.ignite.plugin.extensions.communication.MessageAdapter
  - - org.apache.ignite.internal.processors.cache.GridCacheMessage<K,V>
    - - org.apache.ignite.internal.processors.cache.distributed.GridDistributedBaseMessage<K,V>
      - - org.apache.ignite.internal.processors.cache.distributed.GridDistributedUnlockRequest<K,V>

All Implemented Interfaces:
  Serializable, GridCacheDeployable, GridCacheVersionable

Direct Known Subclasses:
  GridDhtUnlockRequest, GridNearUnlockRequest

    public class GridDistributedUnlockRequest<K,V>
    extends GridDistributedBaseMessage<K,V>

Lock request message.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.ignite.plugin.extensions.communication.MessageAdapter

`MessageAdapter.Type`

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.distributed.GridDistributedBaseMessage

`ver`

### Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheMessage

`CACHE_MSG_INDEX_FIELD_NAME, cacheId, MAX_CACHE_MSG_LOOKUP_INDEX`

### Fields inherited from class org.apache.ignite.plugin.extensions.communication.MessageAdapter

`reader, readState`

### Constructor Summary

Constructors
Constructor and Description
`GridDistributedUnlockRequest()` Empty constructor required by `Externalizable`.
`GridDistributedUnlockRequest(int cacheId, int keyCnt)`

### Method Summary

Methods
`void` `addKey(K key, byte[] bytes, GridCacheContext<K,V> ctx)`
`byte` `directType()` Gets message type.
`void` `finishUnmarshal(GridCacheSharedContext<K,V> ctx, ClassLoader ldr)` This method is called after the message is deserialized and is responsible for unmarshalling state marshalled in `GridCacheMessage.prepareMarshal(GridCacheSharedContext)` method.
`List<byte[]>` `keyBytes()`
`List<K>` `keys()`
`void` `prepareMarshal(GridCacheSharedContext<K,V> ctx)` This method is called before the whole message is serialized and is responsible for pre-marshalling state.
`boolean` `readFrom(ByteBuffer buf)` 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 org.apache.ignite.internal.processors.cache.distributed.GridDistributedBaseMessage

`candidatesByIndex, candidatesByIndex, candidatesByKey, candidatesByKey, candidatesByKey, committedVersions, completedVersions, keysCount, rolledbackVersions, version, version`

### Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheMessage

`allowForStartup, cacheId, cacheId, classError, deployInfo, ignoreClassErrors, lookupIndex, marshalBooleanLinkedMap, marshalCollection, marshalFilter, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, marshalValuesCollection, messageId, nextIndexId, onClassError, prepare, prepareFilter, prepareObject, prepareObjects, topologyVersion, transactional, transferExpiryPolicy, unmarshalBooleanLinkedMap, unmarshalCollection, unmarshalFilter, unmarshalInfo, unmarshalInfos, unmarshalInvokeArguments, unmarshalTx, unmarshalValueBytesCollection`

### Methods inherited from class org.apache.ignite.plugin.extensions.communication.MessageAdapter

`setReader, skipRecovery`

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

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

### Methods inherited from interface org.apache.ignite.internal.processors.cache.GridCacheDeployable

`deployInfo, prepare`

### Constructor Detail

#### GridDistributedUnlockRequest

    public GridDistributedUnlockRequest()

Empty constructor required by `Externalizable`.

#### GridDistributedUnlockRequest

    public GridDistributedUnlockRequest(int cacheId,
                                int keyCnt)

Parameters:
  `cacheId` - Cache ID.
  `keyCnt` - Key count.

### Method Detail

#### keyBytes

    public List<byte[]> keyBytes()

Returns:
  Key to lock.

#### keys

    public List<K> keys()

Returns:
  Keys.

#### addKey

    public void addKey(K key,
              byte[] bytes,
              GridCacheContext<K,V> ctx)
                throws IgniteCheckedException

Parameters:
  `key` - Key.
  `bytes` - Key bytes.
  `ctx` - Context.
Throws:
  `IgniteCheckedException` - If failed.

#### prepareMarshal

    public void prepareMarshal(GridCacheSharedContext<K,V> ctx)
                        throws IgniteCheckedException

This method is called before the whole message is serialized and is responsible for pre-marshalling state.

Overrides:
  `prepareMarshal` in class `GridDistributedBaseMessage<K,V>`
Parameters:
  `ctx` -
Throws:
  `IgniteCheckedException` - If failed.

#### finishUnmarshal

    public void finishUnmarshal(GridCacheSharedContext<K,V> ctx,
                       ClassLoader ldr)
                         throws IgniteCheckedException

This method is called after the message is deserialized and is responsible for unmarshalling state marshalled in `GridCacheMessage.prepareMarshal(GridCacheSharedContext)` method.

Overrides:
  `finishUnmarshal` in class `GridDistributedBaseMessage<K,V>`
Parameters:
  `ctx` - Context.
  `ldr` - Class loader.
Throws:
  `IgniteCheckedException` - If failed.

#### writeTo

    public boolean writeTo(ByteBuffer buf,
                  MessageWriter writer)

Writes this message to provided byte buffer.

Overrides:
  `writeTo` in class `GridDistributedBaseMessage<K,V>`
Parameters:
  `buf` - Byte buffer.
  `writer` - Writer.
Returns:
  Whether message was fully written.

#### readFrom

    public boolean readFrom(ByteBuffer buf)

Reads this message from provided byte buffer.

Overrides:
  `readFrom` in class `GridDistributedBaseMessage<K,V>`
Parameters:
  `buf` - Byte buffer.
Returns:
  Whether message was fully read.

#### directType

    public byte directType()

Gets message type.

Specified by:
  `directType` in class `MessageAdapter`
Returns:
  Message type.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridDistributedBaseMessage<K,V>`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015