Search in sources :

Example 1 with CommandParser

use of com.hazelcast.internal.ascii.CommandParser in project hazelcast by hazelcast.

the class TextReadHandler method processCmd.

private void processCmd(String cmd) {
    try {
        int space = cmd.indexOf(' ');
        String operation = (space == -1) ? cmd : cmd.substring(0, space);
        CommandParser commandParser = MAP_COMMAND_PARSERS.get(operation);
        if (commandParser != null) {
            command = commandParser.parser(this, cmd, space);
        } else {
            command = new ErrorCommand(UNKNOWN);
        }
    } catch (Throwable t) {
        logger.finest(t);
        command = new ErrorCommand(ERROR_CLIENT, "Invalid command : " + cmd);
    }
}
Also used : ErrorCommand(com.hazelcast.internal.ascii.memcache.ErrorCommand) HttpDeleteCommandParser(com.hazelcast.internal.ascii.rest.HttpDeleteCommandParser) HttpPostCommandParser(com.hazelcast.internal.ascii.rest.HttpPostCommandParser) TouchCommandParser(com.hazelcast.internal.ascii.memcache.TouchCommandParser) HttpGetCommandParser(com.hazelcast.internal.ascii.rest.HttpGetCommandParser) SetCommandParser(com.hazelcast.internal.ascii.memcache.SetCommandParser) GetCommandParser(com.hazelcast.internal.ascii.memcache.GetCommandParser) IncrementCommandParser(com.hazelcast.internal.ascii.memcache.IncrementCommandParser) CommandParser(com.hazelcast.internal.ascii.CommandParser) DeleteCommandParser(com.hazelcast.internal.ascii.memcache.DeleteCommandParser) SimpleCommandParser(com.hazelcast.internal.ascii.memcache.SimpleCommandParser)

Aggregations

CommandParser (com.hazelcast.internal.ascii.CommandParser)1 DeleteCommandParser (com.hazelcast.internal.ascii.memcache.DeleteCommandParser)1 ErrorCommand (com.hazelcast.internal.ascii.memcache.ErrorCommand)1 GetCommandParser (com.hazelcast.internal.ascii.memcache.GetCommandParser)1 IncrementCommandParser (com.hazelcast.internal.ascii.memcache.IncrementCommandParser)1 SetCommandParser (com.hazelcast.internal.ascii.memcache.SetCommandParser)1 SimpleCommandParser (com.hazelcast.internal.ascii.memcache.SimpleCommandParser)1 TouchCommandParser (com.hazelcast.internal.ascii.memcache.TouchCommandParser)1 HttpDeleteCommandParser (com.hazelcast.internal.ascii.rest.HttpDeleteCommandParser)1 HttpGetCommandParser (com.hazelcast.internal.ascii.rest.HttpGetCommandParser)1 HttpPostCommandParser (com.hazelcast.internal.ascii.rest.HttpPostCommandParser)1