use of com.hazelcast.internal.ascii.memcache.ErrorCommand in project hazelcast by hazelcast.
the class HttpDeleteCommandParser method parser.
@Override
public TextCommand parser(TextReadHandler readHandler, String cmd, int space) {
StringTokenizer st = new StringTokenizer(cmd);
st.nextToken();
String uri;
if (st.hasMoreTokens()) {
uri = st.nextToken();
} else {
return new ErrorCommand(ERROR_CLIENT);
}
return new HttpDeleteCommand(uri);
}
use of com.hazelcast.internal.ascii.memcache.ErrorCommand in project hazelcast by hazelcast.
the class HttpGetCommandParser method parser.
@Override
public TextCommand parser(TextReadHandler readHandler, String cmd, int space) {
StringTokenizer st = new StringTokenizer(cmd);
st.nextToken();
String uri;
if (st.hasMoreTokens()) {
uri = st.nextToken();
} else {
return new ErrorCommand(ERROR_CLIENT);
}
return new HttpGetCommand(uri);
}
use of com.hazelcast.internal.ascii.memcache.ErrorCommand 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);
}
}
use of com.hazelcast.internal.ascii.memcache.ErrorCommand in project hazelcast by hazelcast.
the class HttpPostCommandParser method parser.
@Override
public TextCommand parser(TextReadHandler readHandler, String cmd, int space) {
StringTokenizer st = new StringTokenizer(cmd);
st.nextToken();
String uri;
if (st.hasMoreTokens()) {
uri = st.nextToken();
} else {
return new ErrorCommand(ERROR_CLIENT);
}
return new HttpPostCommand(readHandler, uri);
}
Aggregations