Commit 97f3f1e5 authored by Andre Freyssinet's avatar Andre Freyssinet

Allows to override default credentials for JMS administration

user (JORAM-315).
parent ba575c86
......@@ -58,6 +58,9 @@ public class AdminHelper {
public static final String BUNDLE_REST_ADMIN_PASS = "rest.admin.password";
public static final String BUNDLE_REST_ADMIN_IP_ALLOWED = "rest.admin.ipallowed";
public static final String BUNDLE_JMS_USER = "rest.admin.jms.user";
public static final String BUNDLE_JMS_PASS = "rest.admin.jms.password";
// Singleton
private static AdminHelper helper = null;
......@@ -119,11 +122,17 @@ public class AdminHelper {
restAdminPass != null && !restAdminPass.isEmpty();
}
String jmsRootUser = null;
String jmsRootPassword = null;
public void startJoramAdmin(String name) throws ConnectException, AdminException, JMSException {
if (joramAdmin == null) {
ConnectionFactory cf = LocalConnectionFactory.create();
cnx = cf.createConnection(LocalConnectionFactory.getDefaultRootLogin(),
LocalConnectionFactory.getDefaultRootPassword());
if (jmsRootUser == null)
jmsRootUser = LocalConnectionFactory.getDefaultRootLogin();
if (jmsRootPassword == null)
jmsRootPassword = LocalConnectionFactory.getDefaultRootPassword();
cnx = cf.createConnection(jmsRootUser, jmsRootPassword);
cnx.start();
joramAdmin = new JoramAdmin(cnx, name);
if (logger.isLoggable(BasicLevel.DEBUG))
......@@ -161,6 +170,9 @@ public class AdminHelper {
String name = "dlft-admin";
jmsRootUser = bundleContext.getProperty(BUNDLE_JMS_USER);
jmsRootPassword = bundleContext.getProperty(BUNDLE_JMS_USER);
startJoramAdmin(name);
// set the jndi properties
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment