String msgId,
AgentId from) {
try {
ServerConfigHelper helper = new ServerConfigHelper(true);
if (helper.addDomain(request.getDomainName(), request.getNetwork(), request.getServerId(), request.getPort())) {
distributeReply(replyTo, msgId, new AdminReply(true, "Domain added"));
}
if (from == null)
broadcastRequest(request, -1, replyTo, msgId);
} catch (ServerConfigHelper.NameAlreadyUsedException exc) {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, "", exc);
distributeReply(replyTo, msgId,
new AdminReply(AdminReply.NAME_ALREADY_USED, exc.getMessage()));
} catch (ServerConfigHelper.StartFailureException exc) {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, "", exc);
distributeReply(replyTo, msgId,
new AdminReply(AdminReply.START_FAILURE, exc.getMessage()));
} catch (Exception exc) {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, "", exc);
distributeReply(replyTo, msgId, new AdminReply(false, exc.toString()));
}
}