} else if ("from_node".equals(currentFieldName) || "fromNode".equals(currentFieldName)) {
fromNode = parser.text();
} else if ("to_node".equals(currentFieldName) || "toNode".equals(currentFieldName)) {
toNode = parser.text();
} else {
throw new ElasticsearchParseException("[move] command does not support field [" + currentFieldName + "]");
}
} else {
throw new ElasticsearchParseException("[move] command does not support complex json tokens [" + token + "]");
}
}
if (index == null) {
throw new ElasticsearchParseException("[move] command missing the index parameter");
}
if (shardId == -1) {
throw new ElasticsearchParseException("[move] command missing the shard parameter");
}
if (fromNode == null) {
throw new ElasticsearchParseException("[move] command missing the from_node parameter");
}
if (toNode == null) {
throw new ElasticsearchParseException("[move] command missing the to_node parameter");
}
return new MoveAllocationCommand(new ShardId(index, shardId), fromNode, toNode);
}