[rhq] Changes to 'release_jon3.0.x'
by mazz
New branch 'release_jon3.0.x' available with the following commits:
commit e787d400e1d2359f732d545ce75887c7d7d685a2
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Dec 13 13:46:12 2011 -0500
[BZ 767263] don't assume there is always a template
12 years, 3 months
[rhq] Branch 'feature/gwt-upgrade' - 2 commits - modules/enterprise
by mike thompson
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java | 27 ++++++++--
1 file changed, 22 insertions(+), 5 deletions(-)
New commits:
commit 053dbbdd57305468cd10c35dfb0e586c4631b0ab
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Mon Jan 30 11:18:24 2012 -0800
[BZ734197]-Improvement: Dynagroup creation should provide better error msg for duplicate name. Delete logging.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java
index a9d41fc..f55c37a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java
@@ -83,7 +83,6 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
-import com.allen_sauer.gwt.log.client.Log;
/**
* @author Joseph Marques
@@ -202,9 +201,7 @@ public class SingleGroupDefinitionView extends LocatableVLayout implements Bookm
Map.Entry thisEntry = (Map.Entry) entryObject;
String fieldKey = (String) thisEntry.getKey();
// the duplicate name error will be keyed by 'name' in the errorMap
- Log.debug("there were errors");
if (fieldKey.equals("name")) {
- Log.debug("found name error key");
String errorValue = (String) thisEntry.getValue();
CoreGUI.getErrorHandler().handleError(errorValue);
hasDuplicateNameError = true;
commit 26a4e740cdec5e690ac99453c73eecb18f2c6c97
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Mon Jan 30 10:42:38 2012 -0800
[BZ734197]-Improvement: Dynagroup creation should provide better error msg for duplicate name.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java
index 96d3702..a9d41fc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java
@@ -24,9 +24,7 @@ import static org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGro
import static org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupDataSourceField.PLUGIN;
import static org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupDataSourceField.TYPE;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Set;
+import java.util.*;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -85,6 +83,8 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
+import com.allen_sauer.gwt.log.client.Log;
+
/**
* @author Joseph Marques
*/
@@ -192,11 +192,31 @@ public class SingleGroupDefinitionView extends LocatableVLayout implements Bookm
form.saveData(new DSCallback() {
@Override
public void execute(DSResponse response, Object rawData, DSRequest request) {
+ boolean hasDuplicateNameError = false;
if (form.isNewRecord()) {
Record[] results = response.getData();
if (results.length != 1) {
- CoreGUI.getErrorHandler().handleError(
- MSG.view_dynagroup_singleSaveFailure(String.valueOf(results.length)));
+
+ // handle the special case for name already exists error
+ for (Object entryObject : response.getErrors().entrySet()) {
+ Map.Entry thisEntry = (Map.Entry) entryObject;
+ String fieldKey = (String) thisEntry.getKey();
+ // the duplicate name error will be keyed by 'name' in the errorMap
+ Log.debug("there were errors");
+ if (fieldKey.equals("name")) {
+ Log.debug("found name error key");
+ String errorValue = (String) thisEntry.getValue();
+ CoreGUI.getErrorHandler().handleError(errorValue);
+ hasDuplicateNameError = true;
+ }
+ }
+
+ if(!hasDuplicateNameError){
+ CoreGUI.getErrorHandler().handleError(
+ MSG.view_dynagroup_singleSaveFailure(String.valueOf(results.length)));
+ }
+
+
} else {
Record newRecord = results[0];
GroupDefinition newGroupDefinition = GroupDefinitionDataSource.getInstance().copyValues(
12 years, 3 months
[rhq] .classpath
by mazz
.classpath | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 8e4ea4f7a28dd0f877e909941615136af85d1b4b
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Jan 30 10:18:16 2012 -0500
[BZ 703557] eclipse has to be told where tools.jar is in order to build the jmx plugin
diff --git a/.classpath b/.classpath
index 9eaf31b..e20fe75 100644
--- a/.classpath
+++ b/.classpath
@@ -124,7 +124,8 @@
<classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/resteasy/resteasy-jaxrs/2.2.1.GA/resteasy-jaxrs-2.2.1.GA.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/resteasy/resteasy-jettison-provider/2.2.1.GA/resteasy-jettison-provider-2.2.1.GA.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/resteasy/jaxrs-api/2.2.1.GA/jaxrs-api-2.2.1.GA.jar"/>
- <classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/sasl/jboss-sasl/1.0.0.Beta9/jboss-sasl-1.0.0.Beta9.jar"/>
+ <classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/sasl/jboss-sasl/1.0.0.Beta9/jboss-sasl-1.0.0.Beta9.jar"/>
+ <classpathentry exported="true" kind="var" path="JDK_HOME/lib/tools.jar"/>
<classpathentry kind="src" path="modules/common/ant-bundle/src/main/java"/>
<classpathentry kind="src" path="modules/enterprise/server/itests/src/test/java"/>
<classpathentry kind="src" path="modules/enterprise/server/plugins/drift-mongodb/src/main/java"/>
12 years, 3 months
[rhq] modules/enterprise modules/plugins
by Heiko W. Rupp
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java | 26 ++++++++--
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DatasourceComponent.java | 2
modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml | 14 +----
3 files changed, 28 insertions(+), 14 deletions(-)
New commits:
commit 4073cfff186308efce9da4566b749c1076e91f7f
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon Jan 30 16:01:03 2012 +0100
BZ 758655 - more fixes.
BZ 767629 - filter, only allow .jar for jdbc drivers.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java
index 60550be..980d9e9 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java
@@ -25,6 +25,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import javax.ejb.EJB;
import javax.ejb.Stateless;
@@ -2511,6 +2513,11 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf
PropertyOptionsSource pos = pds.getOptionsSource();
PropertyOptionsSource.TargetType tt = pos.getTargetType();
String expression = pos.getExpression();
+ String filter = pos.getFilter();
+ Pattern filterPattern = null;
+ if (filter!=null)
+ filterPattern = Pattern.compile(filter);
+
if (tt == PropertyOptionsSource.TargetType.RESOURCE || tt == PropertyOptionsSource.TargetType.CONFIGURATION) {
ResourceCriteria criteria = new ResourceCriteria();
@@ -2533,10 +2540,21 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf
if (tt == PropertyOptionsSource.TargetType.RESOURCE) {
- PropertyDefinitionEnumeration pde = new PropertyDefinitionEnumeration(composite.getResource()
- .getName(), "" + composite.getResource().getName());
- // TODO filter -- or leave up to search expression??
- pds.getEnumeratedValues().add(pde);
+ String name = composite.getResource().getName();
+ // filter if the user provided a filter
+
+ if (filterPattern !=null ) {
+ Matcher m = filterPattern.matcher(name);
+ if (m.matches()) {
+ PropertyDefinitionEnumeration pde = new PropertyDefinitionEnumeration(name, "" + name);
+ pds.getEnumeratedValues().add(pde);
+ }
+ } else { // Filter is null -> none provided -> do not filter
+ PropertyDefinitionEnumeration pde = new PropertyDefinitionEnumeration(name, "" + name);
+ pds.getEnumeratedValues().add(pde);
+
+ }
+
} else if (tt == PropertyOptionsSource.TargetType.CONFIGURATION) {
// for configuration we need to drill down into the resource configuration
if (!handleConfigurationTarget(pds, expression, composite.getResource()))
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DatasourceComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DatasourceComponent.java
index 4a7c4cc..68c0bce 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DatasourceComponent.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DatasourceComponent.java
@@ -69,7 +69,7 @@ public class DatasourceComponent extends BaseComponent implements OperationFacet
addRequiredToOp(op,parameters,"jndi-name");
addOptionalToOp(op,parameters,"user-name");
addOptionalToOp(op,parameters,"password");
- addRequiredToOp(op,parameters,"xa-data-source-class");
+ addRequiredToOp(op,parameters,"xa-datasource-class");
Map<String,Object> props = new HashMap<String, Object>(); // TODO
op.addAdditionalProperty("xa-data-source-properties",props);
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index 3f29cce..3ef70c9 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -1017,7 +1017,7 @@
<parameters>
<c:simple-property name="name" required="true" description="Name of the datasource"/>
<c:simple-property name="driver-name" required="true">
- <c:option-source target="resource" expression="type=^Deployment$" filter="sameHierarchy"/>
+ <c:option-source target="resource" expression="type=^Deployment$" filter=".*\.jar"/>
</c:simple-property>
<c:simple-property name="jndi-name" description="JNDI-Name of the Datasource" required="true"/>
<c:simple-property name="connection-url" description="URL for the connection to the database" required="true"/>
@@ -1033,11 +1033,10 @@
<parameters>
<c:simple-property name="name" required="true" description="Name of the datasource"/>
<c:simple-property name="driver-name" required="true">
- <c:option-source target="resource" expression="type=^Deployment$"/>
+ <c:option-source target="resource" expression="type=^Deployment$" filter=".*\.jar"/>
</c:simple-property>
- <c:simple-property name="xa-data-source-class" required="true" description="xa-data-source-class"/>
+ <c:simple-property name="xa-datasource-class" required="true" description="xa-datasource-class"/>
<c:simple-property name="jndi-name" description="JNDI-Name of the Datasource" required="true"/>
- <!--<c:simple-property name="connection-url" description="URL for the connection to the database" required="true"/>-->
<c:simple-property name="user-name" description="User name for DB-connections" required="false" />
<c:simple-property name="password" description="Password" type="password" required="false"/>
<c:list-property name="xa-properties" displayName="XA Properties" description="Additional XA Properties" required="false">
@@ -1128,8 +1127,6 @@
description="Defines the JDBC driver the datasource should use with this format: driver-name>#major-version.minor-version where driver-name is the fully qualifed name of the JDBC driver class"/>
<c:simple-property name="new-connection-sql" type="string" readOnly="true" required="false"
description="Specifies an SQL statement to execute whenever a connection is added to the connection pool."/>
- <c:simple-property name="pool-name" type="string" readOnly="true"
- description="Specifies the pool name for the datasource used for management"/>
<c:simple-property name="url-delimiter" type="string" readOnly="true"
description="Specifies the delimeter for URLs in connection-url for HA datasources" required="false"/>
<c:simple-property name="url-selector-strategy-class-name" type="string" readOnly="true"
@@ -1273,11 +1270,10 @@
<metric property="DestroyedCount" description="The destroyed count" measurementType="trendsup"/>
<resource-configuration>
- <c:simple-property name="xa-data-source-class" required="true" type="string" readOnly="true" description="The fully qualifed name of the javax.sql.XADataSource implementation"/>
+ <c:simple-property name="xa-datasource-class" required="true" type="string" readOnly="true" description="The fully qualifed name of the javax.sql.XADataSource implementation"/>
<c:simple-property name="jndi-name" required="true" type="string" readOnly="true" description="Specifies the JNDI name for the datasource"/>
<c:simple-property name="driver-name" required="true" type="string" readOnly="true" description="Defines the JDBC driver the datasource should use. It is a symbolic name matching the the name of installed driver. In case the driver is deployed as jar, the name is the name of deployment unit"/>
<c:simple-property name="new-connection-sql" required="false" type="string" readOnly="true" description="Specifies an SQL statement to execute whenever a connection is added to the connection pool."/>
- <c:simple-property name="pool-name" required="false" type="string" readOnly="true" description="Specifies the pool name for the datasource used for management"/>
<c:simple-property name="url-delimiter" required="false" type="string" readOnly="true" description="Specifies the delimeter for URLs in connection-url for HA datasources"/>
<c:simple-property name="url-selector-strategy-class-name" required="false" type="string" readOnly="true" description="A class that implements org.jboss.jca.adapters.jdbc.URLSelectorStrategy"/>
<c:simple-property name="use-java-context" required="false" type="boolean" readOnly="true" description="Setting this to false will bind the DataSource into global JNDI;"/>
@@ -1286,7 +1282,7 @@
<c:simple-property name="min-pool-size" required="false" type="integer" readOnly="false" description="The min-pool-size element indicates the minimum number of connections a pool should hold. These are not created until a Subject is known from a request for a connection."/>
<c:simple-property name="pool-prefill" required="false" type="boolean" readOnly="false" description="Whether to attempt to prefill the connection pool. Changing this value require a server restart."/>
<c:simple-property name="pool-use-strict-min" required="false" type="boolean" readOnly="false" description="Define if the min-pool-size should be considered a strictly."/>
- <c:simple-property name="interliving" required="false" type="boolean" readOnly="true" description="An element to enable interleaving for XA connection factories"/>
+ <c:simple-property name="interleaving" required="false" type="boolean" readOnly="true" description="An element to enable interleaving for XA connection factories"/>
<c:simple-property name="no-tx-separate-pool" required="false" type="boolean" readOnly="true" description="Oracle does not like XA connections getting used both inside and outside a JTA transaction. To workaround the problem you can create separate sub-pools for the different context"/>
<c:simple-property name="pad-xid" required="false" type="boolean" readOnly="true" description="Should the Xid be padded"/>
<c:simple-property name="same-rm-override" required="false" type="boolean" readOnly="true" description="The is-same-rm-override element allows one to unconditionally set whether the javax.transaction.xa.XAResource.isSameRM(XAResource) returns true or false"/>
12 years, 3 months
[rhq] 3 commits - modules/enterprise modules/plugins
by Heiko W. Rupp
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/SystemSettingsView.java | 2 +-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 4 ++--
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DatasourceComponent.java | 4 ----
modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml | 4 +---
4 files changed, 4 insertions(+), 10 deletions(-)
New commits:
commit a8622b6e11a76be7558ef8561f475e827ff2a80c
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon Jan 30 13:57:15 2012 +0100
BZ 758655 - remove no longer needed attributes, as they were removed in AS7
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DatasourceComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DatasourceComponent.java
index 1a44230..4a7c4cc 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DatasourceComponent.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DatasourceComponent.java
@@ -55,7 +55,6 @@ public class DatasourceComponent extends BaseComponent implements OperationFacet
op = new Operation("add",theAddress);
addRequiredToOp(op,parameters,"driver-name");
addRequiredToOp(op,parameters,"jndi-name");
- addRequiredToOp(op, parameters, "pool-name");
addRequiredToOp(op, parameters, "connection-url");
addOptionalToOp(op, parameters, "user-name");
addOptionalToOp(op,parameters,"password");
@@ -68,14 +67,11 @@ public class DatasourceComponent extends BaseComponent implements OperationFacet
op = new Operation("add",theAddress);
addRequiredToOp(op,parameters,"driver-name");
addRequiredToOp(op,parameters,"jndi-name");
- addRequiredToOp(op,parameters,"pool-name");
- addRequiredToOp(op,parameters,"connection-url");
addOptionalToOp(op,parameters,"user-name");
addOptionalToOp(op,parameters,"password");
addRequiredToOp(op,parameters,"xa-data-source-class");
Map<String,Object> props = new HashMap<String, Object>(); // TODO
- props.put("_foo","_bar"); // TODO AS7-1209
op.addAdditionalProperty("xa-data-source-properties",props);
}
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index 2e6aba3..3f29cce 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -1021,7 +1021,6 @@
</c:simple-property>
<c:simple-property name="jndi-name" description="JNDI-Name of the Datasource" required="true"/>
<c:simple-property name="connection-url" description="URL for the connection to the database" required="true"/>
- <c:simple-property name="pool-name" description="Name of the pool" required="true"/>
<c:simple-property name="user-name" description="User name for DB-connections" required="false" />
<c:simple-property name="password" description="Password" type="password" required="false"/>
</parameters>
@@ -1038,8 +1037,7 @@
</c:simple-property>
<c:simple-property name="xa-data-source-class" required="true" description="xa-data-source-class"/>
<c:simple-property name="jndi-name" description="JNDI-Name of the Datasource" required="true"/>
- <c:simple-property name="connection-url" description="URL for the connection to the database" required="true"/>
- <c:simple-property name="pool-name" description="Name of the pool" required="true"/>
+ <!--<c:simple-property name="connection-url" description="URL for the connection to the database" required="true"/>-->
<c:simple-property name="user-name" description="User name for DB-connections" required="false" />
<c:simple-property name="password" description="Password" type="password" required="false"/>
<c:list-property name="xa-properties" displayName="XA Properties" description="Additional XA Properties" required="false">
commit 04f7e30401feb9cc210e075779792db1c08e02b6
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon Jan 30 12:05:16 2012 +0100
Small comment fix.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/SystemSettingsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/SystemSettingsView.java
index b5cf9e8..1badea3 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/SystemSettingsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/SystemSettingsView.java
@@ -438,7 +438,7 @@ public class SystemSettingsView extends LocatableVLayout implements PropertyValu
pd.setDescription(MSG.view_admin_systemSettings_BaselineDataSet_desc());
pd.setDisplayName(MSG.view_admin_systemSettings_BaselineDataSet_name());
pd.setPropertyGroupDefinition(baselineGroup);
- pd.addConstraints(new IntegerRangeConstraint(Long.valueOf(1), Long.valueOf(14))); // can't do more than 14 days since our raw tables don't hold more
+ pd.addConstraints(new IntegerRangeConstraint(Long.valueOf(1), Long.valueOf(14))); // can't do more than 14 days since our 1h table doesn't hold more
pd.setDefaultValue("7");
break;
commit 1bdc6262cd500351b67d5685562f3e54ab03e2ff
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon Jan 30 11:35:36 2012 +0100
Add a note about the max. allowed value.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index e96c012..8de2555 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -507,7 +507,7 @@ view_admin_downloads_bundle_link_label = Link
view_admin_downloads_bundle_link_value = Download Bundle Deployer {0}
view_admin_downloads_bundle_loadError = Cannot get bundle deployer info
view_admin_downloads_cliAlertScriptsDownload = CLI Alert Scripts Download
-view_admin_downloads_cliAlertScripts_help = CLI alert scripts are pre-canned scripts that can be used for creating scripted alert notifications. The scripts will usually require some tweaking before they can be used as a notification on a particular alert definition.
+view_admin_downloads_cliAlertScripts_help = CLI alert scripts are pre-canned scripts that can be used for creating scripted alert notifications. The scripts will usually require some tweaking before they can be used as a notification on a particular alert definition.
view_admin_downloads_cliAlertScripts_loadError = Cannot get info on available CLI alert scripts for download
view_admin_downloads_cliAlertScripts_none = No CLI alert scripts are available for download
view_admin_downloads_cliDownload = Command Line Client Download
@@ -587,7 +587,7 @@ view_admin_systemSettings_BaseURL_desc = A URL to the server GUI, used mainly wi
view_admin_systemSettings_BaseURL_name = GUI Console URL
view_admin_systemSettings_BaselineDataSet_desc = The amount of past measurement data that is used to determine a baseline. This is specified in days.
view_admin_systemSettings_BaselineDataSet_name = Baseline Dataset
-view_admin_systemSettings_BaselineFrequency_desc = The frequency which the auto-calculation of baselines will be performed. If 0, baseline auto-calculation is disabled. This is specified in days.
+view_admin_systemSettings_BaselineFrequency_desc = The frequency which the auto-calculation of baselines will be performed. If 0, baseline auto-calculation is disabled. This is specified in days. Maximum value is 'Baseline Dataset'.
view_admin_systemSettings_BaselineFrequency_name = Baseline Calculation Frequency
view_admin_systemSettings_DataMaintenance_desc = How often database maintenance is performed (for example, vacuuming if using Postgres). This is specified in hours.
view_admin_systemSettings_DataMaintenance_name = Database Maintenance Period
12 years, 3 months
[rhq] Branch 'feature/gwt-upgrade' - modules/enterprise
by mike thompson
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionDataSource.java | 11 +++++++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java | 7 ++----
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 2 -
3 files changed, 12 insertions(+), 8 deletions(-)
New commits:
commit 5754205a951d422363999a5853bf41a507e9fb0e
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Sun Jan 29 20:56:03 2012 -0800
BZ691505 Changing units of measure using minutes instead of millis for recalculation interval of DynaGroup.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionDataSource.java
index 04883bf..57c9947 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionDataSource.java
@@ -176,8 +176,10 @@ public class GroupDefinitionDataSource extends RPCDataSource<GroupDefinition, Re
groupDefinition.setExpression(from.getAttributeAsString("expression"));
groupDefinition.setRecursive(from.getAttributeAsBoolean("recursive"));
String recalcInt = from.getAttributeAsString("recalculationInterval");
- groupDefinition.setRecalculationInterval((recalcInt != null) ? Long.parseLong(recalcInt) : 0L);
- // modifiedTime, createdTime, and lastCalculationTime are updated by GroupDefinitionManagerBean only
+ //groupDefinition.setRecalculationInterval((recalcInt != null) ? Long.parseLong(recalcInt) : 0L);
+ // convert the recalculation interval from minutes to millis for db storage
+ groupDefinition.setRecalculationInterval((recalcInt != null) ? Long.parseLong(recalcInt) * 60 * 1000 : 0L);
+ // modifiedTime, createdTime, and lastCalculationTime are updated by GroupDefinitionManagerBean only
// nextCalculationTime is a non-persistent, derived field
return groupDefinition;
@@ -191,7 +193,10 @@ public class GroupDefinitionDataSource extends RPCDataSource<GroupDefinition, Re
record.setAttribute("description", from.getDescription());
record.setAttribute("expression", from.getExpression());
record.setAttribute("recursive", from.isRecursive());
- record.setAttribute("recalculationInterval", convertLongToString(from.getRecalculationInterval()));
+
+ // convert millis to minutes for display
+ long recalcIntervalLong = from.getRecalculationInterval()/(60 * 1000);
+ record.setAttribute("recalculationInterval", convertLongToString(recalcIntervalLong));
record.setAttribute("modifiedTime", from.getModifiedTime());
record.setAttribute("createdTime", from.getCreatedTime());
record.setAttribute("lastCalculationTime", convertLongToString(from.getLastCalculationTime()));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java
index e01d25a..96d3702 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java
@@ -132,7 +132,7 @@ public class SingleGroupDefinitionView extends LocatableVLayout implements Bookm
name.setValue(groupDefinition.getName());
recursive.setValue(groupDefinition.isRecursive());
description.setValue(groupDefinition.getDescription());
- recalculationInterval.setValue(groupDefinition.getRecalculationInterval());
+ recalculationInterval.setValue(groupDefinition.getRecalculationInterval() /(60 * 1000));
expression.setValue(groupDefinition.getExpression());
final LocatableDynamicForm form = new LocatableDynamicForm(extendLocatorId("GroupDefinitionForm"));
@@ -150,7 +150,6 @@ public class SingleGroupDefinitionView extends LocatableVLayout implements Bookm
// button setup
IButton saveButton = new LocatableIButton(this.extendLocatorId("save"), MSG.common_button_save());
- //saveButton.addClickHandler(new SaveOrUpdateClickHandler(form, operationType, dynaGroupChildrenView));
saveButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
saveForm(form, dynaGroupChildrenView, false);
@@ -394,10 +393,10 @@ public class SingleGroupDefinitionView extends LocatableVLayout implements Bookm
});
recalculationInterval = new SpinnerItem("recalculationInterval", MSG.view_dynagroup_recalculationInterval());
- //recalculationInterval.setWrapTitle(false); // do not set this - it causes the form to grow abnormally width-wise for some reason
recalculationInterval.setMin(0);
+ recalculationInterval.setMax(60 * 24 * 7 ); // max set to 1 week
recalculationInterval.setDefaultValue(0);
- recalculationInterval.setStep(60000); // the recalc interval is in milliseconds, step up one minute at a time
+ recalculationInterval.setStep(1); // the recalc interval is in milliseconds, step up one minute at a time
}
public static LinkedHashMap<String, String> getTemplates() {
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index e96c012..b019731 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -1329,7 +1329,7 @@ view_dynagroup_recalcFailureSelection = Failed to recalculate the selected group
view_dynagroup_recalcSuccessful = You have successfully recalculated this group definition
view_dynagroup_recalcSuccessfulSelection = You have successfully recalculated [{0}] group definitions
view_dynagroup_recalculate = Recalculate
-view_dynagroup_recalculationInterval = Recalculation Interval (ms)
+view_dynagroup_recalculationInterval = Recalculation Interval (min)
view_dynagroup_recursive = Recursive
view_dynagroup_saveAndRecalculate = Save & Recalculate
view_dynagroup_saveFailure = Failed to save the group definition named [{0}]
12 years, 3 months
[rhq] modules/core
by mazz
modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java | 4
modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java | 46 +++++++---
2 files changed, 38 insertions(+), 12 deletions(-)
New commits:
commit 657f2f242c2193173b8e68b6cdb34f04f2057d43
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Jan 27 16:56:27 2012 -0500
[BZ 785268] fix the case where you do a clean deploy but a file was edited (where the file content didn't change from bundle v1 to bundle v2)
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java
index 40ce727..602df4c 100644
--- a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java
+++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java
@@ -422,9 +422,11 @@ public class Deployer {
// that a file is different from the deployment distribution.
// If the new is different from the original and if the new is different than the current, we need to backup the
// current because we will be overwriting the current file with the new.
+ // Note that if we were told to "clean", we never leave files alone (since everything must be cleaned) but
+ // we will backup the touched file that is being removed
String changedFileHashcode = changed.getValue();
String originalFileHashcode = original.get(changedFilePath);
- if (newHashcode.equals(originalFileHashcode)) {
+ if (newHashcode.equals(originalFileHashcode) && !clean) {
currentFilesToLeaveAlone.put(changedFilePath, originalFileHashcode);
} else if (!newHashcode.equals(changedFileHashcode)) {
currentFilesToBackup.add(changedFilePath);
diff --git a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java
index d8a355f..8a222a4 100644
--- a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java
+++ b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java
@@ -118,7 +118,11 @@ public class SimpleDeployerTest {
}
public void testX_Y_X() throws Exception {
- baseX_Y_X(false);
+ baseX_Y_X(false, false);
+ }
+
+ public void testX_Y_X_Clean() throws Exception {
+ baseX_Y_X(false, true);
}
public void testX_Y_Y() throws Exception {
@@ -174,7 +178,11 @@ public class SimpleDeployerTest {
}
public void testX_Y_X_DryRun() throws Exception {
- baseX_Y_X(true);
+ baseX_Y_X(true, false);
+ }
+
+ public void testX_Y_X_DryRun_Clean() throws Exception {
+ baseX_Y_X(true, true);
}
public void testX_Y_Y_DryRun() throws Exception {
@@ -414,7 +422,7 @@ public class SimpleDeployerTest {
}
}
- private void baseX_Y_X(boolean dryRun) throws Exception {
+ private void baseX_Y_X(boolean dryRun, boolean clean) throws Exception {
String newContent = "testX_Y_X";
String newHashcode = MessageDigestGenerator.getDigestString(newContent);
writeFile(newContent, this.currentFile);
@@ -423,11 +431,7 @@ public class SimpleDeployerTest {
null, null, true, null);
Deployer deployer = new Deployer(dd);
FileHashcodeMap newFileHashcodeMap;
- if (dryRun) {
- newFileHashcodeMap = deployer.dryRun(this.diff);
- } else {
- newFileHashcodeMap = deployer.deploy(this.diff);
- }
+ newFileHashcodeMap = deployer.deploy(this.diff, clean, dryRun);
// very important to understand this - even though the current file is changed, the hashcode
// stored in the map and the metadata directory is the ORIGINAL hashcode. This is to make it
@@ -439,17 +443,37 @@ public class SimpleDeployerTest {
assert newFileHashcodeMap.equals(this.originalFileHashcodeMap);
String[] contentHash = getOriginalFilenameContentHashcode();
- assert contentHash[0].equals(newContent);
- assert contentHash[1].equals(newHashcode);
+
+ // if we are cleaning, then the old content is blown away anyway and the original is replaced
+ // (but not if this is a dryRun - dryRun always means the changed/new content remains)
+ if (clean && !dryRun) {
+ assert contentHash[0].equals(originalContent);
+ assert contentHash[1].equals(originalHashcode);
+ } else {
+ assert contentHash[0].equals(newContent);
+ assert contentHash[1].equals(newHashcode);
+ }
// note nothing changed - our current file remains as is
assert this.diff.getAddedFiles().isEmpty() : this.diff;
assert this.diff.getDeletedFiles().isEmpty() : this.diff;
assert this.diff.getChangedFiles().isEmpty() : this.diff;
- assert this.diff.getBackedUpFiles().isEmpty() : this.diff;
+ if (clean) {
+ assert this.diff.getBackedUpFiles().size() == 1 : this.diff;
+ assert this.diff.getBackedUpFiles().containsKey(originalFileName) : this.diff;
+ File backupFile = new File(this.diff.getBackedUpFiles().get(originalFileName));
+ if (dryRun) {
+ assert !backupFile.exists() : "dry run should not create backup";
+ } else {
+ assert readFile(backupFile).equals(newContent) : "did not backup the correct file?";
+ }
+ } else {
+ assert this.diff.getBackedUpFiles().isEmpty() : this.diff;
+ }
assert this.diff.getIgnoredFiles().isEmpty() : this.diff;
assert this.diff.getRealizedFiles().isEmpty() : this.diff;
assert this.diff.getErrors().isEmpty() : this.diff;
+ assert this.diff.wasCleaned() == clean : this.diff;
if (dryRun) {
assert this.metadata.getCurrentDeploymentProperties().equals(originalDeployProps);
12 years, 3 months
[rhq] modules/core
by mazz
modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java | 64 ++++++++++
1 file changed, 64 insertions(+)
New commits:
commit 2dc60e41f255d5b64b991be32eee560cd5887ed9
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Jan 27 16:07:24 2012 -0500
[BZ 785270] add 4 new unit tests to make sure we handle the case when a new file was added but is not part of any bundle deployment (either in the original or new deployment)
diff --git a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java
index 2736f16..d8a355f 100644
--- a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java
+++ b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java
@@ -145,6 +145,14 @@ public class SimpleDeployerTest {
baseNoOriginalWithCurrentWithNew(false);
}
+ public void testNoOriginalWithCurrentNoNew() throws Exception {
+ baseNoOriginalWithCurrentNoNew(false, false);
+ }
+
+ public void testNoOriginalWithCurrentNoNew_Clean() throws Exception {
+ baseNoOriginalWithCurrentNoNew(false, true);
+ }
+
public void testNoCurrent() throws Exception {
baseNoCurrent(false);
}
@@ -193,6 +201,14 @@ public class SimpleDeployerTest {
baseNoOriginalWithCurrentWithNew(true);
}
+ public void testNoOriginalWithCurrentNoNew_DryRun() throws Exception {
+ baseNoOriginalWithCurrentNoNew(true, false);
+ }
+
+ public void testNoOriginalWithCurrentNoNew_DryRun_Clean() throws Exception {
+ baseNoOriginalWithCurrentNoNew(true, true);
+ }
+
public void testNoCurrent_DryRun() throws Exception {
baseNoCurrent(true);
}
@@ -683,6 +699,54 @@ public class SimpleDeployerTest {
}
}
+ /**
+ * This tests when there was no file in the bundle but some unknown file was added to the
+ * destination directory. When redeploying the same bundle, there is no original file,
+ * there is no new file, but there is a current file (which is unknown to the bundle).
+ * It should be removed and backed up.
+ */
+ private void baseNoOriginalWithCurrentNoNew(boolean dryRun, boolean clean) throws Exception {
+ String inTheWayFileName = "unknown.txt";
+ File inTheWayFile = new File(this.deployDir, inTheWayFileName);
+ String inTheWayContent = "this is a new file but shouldn't be here - its not part of the bundle";
+ writeFile(inTheWayContent, inTheWayFile);
+
+ DeploymentData dd = new DeploymentData(originalDeployProps, originalZipFiles, null, tmpDir, deployDir, null,
+ null, null, null, true, null);
+ Deployer deployer = new Deployer(dd);
+ FileHashcodeMap newFileHashcodeMap;
+ newFileHashcodeMap = deployer.deploy(this.diff, clean, dryRun);
+
+ assert newFileHashcodeMap.equals(this.originalFileHashcodeMap);
+ assert newFileHashcodeMap.size() == 1;
+ assert newFileHashcodeMap.get(originalFileName).equals(originalHashcode);
+ String[] contentHash = getOriginalFilenameContentHashcode();
+ assert contentHash[0].equals(originalContent);
+ assert contentHash[1].equals(originalHashcode);
+
+ assert this.diff.getAddedFiles().isEmpty() : this.diff;
+ assert this.diff.getDeletedFiles().size() == 1 : this.diff;
+ assert this.diff.getDeletedFiles().contains(inTheWayFileName) : this.diff;
+ assert this.diff.getChangedFiles().isEmpty() : this.diff;
+ assert this.diff.getBackedUpFiles().size() == 1 : this.diff;
+ assert this.diff.getBackedUpFiles().containsKey(inTheWayFileName) : this.diff;
+ assert this.diff.getIgnoredFiles().isEmpty() : this.diff;
+ assert this.diff.getRealizedFiles().isEmpty() : this.diff;
+ assert this.diff.getErrors().isEmpty() : this.diff;
+ assert this.diff.wasCleaned() == clean : this.diff;
+
+ assert this.metadata.getCurrentDeploymentProperties().equals(originalDeployProps);
+ assert this.metadata.getCurrentDeploymentFileHashcodes().equals(originalFileHashcodeMap);
+
+ // verify the backup copy
+ File backupFile = new File(this.diff.getBackedUpFiles().get(inTheWayFileName));
+ if (dryRun) {
+ assert !backupFile.exists() : "dry run should not create backup";
+ } else {
+ assert readFile(backupFile).equals(inTheWayContent) : "did not backup the correct file?";
+ }
+ }
+
private void baseNoCurrent(boolean dryRun) throws Exception {
assert this.currentFile.delete() : "Failed to delete the current file, cannot prepare the test";
12 years, 3 months
[rhq] modules/plugins
by Heiko W. Rupp
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DeploymentComponent.java | 12 ++++-
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainDeploymentComponent.java | 23 ++++++++++
modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml | 13 +++--
3 files changed, 40 insertions(+), 8 deletions(-)
New commits:
commit 581bb4295d1a6bc3c991493a38f35ad9ef9073b7
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Jan 27 17:28:43 2012 +0100
Also allow to deploy to domain deployments.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DeploymentComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DeploymentComponent.java
index 2e6163d..abf40fa 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DeploymentComponent.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DeploymentComponent.java
@@ -15,6 +15,7 @@ import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.content.PackageDetailsKey;
import org.rhq.core.domain.content.PackageType;
import org.rhq.core.domain.content.transfer.ContentResponseResult;
+import org.rhq.core.domain.content.transfer.DeployIndividualPackageResponse;
import org.rhq.core.domain.content.transfer.DeployPackageStep;
import org.rhq.core.domain.content.transfer.DeployPackagesResponse;
import org.rhq.core.domain.content.transfer.RemovePackagesResponse;
@@ -89,11 +90,13 @@ public class DeploymentComponent extends BaseComponent implements OperationFacet
public DeployPackagesResponse deployPackages(Set<ResourcePackageDetails> packages,
ContentServices contentServices) {
+ log.info("Starting deployment..");
DeployPackagesResponse response = new DeployPackagesResponse();
if (packages.size()!=1) {
response.setOverallRequestResult(ContentResponseResult.FAILURE);
response.setOverallRequestErrorMessage("Can only deploy one package at a time");
+ log.warn("deployPackages can only deploy one package at a time");
}
ResourcePackageDetails detail = packages.iterator().next();
@@ -102,7 +105,7 @@ public class DeploymentComponent extends BaseComponent implements OperationFacet
OutputStream out = uploadConnection.getOutputStream(detail.getFileName());
ResourceType resourceType = context.getResourceType();
- log.info("trying " + resourceType.getName() + ", " + detail.getKey() );
+ log.info("trying deployment of" + resourceType.getName() + ", key=" + detail.getKey() );
contentServices.downloadPackageBits(context.getContentContext(),
detail.getKey(), out, true);
@@ -128,11 +131,15 @@ public class DeploymentComponent extends BaseComponent implements OperationFacet
try {
redeployOnServer(detail.getKey().getName(), hash);
response.setOverallRequestResult(ContentResponseResult.SUCCESS);
+ DeployIndividualPackageResponse packageResponse = new DeployIndividualPackageResponse(detail.getKey(), ContentResponseResult.SUCCESS);
+ response.addPackageResponse(packageResponse);
+
}
catch (Exception e) {
response.setOverallRequestResult(ContentResponseResult.FAILURE);
}
+ log.info(".. result is " + response);
return response;
}
@@ -172,8 +179,9 @@ public class DeploymentComponent extends BaseComponent implements OperationFacet
Map<String,Object> deployments = cres.getResult();
for (String key : deployments.keySet()) {
Map<String,Object> deployment = (Map<String, Object>) deployments.get(key);
+ log.info("Discover package [" + key + "] for type [" + type + "]");
- List<Map> contentList = (List<Map>) deployment.get("content");
+ List<Map> contentList = (List<Map>) deployment.get("content"); // deployments on SG or ManagedServer level have no hash
Map<String,Map> hashMap = contentList.get(0);
Map<String,String> bvMap = hashMap.get("hash");
String content = bvMap.get("BYTES_VALUE");
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainDeploymentComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainDeploymentComponent.java
new file mode 100644
index 0000000..8db86c7
--- /dev/null
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainDeploymentComponent.java
@@ -0,0 +1,23 @@
+package org.rhq.modules.plugins.jbossas7;
+
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.modules.plugins.jbossas7.json.Operation;
+import org.rhq.modules.plugins.jbossas7.json.ReadResource;
+import org.rhq.modules.plugins.jbossas7.json.Result;
+
+/**
+ * Handle domain deployments
+ * @author Heiko W. Rupp
+ */
+public class DomainDeploymentComponent extends DeploymentComponent{
+
+ @Override
+ public AvailabilityType getAvailability() {
+ // Domain deployments have no 'enabled' attribute
+
+ Operation op = new ReadResource(getAddress());
+ Result res = getASConnection().execute(op);
+
+ return (res!=null && res.isSuccess()) ? AvailabilityType.UP: AvailabilityType.DOWN;
+ }
+}
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index fdebf0a..2e6aba3 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -284,7 +284,9 @@
<operation name="server:add" displayName="Create server" description="Add a new server to this host.">
<parameters>
<c:simple-property name="name" description="Name of this new server" required="true"/>
- <c:simple-property name="group" displayName="Server Group" description="Server group to put this sever in" default="" required="false"/>
+ <c:simple-property name="group" displayName="Server Group" description="Server group to put this sever in" default="" required="true">
+ <c:option-source target="resource" expression="type=ServerGroup"/>
+ </c:simple-property>
<c:simple-property name="auto-start" displayName="Autostart" description="Should this server start at boot?" type="boolean" default="false" required="true"/>
</parameters>
<results>
@@ -293,7 +295,7 @@
</operation>
<operation name="server:remove" displayName="Delete server" description="Deletes a server on this host.">
<parameters>
- <c:simple-property name="name" description="Name of this new server" required="true"/>
+ <c:simple-property name="name" description="Name of the server to be removed" required="true"/>
</parameters>
<results>
<c:simple-property name="operationResult" description="Outcome of the delete server operation"/>
@@ -366,7 +368,7 @@
</server>
<service name="DomainDeployment"
- class="BaseComponent"
+ class="DomainDeploymentComponent"
discovery="SubsystemDiscovery"
createDeletePolicy="both"
creationDataType="content">
@@ -2125,11 +2127,10 @@ working area for individual server instances</li></ul>"/>
createDeletePolicy="both"
creationDataType="content">
-
<runs-inside>
- <parent-resource-type name="ServerGroup" plugin="jboss-as-7"/>
+ <parent-resource-type name="ServerGroup" plugin="jboss-as-7"/> <!-- TODO -->
<parent-resource-type name="JBossAS7 Standalone Server" plugin="jboss-as-7"/>
- <parent-resource-type name="Managed Server" plugin="jboss-as-7"/>
+ <parent-resource-type name="Managed Server" plugin="jboss-as-7"/> <!-- TODO -->
</runs-inside>
<plugin-configuration>
<c:simple-property name="path" default="deployment" readOnly="true"/>
12 years, 3 months
[rhq] modules/common
by mazz
modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java | 20 +++++-----
1 file changed, 11 insertions(+), 9 deletions(-)
New commits:
commit d8bd66821bfa11f77ce7c539d9fa90a7c9daf102
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Jan 27 10:02:49 2012 -0500
[BZ 784124] forgot to fix this test
diff --git a/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java b/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java
index 0240f72..bd2d35d 100644
--- a/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java
+++ b/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java
@@ -108,12 +108,13 @@ public class AntLauncherTest {
public void testInstall() throws Exception {
- if (skipNonRHLinux("testInstall")) return;
+ if (skipNonRHLinux("testInstall"))
+ return;
// We want to test a fresh install, so make sure the deploy dir doesn't pre-exist.
FileUtil.purge(DEPLOY_DIR, true);
- // but we do want to add an unrelated file to see that it remains untouched - the install just "goes around" it
+ // but we do want to add an unrelated file to see that it goes away - since we have manageRootDir=true
File unrelatedFile = writeFile("unrelated content", DEPLOY_DIR, "unrelated-file.txt");
AntLauncher ant = new AntLauncher();
@@ -157,7 +158,7 @@ public class AntLauncherTest {
assert new File(DEPLOY_DIR, "subdir/test.properties").exists() : "missing file";
assert new File(DEPLOY_DIR, "archived-bundle-file.txt").exists() : "missing archived bundle file";
assert new File(DEPLOY_DIR, "archived-subdir/archived-file-in-subdir.properties").exists() : "missing subdir archive file";
- assert unrelatedFile.exists() : "unrelated file was removed during the install";
+ assert !unrelatedFile.exists() : "unrelated file was not removed during the install";
assert readPropsFile(new File(DEPLOY_DIR, "subdir/test.properties")).getProperty("junk.listener.port").equals(
"10000");
assert readPropsFile(new File(DEPLOY_DIR, "archived-subdir/archived-file-in-subdir.properties")).getProperty(
@@ -165,7 +166,7 @@ public class AntLauncherTest {
}
private boolean skipNonRHLinux(String meth) {
- if (!System.getProperty("os.name").equals("Linux") || !REDHAT_RELEASE_FILE.exists()) {
+ if (!System.getProperty("os.name").equals("Linux") || !REDHAT_RELEASE_FILE.exists()) {
System.out.println("Skipping " + meth + "() as this only works on Red Hat Linux flavors");
return true;
}
@@ -175,10 +176,10 @@ public class AntLauncherTest {
@Test(dependsOnMethods = "testInstall")
public void testUpgrade() throws Exception {
- if (skipNonRHLinux("testUpgrade")) return;
+ if (skipNonRHLinux("testUpgrade"))
+ return;
- // We want to test an upgrade, so do *not* wipe out the deploy dir - our test method @dependsOnMethods testInstall
- // but we do want to add an unrelated file to see that it gets deleted as part of the upgrade
+ // add an unrelated file to see that it gets deleted as part of the upgrade
File unrelatedFile = writeFile("unrelated content", DEPLOY_DIR, "unrelated-file.txt");
AntLauncher ant = new AntLauncher();
@@ -231,14 +232,15 @@ public class AntLauncherTest {
public void testUpgradeNoManageRootDir() throws Exception {
- if (skipNonRHLinux("testInstall")) return;
+ if (skipNonRHLinux("testInstall"))
+ return;
// We want to test an upgrade, so do *not* wipe out the deploy dir - let's re-invoke testInstall
// to get us to an initial state of the v1 bundle installed
testInstall();
// we still want the unrelated file - we want to see that manageRootDir=false works (unrelated files should not be deleted)
- File unrelatedFile = new File(DEPLOY_DIR, "unrelated-file.txt");
+ File unrelatedFile = writeFile("unrelated content", DEPLOY_DIR, "unrelated-file.txt");
assert unrelatedFile.exists() : "our initial install test method should have prepared an unmanaged file";
AntLauncher ant = new AntLauncher();
12 years, 3 months