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 Modifier and Type Field Description static StringCACHE_NAME_PREFIXCache name prefix.static StringDFLT_CACHE_NAMEDefault cache name.static byteRESP_REQ_FLAGRequest byte.
-
Constructor Summary
Constructors Constructor Description GridRedisMessage(int fullLen)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(String part)Appends the specified part to the message.List<String>aux()Stringaux(int idx)List<String>auxMKeys()@Nullable StringcacheName()voidcacheName(String cacheName)UUIDclientId()Gets client identifier from which this request comes.voidclientId(UUID id)Sets client identifier from which this request comes.GridRedisCommandcommand()UUIDdestinationId()Gets identifier of the node where this message should be processed.voiddestinationId(UUID id)Sets identifier of the node where this message should be eventually delivered.intfullLength()ByteBuffergetResponse()Gets the response.Stringkey()intmessageSize()longrequestId()This method is used to match request and response messages.voidrequestId(long reqId)Sets request id for outgoing packets.byte[]sessionToken()Gets client session token.voidsessionToken(byte[] sesTok)Sets client session token.voidsetResponse(ByteBuffer response)Sets the response.StringtoString()
-
-
-
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
-
-
Method Detail
-
fullLength
public int fullLength()
- Returns:
- Full message length;
-
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.
-
auxMKeys
public List<String> auxMKeys()
- Returns:
- All parameters for multi-key commands if available.
-
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:
requestIdin interfaceGridClientMessage- Returns:
- request ID.
-
requestId
public void requestId(long reqId)
Sets request id for outgoing packets.- Specified by:
requestIdin interfaceGridClientMessage- Parameters:
reqId- request ID.
-
clientId
public UUID clientId()
Gets client identifier from which this request comes.- Specified by:
clientIdin interfaceGridClientMessage- Returns:
- Client identifier.
-
clientId
public void clientId(UUID id)
Sets client identifier from which this request comes.- Specified by:
clientIdin interfaceGridClientMessage- Parameters:
id- Client identifier.
-
destinationId
public UUID destinationId()
Gets identifier of the node where this message should be processed.- Specified by:
destinationIdin interfaceGridClientMessage- Returns:
- Client identifier.
-
destinationId
public void destinationId(UUID id)
Sets identifier of the node where this message should be eventually delivered.- Specified by:
destinationIdin interfaceGridClientMessage- Parameters:
id- Client identifier.
-
sessionToken
public byte[] sessionToken()
Gets client session token.- Specified by:
sessionTokenin interfaceGridClientMessage- Returns:
- Session token.
-
sessionToken
public void sessionToken(byte[] sesTok)
Sets client session token.- Specified by:
sessionTokenin interfaceGridClientMessage- Parameters:
sesTok- Session token.
-
-