// If the user does not exist: throwing an exception:
if (! usersTable.containsKey(name))
throw new RequestException("User [" + name + "] does not exist");
Identity newIdentity = request.getNewIdentity();
// If the new name is already taken by an other user than the modified
// one:
if (! newIdentity.getUserName().equals(name)
&& (usersTable.containsKey(newIdentity.getUserName())))
throw new RequestException("Name [" + newIdentity.getUserName() + "] already used");
if (usersTable.containsKey(name)) {
usersTable.remove(name);
proxiesTable.remove(name);
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, "doProcess UpdateUser:: store (in usersTable) this identity = " + newIdentity);
usersTable.put(newIdentity.getUserName(), newIdentity);
proxiesTable.put(newIdentity.getUserName(), proxId);
}
info = strbuf.append("Request [").append(request.getClass().getName())
.append("], processed by AdminTopic on server [").append(serverId)
.append("], successful [true]: user [").append(name)
.append("] has been updated to [").append(newIdentity.getUserName()).
append("]").toString();
strbuf.setLength(0);
distributeReply(replyTo, msgId, new AdminReply(true, info));