[rhq] Branch 'mazz/test-rhq-on-as7' - modules/enterprise

mazz mazz at fedoraproject.org
Wed Aug 1 21:39:20 UTC 2012


 modules/enterprise/server/appserver/src/main/downloadable-resources/cli-alert-scripts/fix-bundle-deployment.js                    |  484 ++++++++++
 modules/enterprise/server/appserver/src/main/downloadable-resources/connectors/README.txt                                         |   22 
 modules/enterprise/server/appserver/src/main/resources/alert-scripts/README.txt                                                   |    2 
 modules/enterprise/server/appserver/src/main/resources/alert-scripts/example.rb                                                   |   16 
 modules/enterprise/server/appserver/src/main/resources/etc/RHQ-mib.txt                                                            |  135 ++
 modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/WEB-INF/jboss-web.xml |    5 
 modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/WEB-INF/web.xml       |   20 
 modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/index.html            |   17 
 modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/start.jsf             |   13 
 modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/welcome.jsf           |   13 
 modules/enterprise/server/appserver/src/main/resources/plugins/README.txt                                                         |    7 
 modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml                                                      |   35 
 12 files changed, 762 insertions(+), 7 deletions(-)

New commits:
commit e19c29ad30125b9ab30cb6db47a445137fbf3420
Author: John Mazzitelli <mazz at redhat.com>
Date:   Wed Aug 1 17:39:17 2012 -0400

    more container build stuff

