/* List for new SLAs, that is SLAs that do not have an ID equal to
* a current Watch */
ArrayList<SLA> toAddList = new ArrayList<SLA>();
for (SLA sla : slas) {
SLAPolicyHandler slap = getSLAPolicyHandler(sla);
if (slap == null) {
toAddList.add(sla);
} else {
toDiscardList.remove(slap);
if (SLAPolicyHandlerFactory.slaPolicyHandlerChanged(sla, slap)) {
if(logger.isTraceEnabled()) {
StringBuilder b = new StringBuilder();
b.append("The SLAPolicyHandler for [");
b.append(sla.getIdentifier());
b.append("] has changed. ");
b.append("Configured SLAPolicyHandler=[");
b.append(sla.getSlaPolicyHandler());
b.append("], SLAPolicyHandler class=[");
b.append(slap.getClass().getName());
logger.trace(b.toString());
}
removeSLAPolicyHandler(slap);
toAddList.add(sla);
} else {
if(logger.isTraceEnabled()) {
StringBuilder b = new StringBuilder();
b.append("Updating the SLAPolicyHandler for [");
b.append(sla.getIdentifier());
b.append("] with new SLA values: ");
b.append(sla);
logger.trace(b.toString());
}
slap.setSLA(sla);
WatchDescriptor[] wds = sla.getWatchDescriptors();
for (WatchDescriptor wd : wds) {
try {
watchInjector.modify(wd);
} catch (ConfigurationException e) {