*/
public Object execute(final Map<Object, Object> iArgs) {
if (name == null)
throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");
final ODatabaseRecord database = getDatabase();
if (name.equals("*")) {
long totalIndexed = 0;
for (OIndex<?> idx : database.getMetadata().getIndexManager().getIndexes()) {
if (idx.isAutomatic())
totalIndexed += idx.rebuild();
}
return totalIndexed;
} else {
final OIndex<?> idx = database.getMetadata().getIndexManager().getIndex(name);
if (idx == null)
throw new OCommandExecutionException("Index '" + name + "' not found");
if (!idx.isAutomatic())
throw new OCommandExecutionException("Cannot rebuild index '" + name