diff --git a/modules/enterprise/server/appserver/src/main/downloadable-resources/cli-alert-scripts/fix-bundle-deployment.js b/modules/enterprise/server/appserver/src/main/downloadable-resources/cli-alert-scripts/fix-bundle-deployment.js
new file mode 100644
index 0000000..5dba002
--- /dev/null
+++ b/modules/enterprise/server/appserver/src/main/downloadable-resources/cli-alert-scripts/fix-bundle-deployment.js
@@ -0,0 +1,484 @@
+/**
+ * Using this script one can automatically reset a bundle deployment to a specified version.
+ * 
+ * This script consists of several utility methods originally included in standalone files
+ * in the samples of the CLI distribution, which have been included in this file so that it
+ * is usable on its own even in the server environment.
+ * 
+ * The configuration of the bundle and its version to reset to is located at the top of this file. 
+ * Please provide the values to the variables as instructed to make this script work in 
+ * a concrete situation.
+ */
+
+//----------------------------- script configuration
+
+/**
+ * Replace the "null" with the ID of the bundle destination you want to reset.
+ * 
+ * The ID of the destination can be determined from the URL. If you navigate to 
+ * some destination of a bundle, the destination ID is the number at the very
+ * end of the URL in the address bar of your browser. 
+ * 
+ * It can also be determined programmatically using the remote API of the RHQ 
+ * server but that is beyond the scope of this comment. 
+ */
+var destinationId = null; 
+
+/**
+ * Replace the "null" with the ID of the bundle version the deployment should be reset to.
+ * 
+ * As with the destinations, the ID of a bundle version can be determined in the GUI by
+ * examining the URL. If you navigate to some version of a bundle, the bundle version ID is
+ * the very last number in the URL in the address bar of the browser. 
+ */
+var bundleVersionId = null;
+
+/**
+ * A deployment of the bundle version may require configuration. 
+ * Normally, this can be provided as a simple javascript object (using the curly braces notation). 
+ * Each key in the object corresponds to a name of one "rhq:input-property" in the
+ * recipe of the bundle.
+ * 
+ * For example, if your deploy.xml recipe contains the following input properties:
+ * 
+ * <rhq:input-property type="string" name="my-string-property" />
+ * <rhq:input-property type="boolean" name="my-bool-property" />
+ * <rhq:input-property type="integer" name="my-int-property" />
+ * 
+ * You would provide values for those properties as:
+ * 
+ * var deploymentConfig = {
+ *     "my-string-property" : "value",
+ *     "my-bool-property" : false,
+ *     "my-int-property" : 42
+ * };
+ * 
+ * 
+ * Note that the bundle recipes support only a limited set of types of these properties.
+ * Please consult the provisioning subsystem documentation for a complete coverage of the bundle recipe
+ * capabilities.
+ */
+var deploymentConfig = null;
+
+/**
+ * The description of the deployment that will be performed.
+ */
+var description = "redeploy due to drift";
+
+// DO NOT TOUCH THIS UNLESS YOU FULLY UNDERSTAND WHAT YOU ARE DOING.
+// NOTE: It's essential that isCleanDeployment=true, otherwise files that have drifted will not be replaced with their
+//       original versions from the bundle.
+var isCleanDeployment = true;
+
+//-------------------- util.js 
+
+/**
+ * If obj is a JS array or a java.util.Collection, each element is passed to
+ * the callback function. If obj is a java.util.Map, each map entry is passed
+ * to the callback function as a key/value pair. If obj is none of the
+ * aforementioned types, it is treated as a generic object and each of its
+ * properties is passed to the callback function as a name/value pair.
+ */
+function foreach(obj, fn) {
+  if (obj instanceof Array) {
+    for (i in obj) {
+      fn(obj[i]);
+    }
+  }
+  else if (obj instanceof java.util.Collection) {
+    var iterator = obj.iterator();
+    while (iterator.hasNext()) {
+      fn(iterator.next());
+    }
+  }
+  else if (obj instanceof java.util.Map) {
+    var iterator = obj.entrySet().iterator()
+    while (iterator.hasNext()) {
+      var entry = iterator.next();
+      fn(entry.key, entry.value);
+    }
+  }
+  else {   // assume we have a generic object
+    for (i in obj) {
+      fn(i, obj[i]);
+    }
+  }
+}
+
+/**
+ * Iterates over obj similar to foreach. fn should be a predicate that evaluates
+ * to true or false. The first match that is found is returned.
+ */
+function find(obj, fn) {
+  if (obj instanceof Array) {
+    for (i in obj) {
+      if (fn(obj[i])) {
+        return obj[i]
+      }
+    }
+  }
+  else if (obj instanceof java.util.Collection) {
+    var iterator = obj.iterator();
+    while (iterator.hasNext()) {
+      var next = iterator.next();
+      if (fn(next)) {
+        return next;
+      }
+    }
+  }
+  else if (obj instanceof java.util.Map) {
+    var iterator = obj.entrySet().iterator();
+    while (iterator.hasNext()) {
+      var entry = iterator.next();
+      if (fn(entry.key, entry.value)) {
+        return {key: entry.key, value: entry.value};
+      }
+    }
+  }
+  else {
+    for (i in obj) {
+      if (fn(i, obj[i])) {
+        return {key: i, value: obj[i]};
+      }
+    }
+  }
+  return null;
+}
+
+/**
+ * Iterates over obj similar to foreach. fn should be a predicate that evaluates
+ * to true or false. All of the matches are returned in a java.util.List.
+ */
+function findAll(obj, fn) {
+  var matches = java.util.ArrayList();
+  if ((obj instanceof Array) || (obj instanceof java.util.Collection)) {
+    foreach(obj, function(element) {
+      if (fn(element)) {
+        matches.add(element);
+      }
+    });
+  }
+  else {
+    foreach(obj, function(key, value) {
+      if (fn(theKey, theValue)) {
+        matches.add({key: theKey, value: theValue});
+      }
+    });
+  }
+  return matches;
+}
+
+/**
+ * A convenience function to convert javascript hashes into RHQ's configuration
+ * objects.
+ * <p>
+ * The conversion of individual keys in the hash follows these rules:
+ * <ol>
+ * <li> if a value of a key is a javascript array, it is interpreted as PropertyList
+ * <li> if a value is a hash, it is interpreted as a PropertyMap
+ * <li> otherwise it is interpreted as a PropertySimple
+ * <li> a null or undefined value is ignored
+ * </ol>
+ * <p>
+ * Note that the conversion isn't perfect, because the hash does not contain enough
+ * information to restore the names of the list members.
+ * <p>
+ * Example: <br/>
+ * <pre><code>
+ * {
+ *   simple : "value",
+ *   list : [ "value1", "value2"],
+ *   listOfMaps : [ { k1 : "value", k2 : "value" }, { k1 : "value2", k2 : "value2" } ]
+ * }
+ * </code></pre>
+ * gets converted to a configuration object:
+ * Configuration:
+ * <ul>
+ * <li> PropertySimple(name = "simple", value = "value")
+ * <li> PropertyList(name = "list")
+ *      <ol>
+ *      <li>PropertySimple(name = "list", value = "value1")
+ *      <li>PropertySimple(name = "list", value = "value2")
+ *      </ol>
+ * <li> PropertyList(name = "listOfMaps")
+ *      <ol>
+ *      <li> PropertyMap(name = "listOfMaps")
+ *           <ul>
+ *           <li>PropertySimple(name = "k1", value = "value")
+ *           <li>PropertySimple(name = "k2", value = "value")
+ *           </ul>
+ *      <li> PropertyMap(name = "listOfMaps")
+ *           <ul>
+ *           <li>PropertySimple(name = "k1", value = "value2")
+ *           <li>PropertySimple(name = "k2", value = "value2")
+ *           </ul>
+ *      </ol>
+ * </ul>
+ * Notice that the members of the list have the same name as the list itself
+ * which generally is not the case.
+ */
+function asConfiguration(hash) {
+
+	config = new Configuration;
+
+	for(key in hash) {
+		value = hash[key];
+
+		if (value == null) {
+			continue;
+		}
+
+		(function(parent, key, value) {
+			function isArray(obj) {
+				return typeof(obj) == 'object' && (obj instanceof Array);
+			}
+
+			function isHash(obj) {
+				return typeof(obj) == 'object' && !(obj instanceof Array);
+			}
+
+			function isPrimitive(obj) {
+				return typeof(obj) != 'object';
+			}
+
+			//this is an anonymous function, so the only way it can call itself
+			//is by getting its reference via argument.callee. Let's just assign
+			//a shorter name for it.
+			var me = arguments.callee;
+
+			var prop = null;
+
+			if (isPrimitive(value)) {
+				prop = new PropertySimple(key, new java.lang.String(value));
+			} else if (isArray(value)) {
+				prop = new PropertyList(key);
+				for(var i = 0; i < value.length; ++i) {
+					var v = value[i];
+					if (v != null) {
+						me(prop, key, v);
+					}
+				}
+			} else if (isHash(value)) {
+				prop = new PropertyMap(key);
+				for(var i in value) {
+					var v = value[i];
+					if (value != null) {
+						me(prop, i, v);
+					}
+				}
+			}
+
+			if (parent instanceof PropertyList) {
+				parent.add(prop);
+			} else {
+				parent.put(prop);
+			}
+		})(config, key, value);
+	}
+
+	return config;
+}
+
+/**
+ * Opposite of <code>asConfiguration</code>. Converts an RHQ's configuration object
+ * into a javascript hash.
+ *
+ * @param configuration
+ */
+function asHash(configuration) {
+	ret = {}
+
+	iterator = configuration.getMap().values().iterator();
+	while(iterator.hasNext()) {
+		prop = iterator.next();
+
+		(function(parent, prop) {
+			function isArray(obj) {
+				return typeof(obj) == 'object' && (obj instanceof Array);
+			}
+
+			function isHash(obj) {
+				return typeof(obj) == 'object' && !(obj instanceof Array);
+			}
+
+			var me = arguments.callee;
+
+			var representation = null;
+
+			if (prop instanceof PropertySimple) {
+				representation = prop.stringValue;
+			} else if (prop instanceof PropertyList) {
+				representation = [];
+
+				for(var i = 0; i < prop.list.size(); ++i) {
+					var child = prop.list.get(i);
+					me(representation, child);
+				}
+			} else if (prop instanceof PropertyMap) {
+				representation = {};
+
+				var childIterator = prop.getMap().values().iterator();
+				while(childIterator.hasNext()) {
+					var child = childIterator.next();
+
+					me(representation, child);
+				}
+			}
+
+			if (isArray(parent)) {
+				parent.push(representation);
+			} else if (isHash(parent)) {
+				parent[prop.name] = representation;
+			}
+		})(ret, prop);
+	}
+	(function(parent) {
+
+	})(configuration);
+
+	return ret;
+}
+
+//------------------------------ bundles.js
+
+/**
+ * A simple function to create a new bundle version from a zip file containing
+ * the bundle.
+ * 
+ * @param pathToBundleZipFile the path to the bundle on the local file system
+ * 
+ * @return an instance of BundleVersion class describing what's been created on 
+ * the RHQ server.
+ */
+function createBundleVersion(pathToBundleZipFile) {
+	var bytes = getFileBytes(pathToBundleZipFile)
+	return BundleManager.createBundleVersionViaByteArray(bytes)
+}
+
+/**
+ * This is a helper function that one can use to find out what base directories
+ * given resource type defines.
+ * <p>
+ * These base directories then can be used when specifying bundle destinations.
+ * 
+ * @param resourceTypeId
+ * @returns a java.util.Set of ResourceTypeBundleConfiguration objects
+ */
+function getAllBaseDirectories(resourceTypeId) {
+	var crit = new ResourceTypeCriteria;
+	crit.addFilterId(resourceTypeId);
+	crit.fetchBundleConfiguration(true);
+	
+	var types = ResourceTypeManager.findResourceTypesByCriteria(crit);
+	
+	if (types.size() == 0) {
+		throw "Could not find a resource type with id " + resourceTypeId;
+	} else if (types.size() > 1) {
+		throw "More than one resource type found with id " + resourceTypeId + "! How did that happen!";
+	}
+	
+	var type = types.get(0);
+	
+	return type.getResourceTypeBundleConfiguration().getBundleDestinationBaseDirectories();
+}
+
+/**
+ * Creates a new destination for given bundle. Once a destination exists,
+ * actual bundle versions can be deployed to it.
+ * <p>
+ * Note that this only differs from the <code>BundleManager.createBundleDestination</code>
+ * method in the fact that one can provide bundle and resource group names instead of their
+ * ids.
+ * 
+ * @param destinationName the name of the destination to be created
+ * @param description the description for the destination
+ * @param bundleName the name of the bundle to create the destination for
+ * @param groupName name of a group of resources that the destination will handle
+ * @param baseDirName the name of the basedir definition that represents where inside the 
+ *                    deployment of the individual resources the bundle will get deployed
+ * @param deployDir the specific sub directory of the base dir where the bundles will get deployed
+ * 
+ * @return BundleDestination object
+ */
+function createBundleDestination(destinationName, description, bundleName, groupName, baseDirName, deployDir) {
+	var groupCrit = new ResourceGroupCriteria;
+	groupCrit.addFilterName(groupName);
+	var groups = ResourceGroupManager.findResourceGroupsByCriteria(groupCrit);
+	
+	if (groups.empty) {
+		throw "No group called '" + groupName + "' found.";
+	}
+	
+	var group = groups.get(0);
+	
+	var bundleCrit = new BundleCriteria;
+	bundleCrit.addFilterName(bundleName);
+	var bundles = BundleManager.findBundlesByCriteria(bundleCrit);
+	
+	if (bundles.empty) {
+		throw "No bundle called '" + bundleName + "' found.";
+	}
+	
+	var bundle = bundles.get(0);
+	
+	return BundleManager.createBundleDestination(bundle.id, destinationName, description, baseDirName, deployDir, group.id);
+}
+
+/**
+ * Tries to deploy given bundle version to provided destination using given configuration.
+ * <p>
+ * This method blocks while waiting for the deployment to complete or fail.
+ * 
+ * @param destination the bundle destination (or id thereof)
+ * @param bundleVersion the bundle version to deploy (or id thereof)
+ * @param deploymentConfiguration the deployment configuration. This can be an ordinary
+ * javascript object (hash) or an instance of RHQ's Configuration. If it is the former,
+ * it is converted to a Configuration instance using the <code>asConfiguration</code>
+ * function from <code>util.js</code>. Please consult the documentation of that method
+ * to understand the limitations of that approach.
+ * @param description the deployment description
+ * @param isCleanDeployment if true, perform a wipe of the deploy directory prior to the deployment; if false,
+ * perform as an upgrade to the existing deployment, if any
+ * 
+ * @return the BundleDeployment instance describing the deployment
+ */
+function deployBundle(destination, bundleVersion, deploymentConfiguration, description, isCleanDeployment) {
+	var destinationId = destination;
+	if (typeof(destination) == 'object') {
+		destinationId = destination.id;
+	}
+	
+	var bundleVersionId = bundleVersion;
+	if (typeof(bundleVersion) == 'object') {
+		bundleVersionId = bundleVersion.id;
+	}
+	
+	var deploymentConfig = deploymentConfiguration;
+	if (!(deploymentConfiguration instanceof Configuration)) {
+		deploymentConfig = asConfiguration(deploymentConfiguration);
+	}
+	
+	var deployment = BundleManager.createBundleDeployment(bundleVersionId, destinationId, description, deploymentConfig);
+	
+	deployment = BundleManager.scheduleBundleDeployment(deployment.id, isCleanDeployment);
+	
+	var crit = new BundleDeploymentCriteria;
+	crit.addFilterId(deployment.id);
+	
+	while (deployment.status == BundleDeploymentStatus.PENDING || deployment.status == BundleDeploymentStatus.IN_PROGRESS) {
+		java.lang.Thread.currentThread().sleep(1000);
+		var dps = BundleManager.findBundleDeploymentsByCriteria(crit);
+		if (dps.empty) {
+			throw "The deployment disappeared while we were waiting for it to complete.";
+		}
+		
+		deployment = dps.get(0);
+	}
+	
+	return deployment;
+}
+
+//------------------- script body
+
+deployBundle(destinationId, bundleVersionId, deploymentConfig, description, isCleanDeployment);
+
diff --git a/modules/enterprise/server/appserver/src/main/downloadable-resources/connectors/README.txt b/modules/enterprise/server/appserver/src/main/downloadable-resources/connectors/README.txt
new file mode 100644
index 0000000..c1dc783
--- /dev/null
+++ b/modules/enterprise/server/appserver/src/main/downloadable-resources/connectors/README.txt
@@ -0,0 +1,22 @@
+This directory contains connectors that instrument various products to expose
+monitoring data. This monitoring data can then be accessed by the RHQ plugins
+corresponding to those products.
+
+HTTP Response Time Filter
+--------------------------
+This is a servlet filter that can measure response times for HTTP requests
+made to servlets and write the response times to a logfile. The filter is
+compatible with any servlet 2.4 or later container running on Java 1.4 or 
+later. However, since upport for parsing the response time logfiles is
+only provided by the jboss-as, jboss-as-5, jboss-as-7, and tomcat RHQ 
+plugins, it typically is only of value to deploy the filter to JBoss AS
+or Tomcat.
+
+Note, a commons-logging jar is supplied for use with Tomcat 6. It is not 
+required for earlier versions of Tomcat, since they already include that jar.
+
+For details on how to deploy the filter to various versions of JBoss AS and
+Tomcat, see:
+
+https://docs.jboss.org/author/display/RHQ/Managed+Product+Configuration
+
diff --git a/modules/enterprise/server/appserver/src/main/resources/alert-scripts/README.txt b/modules/enterprise/server/appserver/src/main/resources/alert-scripts/README.txt
new file mode 100644
index 0000000..7675cbf
--- /dev/null
+++ b/modules/enterprise/server/appserver/src/main/resources/alert-scripts/README.txt
@@ -0,0 +1,2 @@
+This directory contains scripts for the scriptlang alert sender.
+Currently JRuby and JavaScript are supported.
\ No newline at end of file
diff --git a/modules/enterprise/server/appserver/src/main/resources/alert-scripts/example.rb b/modules/enterprise/server/appserver/src/main/resources/alert-scripts/example.rb
new file mode 100644
index 0000000..3a01100
--- /dev/null
+++ b/modules/enterprise/server/appserver/src/main/resources/alert-scripts/example.rb
@@ -0,0 +1,16 @@
+
+require 'java'
+
+def sendAlert(alert, url, conditions)
+
+  puts alert.alertDefinition.name
+  puts url
+  puts conditions
+
+  result = org.rhq.enterprise.server.plugin.pc.alert.SenderResult.new
+  state = org.rhq.enterprise.server.plugin.pc.alert.ResultState::SUCCESS
+  result.setState(state)
+  result.setMessage("Sending via ruby succeeded")
+
+  return result
+end
\ No newline at end of file
diff --git a/modules/enterprise/server/appserver/src/main/resources/etc/RHQ-mib.txt b/modules/enterprise/server/appserver/src/main/resources/etc/RHQ-mib.txt
new file mode 100644
index 0000000..ced6071
--- /dev/null
+++ b/modules/enterprise/server/appserver/src/main/resources/etc/RHQ-mib.txt
@@ -0,0 +1,135 @@
+RHQ-MIB DEFINITIONS ::= BEGIN
+
+IMPORTS
+    MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE, snmpModules, enterprises
+        FROM SNMPv2-SMI
+    coldStart
+        FROM SNMPv2-MIB
+    OBJECT-GROUP, NOTIFICATION-GROUP, MODULE-COMPLIANCE
+        FROM SNMPv2-CONF
+    DisplayString
+        FROM SNMPv2-TC;
+
+rhqMIB MODULE-IDENTITY
+    LAST-UPDATED    "201112200000Z"
+    ORGANIZATION    "RHQ-Project"
+    CONTACT-INFO    "http://www.jboss.org/rhq"
+    DESCRIPTION
+        "The MIB module for RHQ alerts.
+
+        This file is part of the RHQ management platform
+        Copyright (C) 2005-2012 Red Hat, Inc.
+        All rights reserved.
+    "
+
+    REVISION        "200807110000Z"
+    DESCRIPTION     "Initial version"
+    REVISION        "201010180000Z"
+    DESCRIPTION     "Better trap support"
+    REVISION        "201112200000Z"
+    DESCRIPTION     "Also emit resource lineage"
+    ::= { snmpModules 1 }
+
+jboss       OBJECT IDENTIFIER ::= {enterprises 18016 }
+
+rhq         OBJECT IDENTIFIER ::= {jboss 2 }
+
+alert       OBJECT IDENTIFIER ::= {rhq 1 }
+
+
+alertName OBJECT-TYPE
+    SYNTAX      DisplayString (SIZE (0..255))
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "The name of the alert definition for this alert"
+    ::= { alert 1 }
+
+alertResourceName   OBJECT-TYPE
+    SYNTAX      DisplayString (SIZE (0..255))
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "The name of the resource that triggered the alert"
+    ::= { alert 2 }
+
+
+alertPlatformName      OBJECT-TYPE
+    SYNTAX      DisplayString (SIZE (0..255))
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "The name of the platform hosting the resource"
+    ::= { alert 3 }
+
+
+alertCondition      OBJECT-TYPE
+    SYNTAX      DisplayString (SIZE (0..4096))
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "The conditions leading to the alert"
+    ::= { alert 4 }
+
+alertSeverity       OBJECT-TYPE
+    SYNTAX      DisplayString (SIZE (0..255))
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "Severity of the alert."
+    ::= { alert 5 }
+
+alertUrl        OBJECT-TYPE
+    SYNTAX      DisplayString (SIZE (0..1024))
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "The url of the individual alert"
+    ::= { alert 6 }
+
+alertHierarchy        OBJECT-TYPE
+    SYNTAX      DisplayString (SIZE (0..1024))
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "The hierarchy of the resource that triggered the alert"
+    ::= { alert 6 }
+
+-- conformance information
+
+snmpMIBConformance
+               OBJECT IDENTIFIER ::= { rhqMIB 2 }
+
+snmpMIBCompliances
+               OBJECT IDENTIFIER ::= { snmpMIBConformance 1 }
+snmpMIBGroups  OBJECT IDENTIFIER ::= { snmpMIBConformance 2 }
+
+-- compliance statements
+
+snmpBasicCompliance MODULE-COMPLIANCE
+    STATUS  current
+    DESCRIPTION "TODO"
+    MODULE
+        MANDATORY-GROUPS { alertGroup, trapGroup }
+
+    ::= { snmpMIBCompliances 2 }
+
+alertGroup OBJECT-GROUP
+    OBJECTS {   alertName,
+                alertResourceName,
+                alertPlatformName,
+                alertCondition,
+                alertSeverity,
+                alertUrl,
+                alertHierarchy }
+    STATUS  current
+    DESCRIPTION "A collection of objects providing information about an alert"
+    ::= { snmpMIBGroups 1 }
+
+trapGroup NOTIFICATION-GROUP
+    NOTIFICATIONS { coldStart }
+    STATUS  current
+    DESCRIPTION "A collection of notifications for alerts"
+    ::= { snmpMIBGroups 2 }
+
+END
diff --git a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war.skipdeploy b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war.skipdeploy
new file mode 100644
index 0000000..e69de29
diff --git a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/WEB-INF/jboss-web.xml b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/WEB-INF/jboss-web.xml
new file mode 100644
index 0000000..493bdbf
--- /dev/null
+++ b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/WEB-INF/jboss-web.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+
+<jboss-web>
+   <context-root>/installer</context-root>
+</jboss-web>
diff --git a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/WEB-INF/web.xml b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/WEB-INF/web.xml
new file mode 100644
index 0000000..c6bd385
--- /dev/null
+++ b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/WEB-INF/web.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+         version="2.5">
+
+   <display-name>Post Installer Notification</display-name>
+   <description>Post Installer Notification</description>
+
+   <mime-mapping> 
+      <extension>jsf</extension> 
+      <mime-type>text/html</mime-type> 
+   </mime-mapping>
+
+   <welcome-file-list>
+      <welcome-file>/index.html</welcome-file>
+   </welcome-file-list>
+
+</web-app>
diff --git a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/index.html b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/index.html
new file mode 100644
index 0000000..5da4047
--- /dev/null
+++ b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/index.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>The Server Is Installed!</title>
+
+<meta http-equiv="Pragma"        content="no-cache" />
+<meta http-equiv="Expires"       content="-1" />
+<meta http-equiv="Cache-control" content="no-cache" />
+
+</head>
+<body>
+   <p>&nbsp;</p>
+   <h1 align="center">The Server Is Installed!</h1>
+   <p align="center"><a href="/coregui">Click here to get started!</a></p>
+</body>
+</html>
diff --git a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/start.jsf b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/start.jsf
new file mode 100644
index 0000000..4e5a220
--- /dev/null
+++ b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/start.jsf
@@ -0,0 +1,13 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>The Server Is Installed!</title>
+
+</head>
+<body>
+   <p>&nbsp;</p>
+   <h1 align="center">The Server Is Installed!</h1>
+   <p align="center"><a href="/coregui">Click here to get started!</a></p>
+</body>
+</html>
diff --git a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/welcome.jsf b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/welcome.jsf
new file mode 100644
index 0000000..4e5a220
--- /dev/null
+++ b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/welcome.jsf
@@ -0,0 +1,13 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>The Server Is Installed!</title>
+
+</head>
+<body>
+   <p>&nbsp;</p>
+   <h1 align="center">The Server Is Installed!</h1>
+   <p align="center"><a href="/coregui">Click here to get started!</a></p>
+</body>
+</html>
diff --git a/modules/enterprise/server/appserver/src/main/resources/plugins/README.txt b/modules/enterprise/server/appserver/src/main/resources/plugins/README.txt
new file mode 100644
index 0000000..8189194
--- /dev/null
+++ b/modules/enterprise/server/appserver/src/main/resources/plugins/README.txt
@@ -0,0 +1,7 @@
+You can copy agent plugins or server plugins to this directory.
+
+When the server is running, it will periodically scan this
+directory and hot-deploy the plugins it finds.
+
+The jar files will be removed from this directory after they have
+been detected.
\ No newline at end of file
diff --git a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
index eded774..5cb56a5 100644
--- a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
+++ b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
@@ -199,10 +199,27 @@
         <delete dir="${jboss.home}/standalone/tmp" />
         <delete dir="${jboss.home}/standalone/work" /> <!-- TODO: does AS7 still have this? -->
 
