boolean keepDurableSubscriptions = true, keepDurableSubscriptionsDialogShown = false;
// HJMS-139
for (final Iterator iter = dConfigs.iterator(); iter.hasNext();) {
final DestinationConfig dConfig = (DestinationConfig) iter.next();
DestinationConfig oldConfig = null;
try {
if (dConfig.getDomain() == Domain.TOPIC.getId()) {
oldConfig = hermes.getDestinationConfig(dConfig.getName(), Domain.TOPIC);
} else {
oldConfig = hermes.getDestinationConfig(dConfig.getName(), Domain.QUEUE);
}
} catch (Throwable t) {
log.error(t.getMessage(), t);
}
if (oldConfig != null && oldConfig.getProperties() != null) {
dConfig.setProperties(oldConfig.getProperties());
}
}
// End HJMS-139
if (factoryConfigById.containsKey(hermes.getId())) {
final FactoryConfig fConfig = factoryConfigById.get(hermes.getId());
for (final Iterator iter = fConfig.getDestination().iterator(); iter.hasNext();) {
final DestinationConfig dConfig = (DestinationConfig) iter.next();
if (dConfig.getDomain() == Domain.TOPIC.getId() && dConfig.isDurable()) {
if (!keepDurableSubscriptionsDialogShown) {
if (HermesBrowser.getBrowser() != null) {
if (JOptionPane.showConfirmDialog(HermesBrowser.getBrowser(), "Do you want to keep configured durable subscriptions?", "Durable Subscriptions", JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION) {
keepDurableSubscriptions = false;
}
}
keepDurableSubscriptionsDialogShown = true;
}
if (!keepDurableSubscriptions) {
iter.remove();
notifyDestinationRemoved(hermes, dConfig);
}
} else {
iter.remove();
notifyDestinationRemoved(hermes, dConfig);
}
}
for (final Iterator iter = dConfigs.iterator(); iter.hasNext();) {
final DestinationConfig dConfig = (DestinationConfig) iter.next();
fConfig.getDestination().add(dConfig);
hermes.addDestinationConfig(dConfig);
notifyDestinationAdded(hermes, dConfig);
}