String xpathCLB = "/domain/configs/config[@name='" + cfg.getName() + "']/availability-service/converged-load-balancer";
ConfigUpdate cfgUpdate = ConfigChangeFactory.createConfigUpdate(xpathCLB,
"config-file", configFileOldValue, configFileNewValue);
ArrayList cfgList = new ArrayList<ConfigChange>();
cfgList.add(cfgUpdate);
ElementChangeHelper elementHelper = new ElementChangeHelper();
AdminEvent[] elementChangeEvents = elementHelper.generateElementChangeEventsFromChangeList(instanceName, cfgList, ctx);
for(AdminEvent elementChangeEvent : elementChangeEvents) {
if (_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST, "sip.administration.clb.mbean.event_sent",
elementChangeEvent.getEventInfo());
} else {
_logger.log(Level.INFO, "sip.administration.clb.mbean.send_event", elementChangeEvent.toString());
}
AdminEventMulticaster.multicastEvent((AdminEvent) elementChangeEvent);
}
// generate an event for create/delete instance to be used by DataCentricUtil
if (ev.getChoice().equals("ADD") || ev.getChoice().equals("DELETE")) {
Object value = ev.getObject();
java.lang.reflect.Method[] methods = value.getClass().getMethods();
String xpath = null;
for (Method m:methods) {
if (m.getName().equals("getXPath")) {
xpath = (String) m.invoke(value, (Object [])null);
break;
}
}
String clusterXPath = ServerXPathHelper.getParentXPath(xpath);
// XPath will be /domain/clusters/cluster[@name='{1}']/server-ref[@ref='{2}']
int beginIndex = clusterXPath.indexOf("[@name='")+7;
int endIndex = clusterXPath.indexOf("']");
String clusterName = clusterXPath.substring(beginIndex, endIndex);
cfgList = new ArrayList<ConfigChange>();
if (ev.getChoice().equals("ADD")) {
ConfigAdd cfgAdd = ConfigChangeFactory.createConfigAdd(ctx, xpath);
cfgList.add(cfgAdd);
} else if (ev.getChoice().equals("DELETE")) {
ConfigDelete cfgDelete = ConfigChangeFactory.createConfigDelete(xpath);
cfgList.add(cfgDelete);
}
elementHelper = new ElementChangeHelper();
elementChangeEvents = elementHelper.generateElementChangeEventsFromChangeList(clusterName, cfgList, ctx);
for(AdminEvent elementChangeEvent : elementChangeEvents) {
if (_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST, "sip.administration.clb.mbean.event_sent",
elementChangeEvent.getEventInfo());
} else {