Class GridRedisRestCommandHandler
- java.lang.Object
-
- org.apache.ignite.internal.processors.rest.handlers.redis.GridRedisRestCommandHandler
-
- All Implemented Interfaces:
GridRedisCommandHandler
- Direct Known Subclasses:
GridRedisAppendCommandHandler,GridRedisDbSizeCommandHandler,GridRedisDelCommandHandler,GridRedisExistsCommandHandler,GridRedisExpireCommandHandler,GridRedisFlushCommandHandler,GridRedisGetCommandHandler,GridRedisGetRangeCommandHandler,GridRedisGetSetCommandHandler,GridRedisIncrDecrCommandHandler,GridRedisMGetCommandHandler,GridRedisMSetCommandHandler,GridRedisSetCommandHandler,GridRedisSetRangeCommandHandler,GridRedisStrlenCommandHandler
public abstract class GridRedisRestCommandHandler extends Object implements GridRedisCommandHandler
Redis command handler done via REST.
-
-
Field Summary
Fields Modifier and Type Field Description protected GridKernalContextctxKernel context.protected GridRestProtocolHandlerhndREST protocol handler.protected IgniteLoggerlogLogger.
-
Constructor Summary
Constructors Modifier Constructor Description protectedGridRedisRestCommandHandler(IgniteLogger log, GridRestProtocolHandler hnd, GridKernalContext ctx)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract GridRestRequestasRestRequest(GridRedisMessage msg)ConvertsGridRedisMessagetoGridRestRequest.IgniteInternalFuture<GridRedisMessage>handleAsync(GridNioSession ses, GridRedisMessage msg)protected @Nullable LonglongValue(String name, List<String> params)Retrieves long value following the parameter name from parameters list.abstract ByteBuffermakeResponse(GridRestResponse resp, List<String> params)Prepares a response according to the request.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.internal.processors.rest.handlers.redis.GridRedisCommandHandler
supportedCommands
-
-
-
-
Field Detail
-
log
protected final IgniteLogger log
Logger.
-
hnd
protected final GridRestProtocolHandler hnd
REST protocol handler.
-
ctx
protected final GridKernalContext ctx
Kernel context.
-
-
Constructor Detail
-
GridRedisRestCommandHandler
protected GridRedisRestCommandHandler(IgniteLogger log, GridRestProtocolHandler hnd, GridKernalContext ctx)
Constructor.- Parameters:
log- Logger.hnd- REST protocol handler.ctx- Kernal context.
-
-
Method Detail
-
handleAsync
public IgniteInternalFuture<GridRedisMessage> handleAsync(GridNioSession ses, GridRedisMessage msg)
- Specified by:
handleAsyncin interfaceGridRedisCommandHandler- Parameters:
ses- Session.msg- Request message.- Returns:
- Future.
-
longValue
@Nullable protected @Nullable Long longValue(String name, List<String> params) throws GridRedisGenericException
Retrieves long value following the parameter name from parameters list.- Parameters:
name- Parameter name.params- Parameters list.- Returns:
- Long value from parameters list or null if not exists.
- Throws:
GridRedisGenericException- If parsing failed.
-
asRestRequest
public abstract GridRestRequest asRestRequest(GridRedisMessage msg) throws IgniteCheckedException
ConvertsGridRedisMessagetoGridRestRequest.- Parameters:
msg-GridRedisMessage- Returns:
GridRestRequest- Throws:
IgniteCheckedException- If fails.
-
makeResponse
public abstract ByteBuffer makeResponse(GridRestResponse resp, List<String> params)
Prepares a response according to the request.- Parameters:
resp- REST response.params- Auxiliary parameters.- Returns:
- Response for the command.
-
-