use of nl.nn.adapterframework.jms.JmsRealm in project iaf by ibissource.
the class ShowSecurityItems method retrieveUsedJmsDestinations.
private List<JmsDestination> retrieveUsedJmsDestinations() throws DomBuilderException {
List<JmsDestination> usedJmsDestinations = new ArrayList<JmsDestination>();
StringBuilder config = new StringBuilder("<config>");
for (Configuration configuration : ibisManager.getConfigurations()) {
config.append(configuration.getLoadedConfiguration());
}
config.append("</config>");
Document document = XmlUtils.buildDomDocument(config.toString());
NodeList nodeList = document.getElementsByTagName("*");
for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element element = (Element) node;
if (element.hasAttribute("destinationName") && !"false".equalsIgnoreCase(element.getAttribute("lookupDestination"))) {
JmsRealm jmsRealm = JmsRealmFactory.getInstance().getJmsRealm(element.getAttribute("jmsRealm"));
if (jmsRealm != null) {
String connectionFactory = jmsRealm.retrieveConnectionFactoryName();
usedJmsDestinations.add(new JmsDestination(connectionFactory, element.getAttribute("destinationName")));
}
}
}
}
return usedJmsDestinations;
}