-        <echo>Delete unused configurations</echo>
-        <delete file="${jboss.home}/standalone/configuration/standalone-ha.xml" />
-        <delete file="${jboss.home}/standalone/configuration/standalone-full.xml" />
-        <delete file="${jboss.home}/standalone/configuration/standalone-full-ha.xml" />
+        <echo>Delete unused configurations and other files</echo>
+        <delete>
+            <fileset dir="${jboss.home}/standalone/configuration">
+                <include name="standalone-ha.xml" />
+                <include name="standalone-full.xml" />
+                <include name="standalone-full-ha.xml" />
+            </fileset>
+        </delete>
+        <delete>
+            <fileset dir="${jboss.home}/bin/">
+                <include name="add-user.*" />
+                <include name="appclient.*" />
+                <include name="domain.*" />
+                <include name="jconsole.*" />
+                <include name="run.*" />
+                <include name="vault.*" />
+                <include name="wsconsume.*" />
+                <include name="wsprovide.*" />
+            </fileset>
+        </delete>
+        <delete dir="${jboss.home}/bin/init.d" />
 
         <!-- TODO: we need to put Quartz in the ear and deploy a scheduler sar -->
         <!--
@@ -217,11 +234,13 @@
         <mkdir dir="${jboss.deploy.dir}/${rhq.earName}" />
         <unjar src="${settings.localRepository}/org/rhq/rhq-enterprise-server-ear/${rhq.version}/rhq-enterprise-server-ear-${rhq.version}.ear"
                dest="${jboss.deploy.dir}/${rhq.earName}" />
