if (lbConfig == null){
GuiUtil.handleError(handlerCtx, GuiUtil.getMessage("loadBalancer.noSuchLBError"));
return;
}
HealthCheckerConfig hcc = null;
HealthCheckerConfigCR ref = null;
if(isCluster){
ClusterRefConfig cref = lbConfig.getClusterRefConfigMap().get(targetName);
String policy = (String) advance.get("lBPolicy");
cref.setLBPolicy(policy);
if ("user-defined".equals(policy))
cref.setLBPolicyModule( "" + advance.get("lBPolicyModule"));
else
cref.setLBPolicyModule("");
hcc = cref.getHealthCheckerConfig();
ref = cref;
}else{
ServerRefConfig sref = lbConfig.getServerRefConfigMap().get(targetName);
Boolean temp = (Boolean) advance.get("lbEnabled");
sref.setLBEnabled( (temp == null) ? false : temp);
sref.setDisableTimeoutInMinutes( Integer.parseInt(""+advance.get("disableTimeoutInMinutes")));
hcc = sref.getHealthCheckerConfig();
ref = sref;
}
String url = (String) advance.get("url");
String intervalInSeconds = (String) advance.get("intervalInSeconds");
String timeoutInSeconds = (String) advance.get("timeoutInSeconds");
if (GuiUtil.isEmpty(url) && GuiUtil.isEmpty(intervalInSeconds) && GuiUtil.isEmpty(timeoutInSeconds))
return;
if (url == null) url = "";
if (intervalInSeconds == null) intervalInSeconds = "";
if (timeoutInSeconds == null) timeoutInSeconds = "";
if (hcc != null){
hcc.setURL(url);
hcc.setIntervalInSeconds(intervalInSeconds);
hcc.setTimeoutInSeconds(timeoutInSeconds);
}else{
ref.createHealthCheckerConfig(url, intervalInSeconds, timeoutInSeconds);
}
}catch (Exception ex){
GuiUtil.handleException(handlerCtx, ex);
}