org.apache.ignite.internal.processors.rest.protocols.tcp.redis

## Class GridRedisMessage

- java.lang.Object
- - org.apache.ignite.internal.processors.rest.protocols.tcp.redis.GridRedisMessage

All Implemented Interfaces:
  Serializable, GridClientMessage

    public class GridRedisMessage
    extends Object
    implements GridClientMessage

Message to communicate with Redis client. Contains command, its attributes and response.

See Also:
  Serialized Form

### Field Summary

Fields
`static String` `CACHE_NAME_PREFIX` Cache name prefix.
`static String` `DFLT_CACHE_NAME` Default cache name.
`static byte` `RESP_REQ_FLAG` Request byte.

### Constructor Summary

Constructors
Constructor and Description
`GridRedisMessage(int msgLen)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `append(String part)` Appends the specified part to the message.
`List<String>` `aux()`
`String` `aux(int idx)`
`List<String>` `auxMKeys()`
`@Nullable String` `cacheName()`
`void` `cacheName(String cacheName)`
`UUID` `clientId()` Gets client identifier from which this request comes.
`void` `clientId(UUID id)` Sets client identifier from which this request comes.
`GridRedisCommand` `command()`
`UUID` `destinationId()` Gets identifier of the node where this message should be processed.
`void` `destinationId(UUID id)` Sets identifier of the node where this message should be eventually delivered.
`ByteBuffer` `getResponse()` Gets the response.
`String` `key()`
`int` `messageSize()`
`long` `requestId()` This method is used to match request and response messages.
`void` `requestId(long reqId)` Sets request id for outgoing packets.
`byte[]` `sessionToken()` Gets client session token.
`void` `sessionToken(byte[] sesTok)` Sets client session token.
`void` `setResponse(ByteBuffer response)` Sets the response.
`String` `toString()`

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

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

### Field Detail

#### RESP_REQ_FLAG

    public static final byte RESP_REQ_FLAG

Request byte.

See Also:
  Constant Field Values

#### CACHE_NAME_PREFIX

    public static final String CACHE_NAME_PREFIX

Cache name prefix.

See Also:
  Constant Field Values

#### DFLT_CACHE_NAME

    public static final String DFLT_CACHE_NAME

Default cache name.

See Also:
  Constant Field Values

### Constructor Detail

#### GridRedisMessage

    public GridRedisMessage(int msgLen)

Constructor.

Parameters:
  `msgLen` - Length of the Redis message (command with parameters).

### Method Detail

#### append

    public void append(String part)

Appends the specified part to the message.

Parameters:
  `part` - Part to append.

#### setResponse

    public void setResponse(ByteBuffer response)

Sets the response.

Parameters:
  `response` - Response.

#### getResponse

    public ByteBuffer getResponse()

Gets the response.

Returns:
  Response.

#### messageSize

    public int messageSize()

Returns:
  Number of elements in the message.

#### command

    public GridRedisCommand command()

Returns:
  `GridRedisCommand`.

#### key

    public String key()

Returns:
  Key for the command.

#### aux

    public String aux(int idx)

Returns:
  Parameters by index if available.

#### aux

    public List<String> aux()

Returns:
  All parameters if available.

#### auxMKeys

    public List<String> auxMKeys()

Returns:
  All parameters for multi-key commands if available.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### cacheName

    @Nullable
    public @Nullable String cacheName()

Returns:
  Cache name.

#### cacheName

    public void cacheName(String cacheName)

Parameters:
  `cacheName` - Cache name.

#### requestId

    public long requestId()

This method is used to match request and response messages.

Specified by:
  `requestId` in interface `GridClientMessage`
Returns:
  request ID.

#### requestId

    public void requestId(long reqId)

Sets request id for outgoing packets.

Specified by:
  `requestId` in interface `GridClientMessage`
Parameters:
  `reqId` - request ID.

#### clientId

    public UUID clientId()

Gets client identifier from which this request comes.

Specified by:
  `clientId` in interface `GridClientMessage`
Returns:
  Client identifier.

#### clientId

    public void clientId(UUID id)

Sets client identifier from which this request comes.

Specified by:
  `clientId` in interface `GridClientMessage`
Parameters:
  `id` - Client identifier.

#### destinationId

    public UUID destinationId()

Gets identifier of the node where this message should be processed.

Specified by:
  `destinationId` in interface `GridClientMessage`
Returns:
  Client identifier.

#### destinationId

    public void destinationId(UUID id)

Sets identifier of the node where this message should be eventually delivered.

Specified by:
  `destinationId` in interface `GridClientMessage`
Parameters:
  `id` - Client identifier.

#### sessionToken

    public byte[] sessionToken()

Gets client session token.

Specified by:
  `sessionToken` in interface `GridClientMessage`
Returns:
  Session token.

#### sessionToken

    public void sessionToken(byte[] sesTok)

Sets client session token.

Specified by:
  `sessionToken` in interface `GridClientMessage`
Parameters:
  `sesTok` - Session token.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.11.0
Release Date | : September 11 2021