+        <touch file="${jboss.deploy.dir}/${rhq.earName}.skipdeploy" />
 
         <echo>Deploying installer webapp ...</echo>
-        <mkdir dir="${jboss.deploy.dir}/rhq-installer.war" />
-        <unwar src="${settings.localRepository}/org/rhq/rhq-installer/${rhq.version}/rhq-installer-${rhq.version}.war"
-               dest="${jboss.deploy.dir}/rhq-installer.war" />
+        <mkdir dir="${jboss.deploy.dir}/rhq-gwt-installer-war.war" />
+        <unwar src="${settings.localRepository}/org/rhq/rhq-gwt-installer-war/${rhq.version}/rhq-gwt-installer-war-${rhq.version}.war"
+               dest="${jboss.deploy.dir}/rhq-gwt-installer-war.war" />
+        <touch file="${jboss.deploy.dir}/rhq-gwt-installer-war.war.dodeploy" />
 
         <!-- TODO: deploy embedded agent sar -->
         <!--
@@ -556,6 +575,8 @@ rhq.autoinstall.public-endpoint-address=
 
     <target name="developer-release-message" if="predeploy">
         <echo>!!THIS IS A DEVELOPER CONTAINER BUILD - PRE-DEPLOYING RHQ SERVER!!</echo>
+        <!-- TODO I don't think we can skip the installer stage - but we can turn on auto-installation -->
+        <!-- So in here we should set rhq.autoinstall.enabled=true in rhq-server.properties --> 
     </target>
 
     <!-- TODO: when we ship with an embedded agent -->




More information about the rhq-commits mailing list