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

## Class GridNearSingleGetResponse

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheMessage
  - - org.apache.ignite.internal.processors.cache.distributed.near.GridNearSingleGetResponse

All Implemented Interfaces:
  Serializable, GridCacheDeployable, Message

    public class GridNearSingleGetResponse
    extends GridCacheMessage
    implements GridCacheDeployable

See Also:
  Serialized Form

### Field Summary

Fields
`static int` `CONTAINS_VAL_FLAG_MASK`
`static int` `INVALID_PART_FLAG_MASK`

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

`addDepInfo, CACHE_MSG_INDEX_FIELD_NAME, cacheId, forceAddDepInfo, MAX_CACHE_MSG_LOOKUP_INDEX`

### Constructor Summary

Constructors
Constructor and Description
`GridNearSingleGetResponse()` Empty constructor required for `Message`.
`GridNearSingleGetResponse(int cacheId, long futId, AffinityTopologyVersion topVer, Message res, boolean invalidPartitions, boolean addDepInfo)`

### Method Summary

Methods
`boolean` `addDeploymentInfo()` Deployment enabled flag indicates whether deployment info has to be added to this message.
`boolean` `containsValue()`
`byte` `directType()` Gets message type.
`IgniteCheckedException` `error()`
`void` `error(IgniteCheckedException err)`
`byte` `fieldsCount()` Gets fields count.
`void` `finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr)` This method is called after the message is deserialized and is responsible for unmarshalling state marshalled in `GridCacheMessage.prepareMarshal(GridCacheSharedContext)` method.
`long` `futureId()`
`boolean` `invalidPartitions()`
`void` `prepareMarshal(GridCacheSharedContext ctx)` This method is called before the whole message is serialized and is responsible for pre-marshalling state.
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`Message` `result()`
`void` `setContainsValue()`
`AffinityTopologyVersion` `topologyVersion()` Gets topology version or -1 in case of topology version is not required for this message.
`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.GridCacheMessage

`cacheId, cacheId, classError, deployInfo, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, lookupIndex, marshalCollection, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, messageId, nextIndexId, onClassError, partitionExchangeMessage, prepare, prepareMarshalCacheObject, prepareMarshalCacheObjects, prepareMarshalCacheObjects, prepareObject, transferExpiryPolicy, unmarshalCollection, unmarshalInfo, unmarshalInfos, unmarshalInvokeArguments, unmarshalTx`

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

### Field Detail

#### INVALID_PART_FLAG_MASK

    public static final int INVALID_PART_FLAG_MASK

See Also:
  Constant Field Values

#### CONTAINS_VAL_FLAG_MASK

    public static final int CONTAINS_VAL_FLAG_MASK

See Also:
  Constant Field Values

### Constructor Detail

#### GridNearSingleGetResponse

    public GridNearSingleGetResponse()

Empty constructor required for `Message`.

#### GridNearSingleGetResponse

    public GridNearSingleGetResponse(int cacheId,
                             long futId,
                             AffinityTopologyVersion topVer,
                             @Nullable
                             Message res,
                             boolean invalidPartitions,
                             boolean addDepInfo)

Parameters:
  `cacheId` - Cache ID.
  `futId` - Future ID.
  `topVer` - Topology version.
  `res` - Result.
  `invalidPartitions` - `True` if invalid partitions error occurred.
  `addDepInfo` - Deployment info.

### Method Detail

#### error

    public void error(IgniteCheckedException err)

Parameters:
  `err` - Error.

#### error

    public IgniteCheckedException error()

Overrides:
  `error` in class `GridCacheMessage`
Returns:
  Error, if any.

#### topologyVersion

    public AffinityTopologyVersion topologyVersion()

Description copied from class: `GridCacheMessage`
Gets topology version or -1 in case of topology version is not required for this message.

Overrides:
  `topologyVersion` in class `GridCacheMessage`
Returns:
  Topology version.

#### invalidPartitions

    public boolean invalidPartitions()

Returns:
  `True` if invalid partitions error occurred.

#### containsValue

    public boolean containsValue()

Returns:
  Results for request with set flag `GridNearSingleGetRequest.skipValues()`.

#### setContainsValue

    public void setContainsValue()

#### result

    public Message result()

Returns:
  Result.

#### futureId

    public long futureId()

Returns:
  Future ID.

#### prepareMarshal

    public void prepareMarshal(GridCacheSharedContext ctx)
                        throws IgniteCheckedException

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

Overrides:
  `prepareMarshal` in class `GridCacheMessage`
Parameters:
  `ctx` - Cache context.
Throws:
  `IgniteCheckedException` - If failed.

#### finishUnmarshal

    public void finishUnmarshal(GridCacheSharedContext 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 `GridCacheMessage`
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.

Specified by:
  `writeTo` in interface `Message`
Overrides:
  `writeTo` in class `GridCacheMessage`
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`
Overrides:
  `readFrom` in class `GridCacheMessage`
Parameters:
  `buf` - Byte buffer.
  `reader` - Reader.
Returns:
  Whether message was fully read.

#### addDeploymentInfo

    public boolean addDeploymentInfo()

Deployment enabled flag indicates whether deployment info has to be added to this message.

Specified by:
  `addDeploymentInfo` in class `GridCacheMessage`
Returns:
  `true` or if deployment info must be added to the the message, `false` otherwise.

#### 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 `GridCacheMessage`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.5.0-b1
Release Date | : December 1 2015