} else { // target is a server
boolean foundTarget = false;
LbConfig[] lbConfigs = getLbConfigs().getLbConfig();
for (int i =0; i < lbConfigs.length; i ++ ) {
ServerRef sRef = lbConfigs[i].getServerRefByRef(target);
if (sRef == null) {
_logger.log(Level.FINEST," server " + target +
" does not exist in " + lbConfigs[i]);
} else {
foundTarget = true;
boolean enabled = sRef.isLbEnabled();
int curTout = Integer.parseInt(
sRef.getDisableTimeoutInMinutes());
if ((enabled == false) && (curTout == timeout)) {
String msg = _strMgr.getString("ServerDisabled",
sRef.getRef());
throw new MBeanException(new ConfigException(msg));
}
sRef.setLbEnabled(false);
sRef.setDisableTimeoutInMinutes(
new Integer(timeout).toString());
_logger.log(Level.INFO,_sMgr.getString(
"http_lb_admin.ServerDisabled", target));
}
}
// did not find server target
if (!foundTarget) {
ServerRef sRef = getServerRefFromCluster(ctx, target);
if (sRef == null) {
_logger.log(Level.FINEST," server " + target +
" does not exist in any cluster in the domain");
String msg = _strMgr.getString("ServerNotDefined",
target);
throw new MBeanException (new RuntimeException(msg));
} else {
int curTout = Integer.parseInt(
sRef.getDisableTimeoutInMinutes());
boolean enabled = sRef.isLbEnabled();
if ((enabled == false) && (curTout == timeout)) {
String msg = _strMgr.getString("ServerDisabled",
sRef.getRef());
throw new MBeanException(new ConfigException(msg));
}
sRef.setLbEnabled(false);
sRef.setDisableTimeoutInMinutes(
new Integer(timeout).toString());
_logger.log(Level.INFO,_sMgr.getString(
"http_lb_admin.ServerDisabled", target));
}