ActionReport.MessagePart part = report.getTopMessagePart();
boolean isCluster = tgt.isCluster(list_target);
LbConfigs lbconfigs = domain.getExtensionByType(LbConfigs.class);
if (lbconfigs == null) {
logger.fine(localStrings.getLocalString(
"http_lb_admin.NoLbConfigs", "No lb configs"));
return;
}
List<LbConfig> lbconfigsList = lbconfigs.getLbConfig();
if (lbconfigsList.size() == 0) {
logger.fine(localStrings.getLocalString(
"http_lb_admin.NoLbConfigs", "No lb configs"));
return;
}
if (list_target == null) {
for (LbConfig lbc: lbconfigsList) {
ActionReport.MessagePart childPart = part.addChild();
childPart.setMessage(lbc.getName());
}
} else {
// target is a cluster
if (isCluster) {
for (LbConfig lbc: lbconfigsList) {
List<ClusterRef> refs = lbc.getRefs(ClusterRef.class);
for (ClusterRef cRef:refs) {
if (cRef.getRef().equals(list_target) ) {
ActionReport.MessagePart childPart = part.addChild();
childPart.setMessage(lbc.getName());
}
}
}
// target is a server
} else if (domain.isServer(list_target)) {
for (LbConfig lbc: lbconfigsList) {
List<ServerRef> refs = lbc.getRefs(ServerRef.class);
for (ServerRef sRef:refs) {
if (sRef.getRef().equals(list_target) ) {
ActionReport.MessagePart childPart = part.addChild();
childPart.setMessage(lbc.getName());
}
}
}
} else {
// target is a lb config
LbConfig lbConfig = lbconfigs.getLbConfig(list_target);
if (lbConfig != null) {
List<ClusterRef> cRefs = lbConfig.getRefs(ClusterRef.class);
for (ClusterRef ref: cRefs) {