modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
| 21 ++++++++++
modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
| 3 +
2 files changed, 24 insertions(+)
New commits:
commit 2e3f2b2e2f8db3894fea0777508e79e4bf3817cd
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue May 28 14:32:14 2013 -0400
BZ 967990 the installer now turns off the admin console
diff --git
a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
index 8cef6e1..eaf6f66 100644
---
a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
+++
b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
@@ -40,12 +40,33 @@ public class CoreJBossASClient extends JBossASClient {
public static final String SCANNER = "scanner";
public static final String EXTENSION = "extension";
public static final String MODULE = "module";
+ public static final String CORE_SERVICE_MGMT = "management";
+ public static final String MGMT_INTERFACE = "management-interface";
+ public static final String MGMT_INTERFACE_HTTP = "http-interface";
public CoreJBossASClient(ModelControllerClient client) {
super(client);
}
/**
+ * Allows the caller to turn on or off complete access for the app server's admin
console.
+ *
+ * @param enableFlag true if the admin console enabled and visible; false if you want
to prohibit all access to the admin console
+ * @throws Exception
+ */
+ public void setEnableAdminConsole(boolean enableFlag) throws Exception {
+ //
/core-service=management/management-interface=http-interface/:write-attribute(name=console-enabled,value=false)
+ final Address address = Address.root()
+ .add(CORE_SERVICE, CORE_SERVICE_MGMT, MGMT_INTERFACE, MGMT_INTERFACE_HTTP);
+ final ModelNode req = createWriteAttributeRequest("console-enabled",
Boolean.toString(enableFlag), address);
+ final ModelNode response = execute(req);
+ if (!isSuccess(response)) {
+ throw new FailureException(response);
+ }
+ return;
+ }
+
+ /**
* Given a string with possible ${x} expressions in it, this will resolve that
expression
* using system property values that are set within the AS JVM itself. If the string
* to resolve has no expressions, or has no expressions that are resolveable, the
expression
diff --git
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
index 0b9c078..bb42d4a 100644
---
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
+++
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
@@ -1034,6 +1034,9 @@ public class InstallerServiceImpl implements InstallerService {
// we don't want to the JBossAS welcome screen; turn it off
new WebJBossASClient(mcc).setEnableWelcomeRoot(false);
+ // we don't want users to access the admin console
+ new CoreJBossASClient(mcc).setEnableAdminConsole(false);
+
} catch (Exception e) {
log("deployServices failed", e);
throw new Exception("Failed to deploy services: " +
ThrowableUtil.getAllMessages(e));
Show replies by date