[rhq] modules/plugins
by mazz
modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml | 11 ++++++++++
1 file changed, 11 insertions(+)
New commits:
commit 44d0542ab1bf78b8953dc69f805f55fa15420509
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jun 23 11:43:28 2011 -0400
BZ 644328 - enable bundle deployments to jboss-as-5 plugin
diff --git a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
index 40e2441..21161fe 100644
--- a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
@@ -1191,6 +1191,17 @@
</configuration>
</content>
+ <bundle-target>
+ <destination-base-dir name="Install Directory" description="The top directory where the JBossAS Server is installed. (i.e. the value found in the 'JBoss Home Directory' connection property)">
+ <value-context>pluginConfiguration</value-context>
+ <value-name>homeDir</value-name>
+ </destination-base-dir>
+ <destination-base-dir name="Profile Directory" description="The profile configuration directory such as 'default', 'minimal', 'production' or similar location. (i.e. the value found in the 'Server Home Dir' connection property)">
+ <value-context>pluginConfiguration</value-context>
+ <value-name>serverHomeDir</value-name>
+ </destination-base-dir>
+ </bundle-target>
+
<server name="JBoss AS JVM"
description="JVM of the JBossAS"
sourcePlugin="JMX"
12 years, 11 months
[rhq] Branch 'drift' - modules/core
by mazz
modules/core/plugin-container/pom.xml | 7 -------
1 file changed, 7 deletions(-)
New commits:
commit e719c16ccb4d5157b1e421b0e7b411343ad58048
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jun 23 10:36:41 2011 -0400
this looks like an old dependency - I find no references to anything
"guava" in any file other than this pom.xml.
It is a test dependency and all tests pass but one,
and that one failure is not related to missing classes.
so I am removing this.
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index ac0d55f..1d12869 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -122,13 +122,6 @@
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
-
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>r09</version>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
12 years, 11 months
[rhq] Branch 'drift' - modules/core modules/enterprise
by Jay Shaughnessy
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfiguration.java | 59 +-
modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java | 3
modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceTypeFacet.java | 2
modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceFacets.java | 25
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/ResourceAlertHistoryView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigDataSource.java | 293 ++++++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDataSource.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/ResourceDriftHistoryView.java | 39 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java | 34 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java | 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 13
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 13
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties | 13
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties | 13
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties | 13
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java | 15
16 files changed, 475 insertions(+), 71 deletions(-)
New commits:
commit 1d4ddbe4693810bb102e96e2f68a1cbdf02d4c0b
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jun 22 19:53:01 2011 -0400
- First pass at Drift tab and drift history subtab
- Drift "Facet"
- Some work towards drift config list view
- New I18N props
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfiguration.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfiguration.java
index a7f18f5..2f358e9 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfiguration.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfiguration.java
@@ -4,12 +4,17 @@ import static java.util.Collections.emptyList;
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.Property;
import org.rhq.core.domain.configuration.PropertyList;
import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.resource.Resource;
public class DriftConfiguration implements Serializable {
@@ -75,6 +80,8 @@ public class DriftConfiguration implements Serializable {
}
}
+ private Resource resource;
+
private Configuration configuration;
// required for jaxb/web services stuff
@@ -82,7 +89,12 @@ public class DriftConfiguration implements Serializable {
}
public DriftConfiguration(Configuration c) {
- configuration = c;
+ this(null, c);
+ }
+
+ public DriftConfiguration(Resource resource, Configuration c) {
+ this.resource = resource;
+ this.configuration = c;
}
public Configuration getConfiguration() {
@@ -101,6 +113,10 @@ public class DriftConfiguration implements Serializable {
return Long.parseLong(configuration.getSimpleValue("interval", "0"));
}
+ public boolean getEnabled() {
+ return configuration.getSimpleValue("enabled", "false").equals("true");
+ }
+
public List<Filter> getIncludes() {
return getFilters("includes");
}
@@ -124,4 +140,45 @@ public class DriftConfiguration implements Serializable {
return filters;
}
+ public Resource getResource() {
+ return resource;
+ }
+
+ public void setResource(Resource resource) {
+ this.resource = resource;
+ }
+
+ public static Set<DriftConfiguration> valueOf(Resource resource) {
+ if (null == resource) {
+ return new HashSet<DriftConfiguration>(0);
+ }
+
+ Set<Configuration> configs = resource.getDriftConfigurations();
+ if (null == configs) {
+ return new HashSet<DriftConfiguration>(0);
+ }
+
+ Set<DriftConfiguration> result = new HashSet<DriftConfiguration>(configs.size());
+
+ for (Iterator<Configuration> i = configs.iterator(); i.hasNext();) {
+ result.add(new DriftConfiguration(resource, i.next()));
+ }
+
+ return result;
+ }
+
+ public static <T extends Collection<Configuration>> Set<DriftConfiguration> valueOf(T configs) {
+ if (null == configs) {
+ return new HashSet<DriftConfiguration>(0);
+ }
+
+ Set<DriftConfiguration> result = new HashSet<DriftConfiguration>(configs.size());
+
+ for (Iterator<Configuration> i = configs.iterator(); i.hasNext();) {
+ result.add(new DriftConfiguration(i.next()));
+ }
+
+ return result;
+ }
+
}
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
index c9935ae..15abcac 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
@@ -173,7 +173,8 @@ import org.rhq.core.domain.util.Summary;
+ " (SELECT COUNT(operationDef) FROM rt.operationDefinitions operationDef)," // operation
+ " (SELECT COUNT(packageType) FROM rt.packageTypes packageType)," // content
+ " (SELECT COUNT(metricDef) FROM rt.metricDefinitions metricDef WHERE metricDef.dataType = 3)," // calltime
- + " (SELECT COUNT(propDef) FROM rt.pluginConfigurationDefinition pluginConfig JOIN pluginConfig.propertyDefinitions propDef WHERE propDef.name = 'snapshotLogEnabled')" // support
+ + " (SELECT COUNT(propDef) FROM rt.pluginConfigurationDefinition pluginConfig JOIN pluginConfig.propertyDefinitions propDef WHERE propDef.name = 'snapshotLogEnabled')," //
+ + " (SELECT COUNT(driftConfig) FROM rt.driftConfigurationTemplates driftConfig)" // drift
+ " ) " //
+ " FROM ResourceType rt " //
+ " WHERE rt.deleted = false AND ( rt.id = :resourceTypeId OR :resourceTypeId IS NULL )"),
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceTypeFacet.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceTypeFacet.java
index 38b15ff..93da489 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceTypeFacet.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceTypeFacet.java
@@ -24,5 +24,5 @@ package org.rhq.core.domain.resource;
* @author Ian Springer
*/
public enum ResourceTypeFacet {
- MEASUREMENT, EVENT, PLUGIN_CONFIGURATION, CONFIGURATION, OPERATION, CONTENT, CALL_TIME, SUPPORT
+ MEASUREMENT, EVENT, PLUGIN_CONFIGURATION, CONFIGURATION, OPERATION, CONTENT, CALL_TIME, SUPPORT, DRIFT
}
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceFacets.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceFacets.java
index b72f409..71f0f73 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceFacets.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceFacets.java
@@ -37,8 +37,9 @@ import org.rhq.core.domain.resource.ResourceTypeFacet;
public class ResourceFacets implements Serializable {
private static final long serialVersionUID = 1L;
- public static ResourceFacets NONE = new ResourceFacets(-1, false, false, false, false, false, false, false, false);
- public static ResourceFacets ALL = new ResourceFacets(-1, true, true, true, true, true, true, true, true);
+ public static ResourceFacets NONE = new ResourceFacets(-1, false, false, false, false, false, false, false, false,
+ false);
+ public static ResourceFacets ALL = new ResourceFacets(-1, true, true, true, true, true, true, true, true, true);
private int resourceTypeId;
private boolean measurement;
@@ -49,6 +50,7 @@ public class ResourceFacets implements Serializable {
private boolean content;
private boolean callTime;
private boolean support;
+ private boolean drift;
private Set<ResourceTypeFacet> facets;
// no-arg constructor required by GWT compiler
@@ -56,7 +58,7 @@ public class ResourceFacets implements Serializable {
}
public ResourceFacets(int resourceTypeId, boolean measurement, boolean event, boolean pluginConfiguration,
- boolean configuration, boolean operation, boolean content, boolean callTime, boolean support) {
+ boolean configuration, boolean operation, boolean content, boolean callTime, boolean support, boolean drift) {
this.resourceTypeId = resourceTypeId;
this.measurement = measurement;
this.event = event;
@@ -66,11 +68,12 @@ public class ResourceFacets implements Serializable {
this.content = content;
this.callTime = callTime;
this.support = support;
+ this.drift = drift;
initEnum();
}
public ResourceFacets(int resourceTypeId, Number measurement, Number event, Number pluginConfiguration,
- Number configuration, Number operation, Number content, Number callTime, Number support) {
+ Number configuration, Number operation, Number content, Number callTime, Number support, Number drift) {
this.resourceTypeId = resourceTypeId;
this.measurement = measurement.intValue() != 0;
this.event = event.intValue() != 0;
@@ -80,6 +83,7 @@ public class ResourceFacets implements Serializable {
this.content = content.intValue() != 0;
this.callTime = callTime.intValue() != 0;
this.support = support.intValue() != 0;
+ this.drift = drift.intValue() != 0;
initEnum();
}
@@ -162,6 +166,15 @@ public class ResourceFacets implements Serializable {
}
/**
+ * Does this resource expose drift capability? If so, the Drift sub-tab will be displayed in the GUI.
+ *
+ * @return true if the resource allows drift detection, false otherwise
+ */
+ public boolean isDrift() {
+ return drift;
+ }
+
+ /**
* Returns an enum representation of the facets.
*
* @return an enum representation of the facets
@@ -188,5 +201,9 @@ public class ResourceFacets implements Serializable {
this.facets.add(ResourceTypeFacet.CALL_TIME);
if (support)
this.facets.add(ResourceTypeFacet.SUPPORT);
+ // TODO, add this back when we actually start storing drift config templates:
+ // if (drift)
+ this.facets.add(ResourceTypeFacet.DRIFT);
+
}
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/ResourceAlertHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/ResourceAlertHistoryView.java
index af63ed7..b9b13da 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/ResourceAlertHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/ResourceAlertHistoryView.java
@@ -23,7 +23,7 @@ import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.resource.composite.ResourceComposite;
/**
- * @author Joseph Marques
+ * @author Jay Shaughnessy
*/
public class ResourceAlertHistoryView extends AlertHistoryView {
public static ResourceAlertHistoryView get(String locatorId, ResourceComposite composite) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigDataSource.java
new file mode 100644
index 0000000..d5cf5dd
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigDataSource.java
@@ -0,0 +1,293 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.drift;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.DSRequest;
+import com.smartgwt.client.data.DSResponse;
+import com.smartgwt.client.data.Record;
+import com.smartgwt.client.rpc.RPCResponse;
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.HoverCustomizer;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.common.EntityContext;
+import org.rhq.core.domain.criteria.ResourceCriteria;
+import org.rhq.core.domain.drift.DriftConfiguration;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.AncestryUtil;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository.TypesLoadedCallback;
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
+
+/**
+ * @author Jay Shaughnessy
+ */
+public class DriftConfigDataSource extends RPCDataSource<DriftConfiguration, ResourceCriteria> {
+
+ public static final String FILTER_CATEGORIES = "categories";
+
+ private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService();
+
+ private EntityContext entityContext;
+
+ public DriftConfigDataSource() {
+ this(EntityContext.forSubsystemView());
+ }
+
+ public DriftConfigDataSource(EntityContext context) {
+ super();
+ this.entityContext = context;
+
+ addDataSourceFields();
+ }
+
+ /**
+ * The view that contains the list grid which will display this datasource's data will call this
+ * method to get the field information which is used to control the display of the data.
+ *
+ * @return list grid fields used to display the datasource data
+ */
+ public ArrayList<ListGridField> getListGridFields() {
+ ArrayList<ListGridField> fields = new ArrayList<ListGridField>(6);
+
+ ListGridField nameField = new ListGridField("name", MSG.common_title_name());
+ fields.add(nameField);
+
+ ListGridField intervalField = new ListGridField("interval", MSG.common_title_interval());
+ fields.add(intervalField);
+
+ ListGridField baseDirField = new ListGridField("baseDir", MSG.view_drift_table_baseDir());
+ fields.add(baseDirField);
+
+ if (this.entityContext.type != EntityContext.Type.Resource) {
+ ListGridField resourceNameField = new ListGridField(AncestryUtil.RESOURCE_NAME, MSG.common_title_resource());
+ resourceNameField.setCellFormatter(new CellFormatter() {
+ public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
+ String url = LinkManager
+ .getResourceLink(listGridRecord.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
+ return SeleniumUtility.getLocatableHref(url, o.toString(), null);
+ }
+ });
+ resourceNameField.setShowHover(true);
+ resourceNameField.setHoverCustomizer(new HoverCustomizer() {
+
+ public String hoverHTML(Object value, ListGridRecord listGridRecord, int rowNum, int colNum) {
+ return AncestryUtil.getResourceHoverHTML(listGridRecord, 0);
+ }
+ });
+ fields.add(resourceNameField);
+
+ ListGridField ancestryField = AncestryUtil.setupAncestryListGridField();
+ fields.add(ancestryField);
+
+ nameField.setWidth("15%");
+ intervalField.setWidth(100);
+ baseDirField.setWidth("20%");
+ resourceNameField.setWidth("25%");
+ ancestryField.setWidth("40%");
+ } else {
+ nameField.setWidth("15%");
+ intervalField.setWidth(100);
+ baseDirField.setWidth("85%");
+ }
+
+ return fields;
+ }
+
+ @Override
+ protected void executeFetch(final DSRequest request, final DSResponse response, final ResourceCriteria criteria) {
+
+ final long start = System.currentTimeMillis();
+
+ this.resourceService.findResourcesByCriteria(criteria, new AsyncCallback<PageList<Resource>>() {
+
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(MSG.view_inventory_resources_loadFailed(), caught);
+ response.setStatus(RPCResponse.STATUS_FAILURE);
+ processResponse(request.getRequestId(), response);
+ }
+
+ public void onSuccess(PageList<Resource> result) {
+ if (Log.isDebugEnabled()) {
+ long fetchTime = System.currentTimeMillis() - start;
+ Log.debug(result.size() + " resources (with drift configs) fetched in: " + fetchTime + "ms");
+ }
+
+ dataRetrieved(result, response, request);
+ }
+ });
+ }
+
+ /**
+ * Additional processing to support entity-specific or cross-resource views, and something that can be overidden.
+ */
+ protected void dataRetrieved(final PageList<Resource> result, final DSResponse response, final DSRequest request) {
+ switch (entityContext.type) {
+
+ // no need to disambiguate, the dift configs are for a single resource
+ case Resource:
+ Set<DriftConfiguration> driftConfigs = DriftConfiguration.valueOf(result.get(0));
+ response.setData(buildRecords(driftConfigs));
+ // for paging to work we have to specify size of full result set
+ response.setTotalRows(getTotalRows(driftConfigs, response, request));
+ processResponse(request.getRequestId(), response);
+ break;
+
+ // disambiguate as the results could be cross-resource
+ default:
+ Set<Integer> typesSet = new HashSet<Integer>();
+ Set<String> ancestries = new HashSet<String>();
+ for (Resource resource : result) {
+ typesSet.add(resource.getResourceType().getId());
+ ancestries.add(resource.getAncestry());
+ }
+
+ // In addition to the types of the result resources, get the types of their ancestry
+ typesSet.addAll(AncestryUtil.getAncestryTypeIds(ancestries));
+
+ ResourceTypeRepository typeRepo = ResourceTypeRepository.Cache.getInstance();
+ typeRepo.getResourceTypes(typesSet.toArray(new Integer[typesSet.size()]), new TypesLoadedCallback() {
+ @Override
+ public void onTypesLoaded(Map<Integer, ResourceType> types) {
+ // Smartgwt has issues storing a Map as a ListGridRecord attribute. Wrap it in a pojo.
+ AncestryUtil.MapWrapper typesWrapper = new AncestryUtil.MapWrapper(types);
+
+ Set<DriftConfiguration> driftConfigs = getDriftConfigs(result);
+ Record[] records = buildRecords(driftConfigs);
+ for (Record record : records) {
+ // To avoid a lot of unnecessary String construction, be lazy about building ancestry hover text.
+ // Store the types map off the records so we can build a detailed hover string as needed.
+ record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY_TYPES, typesWrapper);
+
+ // Build the decoded ancestry Strings now for display
+ record
+ .setAttribute(AncestryUtil.RESOURCE_ANCESTRY_VALUE, AncestryUtil.getAncestryValue(record));
+ }
+ response.setData(records);
+ // for paging to work we have to specify size of full result set
+ response.setTotalRows(getTotalRows(driftConfigs, response, request));
+ processResponse(request.getRequestId(), response);
+ }
+ });
+ }
+ }
+
+ private Set<DriftConfiguration> getDriftConfigs(PageList<Resource> resources) {
+ Set<DriftConfiguration> result = new HashSet<DriftConfiguration>();
+ for (Resource resource : resources) {
+ result.addAll(DriftConfiguration.valueOf(resource.getDriftConfigurations()));
+ }
+ return result;
+ }
+
+ /**
+ * Sub-classes can override this to add fine-grained control over the result set size. By default the
+ * total rows are set to the total result set for the query, allowing proper paging. But some views (portlets)
+ * may want to limit results to a small set (like most recent).
+ * @param result
+ * @param response
+ * @param request
+ *
+ * @return should not exceed result.size().
+ */
+ protected int getTotalRows(final Set<DriftConfiguration> result, final DSResponse response, final DSRequest request) {
+
+ return result.size();
+ }
+
+ @Override
+ protected ResourceCriteria getFetchCriteria(DSRequest request) {
+
+ ResourceCriteria criteria = new ResourceCriteria();
+ criteria.fetchDriftConfigurations(true);
+ criteria.setPageControl(getPageControl(request));
+
+ return criteria;
+ }
+
+ @Override
+ protected String getSortFieldForColumn(String columnName) {
+ if (AncestryUtil.RESOURCE_ANCESTRY.equals(columnName)) {
+ return "ancestry";
+ }
+
+ return super.getSortFieldForColumn(columnName);
+ }
+
+ @Override
+ public DriftConfiguration copyValues(Record from) {
+ return null;
+ }
+
+ @Override
+ public ListGridRecord copyValues(DriftConfiguration from) {
+ return convert(from);
+ }
+
+ public static ListGridRecord convert(DriftConfiguration from) {
+ ListGridRecord record = new ListGridRecord();
+ record.setAttribute("name", from.getName());
+ record.setAttribute("interval", from.getInterval());
+ record.setAttribute("baseDir", from.getBasedir());
+ record.setAttribute("enabled", from.getEnabled());
+
+ Resource resource = from.getResource();
+
+ // for ancestry handling
+ record.setAttribute(AncestryUtil.RESOURCE_ID, resource.getId());
+ record.setAttribute(AncestryUtil.RESOURCE_NAME, resource.getName());
+ record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY, resource.getAncestry());
+ record.setAttribute(AncestryUtil.RESOURCE_TYPE_ID, resource.getResourceType().getId());
+
+ return record;
+ }
+
+ protected void executeRemove(Record recordToRemove, final DSRequest request, final DSResponse response) {
+ Window.alert(String.valueOf(recordToRemove.getAttributeAsInt("id")));
+ }
+
+ public ResourceGWTServiceAsync getResourceService() {
+ return resourceService;
+ }
+
+ protected EntityContext getEntityContext() {
+ return entityContext;
+ }
+
+ protected void setEntityContext(EntityContext entityContext) {
+ this.entityContext = entityContext;
+ }
+
+}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDataSource.java
index 555e799..d5e0f1c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDataSource.java
@@ -153,8 +153,10 @@ public class DriftDataSource extends RPCDataSource<Drift, DriftCriteria> {
}
public void onSuccess(PageList<Drift> result) {
- long fetchTime = System.currentTimeMillis() - start;
- Log.info(result.size() + " drifts fetched in: " + fetchTime + "ms");
+ if (Log.isDebugEnabled()) {
+ long fetchTime = System.currentTimeMillis() - start;
+ Log.debug(result.size() + " drifts fetched in: " + fetchTime + "ms");
+ }
dataRetrieved(result, response, request);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/ResourceDriftHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/ResourceDriftHistoryView.java
new file mode 100644
index 0000000..5010a38
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/ResourceDriftHistoryView.java
@@ -0,0 +1,39 @@
+/*
+ * RHQ Management Platform
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.drift;
+
+import org.rhq.core.domain.common.EntityContext;
+import org.rhq.core.domain.resource.composite.ResourceComposite;
+
+/**
+ * @author Jay Shaughnessy
+ */
+public class ResourceDriftHistoryView extends DriftHistoryView {
+ public static ResourceDriftHistoryView get(String locatorId, ResourceComposite composite) {
+ String tableTitle = MSG.view_drift_table_resourceHistory();
+ EntityContext context = EntityContext.forResource(composite.getResource().getId());
+ boolean hasWriteAccess = composite.getResourcePermission().isDrift();
+ return new ResourceDriftHistoryView(locatorId, tableTitle, context, hasWriteAccess);
+ }
+
+ private ResourceDriftHistoryView(String locatorId, String tableTitle, EntityContext context, boolean hasWriteAccess) {
+ super(locatorId, tableTitle, context, hasWriteAccess);
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 4ee7130..d5d9de4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -50,6 +50,7 @@ import org.rhq.enterprise.gui.coregui.client.components.tab.SubTab;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTab;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewFactory;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
+import org.rhq.enterprise.gui.coregui.client.drift.ResourceDriftHistoryView;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.InventoryView;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.AbstractTwoLevelTabSetView;
@@ -229,16 +230,14 @@ public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceCompo
configurationTab.registerSubTabs(this.configCurrent, this.configHistory);
tabs.add(configurationTab);
- /*
driftTab = new TwoLevelTab(getTabSet().extendLocatorId("Drift"), new ViewName("Drift", MSG
- .view_tabs_common_drift()), "/images/icons/Alert_grey_16.png");
- this.alertHistory = new SubTab(driftTab.extendLocatorId("History"), new ViewName("History", MSG
+ .view_tabs_common_drift()), "/images/icons/Configure_grey_16.png");
+ this.driftHistory = new SubTab(driftTab.extendLocatorId("History"), new ViewName("History", MSG
.view_tabs_common_history()), null);
- this.alertDef = new SubTab(driftTab.extendLocatorId("Definitions"), new ViewName("Definitions", MSG
- .view_tabs_common_definitions()), null);
- driftTab.registerSubTabs(alertHistory, alertDef);
+ //this.alertDef = new SubTab(driftTab.extendLocatorId("Definitions"), new ViewName("Definitions", MSG
+ // .view_tabs_common_definitions()), null);
+ driftTab.registerSubTabs(driftHistory);
tabs.add(driftTab);
- */
contentTab = new TwoLevelTab(getTabSet().extendLocatorId("Content"), new ViewName("Content", MSG
.view_tabs_common_content()), "/images/icons/Content_grey_16.png");
@@ -281,6 +280,7 @@ public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceCompo
updateEventsTabContent(resourceComposite, facets);
updateOperationsTabContent(facets);
updateConfigurationTabContent(resourceComposite, resource, resourcePermissions, facets);
+ updateDriftTabContent(resourceComposite, resource, resourcePermissions, facets);
updateContentTabContent(resource, facets);
this.show();
@@ -502,6 +502,26 @@ public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceCompo
}
}
+ private void updateDriftTabContent(final ResourceComposite resourceComposite, final Resource resource,
+ ResourcePermission resourcePermissions, Set<ResourceTypeFacet> facets) {
+ if (updateTab(this.driftTab, facets.contains(ResourceTypeFacet.DRIFT), resourcePermissions.isDrift())) {
+
+ updateSubTab(this.driftTab, this.driftHistory, true, true, new ViewFactory() {
+ @Override
+ public Canvas createView() {
+ return ResourceDriftHistoryView.get(driftHistory.extendLocatorId("View"), resourceComposite);
+ }
+ });
+
+ updateSubTab(this.configurationTab, this.configHistory, true, true, new ViewFactory() {
+ @Override
+ public Canvas createView() {
+ return ResourceDriftHistoryView.get(driftHistory.extendLocatorId("View"), resourceComposite);
+ }
+ });
+ }
+ }
+
private void updateContentTabContent(final Resource resource, Set<ResourceTypeFacet> facets) {
if (updateTab(this.contentTab, facets.contains(ResourceTypeFacet.CONTENT), true)) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
index 43e701e..694fafd 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
@@ -106,7 +106,8 @@ public class ResourceGWTServiceImpl extends AbstractGWTServiceImpl implements Re
// "resourceErrors \n" +
// "eventSources \n" +
// "productVersion "}
- "tags" };
+ "tags", //
+ "driftConfigurations" };
public static Set<String> importantFieldsSet = new HashSet<String>(Arrays.asList(importantFields));
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 d90336d..24e6b81 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
@@ -6,7 +6,6 @@
# http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
-
common_alert_high = High
common_alert_low = Low
common_alert_medium = Medium
@@ -147,6 +146,7 @@ common_title_host = Host
common_title_id = ID
common_title_id_parent = Parent ID
common_title_info = Info
+common_title_interval = Interval
common_title_inventory = Inventory
common_title_inventorySummary = Inventory Summary
common_title_lastUpdated = Last Updated
@@ -250,7 +250,6 @@ common_val_none = None
common_val_nth = {0}th
common_val_yes = Yes
common_val_yes_lower = yes
-
dataSource_ContentRepoTree_error_load = Error loading repositories
dataSource_ContentRepoTree_field_parentId = Parent ID
dataSource_bundle_loadFailed = Failed to load Bundle data
@@ -358,7 +357,6 @@ dataSource_users_field_passwordVerify = Verify Password
dataSource_users_field_phoneNumber = Phone Number
dataSource_users_invalidEmailAddress = Invalid email address.
dataSource_users_passwordsDoNotMatch = Passwords do not match.
-
datasource_roles_field_ldapGroups = LDAP Groups
datasource_roles_field_permissions = Permissions
datasource_roles_field_resourceGroups = Resource Groups
@@ -372,15 +370,11 @@ datasource_templateSchedules_enabled_failed = Failed to enable collection of met
datasource_templateSchedules_updated = Updated collection intervals of selected metric [{0}].
datasource_templateSchedules_updated_detail = Collection interval for metric [{0}] [{1}] by default for ResourceType with id [{2}] set to [{3}] seconds.
datasource_templateSchedules_updated_failed = Failed to set collection interval to [{0}] seconds for metric [{1}] [{2}] by default for ResourceType with id [{3}].
-
favorites = Favorites
-
favorites_groups = Favorite Groups
favorites_recentlyViewed = Recently Viewed
favorites_resources = Favorite Resources
-
group_tree_partialClusterTooltip = {0} out of {1} group members have a ''{2}'' resource
-
util_ancestry_parentAncestry = Parent Ancestry for:
util_errorHandler_nullException = exception was null
util_monitoringRequestCallback_error_checkServerStatusFailure = Unable to determine login status - check Server status.
@@ -391,7 +385,6 @@ util_userPerm_loadFailResource = Failed to load your permissions for Resource wi
util_userSession_loadFailSubject = UserSessionManager: Failed to load user Subject
util_userSession_logoutFail = Failed to logout.
util_widgetsField_unlimited = Unlimited
-
view_aboutBox_allRightsReserved = All Rights Reserved.
view_aboutBox_buildNumber = Build Number:
view_aboutBox_failedToLoad = Failed to load product information.
@@ -1118,6 +1111,8 @@ view_drift_failure_delete = Failed to delete drifts with id''s: {0}
view_drift_failure_deleteAll = Failed to delete all drifts from this source
view_drift_failure_load = Failed to fetch drift data
view_drift_success_delete = Successfully deleted {0} drifts
+view_drift_table_baseDir = Base Directory
+view_drift_table_resourceHistory = Resource Drift History
view_dynagroup_children = DynaGroup Children
view_dynagroup_compatible = Compatible
view_dynagroup_definitionAlreadyExists = A group definition already exists with this name
@@ -1636,6 +1631,7 @@ view_tabs_common_current = Current
view_tabs_common_dashboard = Dashboard
view_tabs_common_definitions = Definitions
view_tabs_common_deployed = Deployed
+view_tabs_common_drift = Drift
view_tabs_common_events = Events
view_tabs_common_graphs = Graphs
view_tabs_common_group_members = Group Members
@@ -1732,7 +1728,6 @@ view_upload_tooltip_1b = Select a file to upload, then click Next
view_upload_tooltip_2 = File upload had previously failed
view_upload_upload = Upload
view_upload_uploadFile = UploadFile
-
widget_colorPicker_tooltip = Click to select a new color
widget_durationItem_inputUnitLessThanTargetUnit = Input unit is less than target unit.
widget_durationItem_unitTypeNotSupported = Unit type [{0}] is not supported by this DurationItem.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
index 42d5ebb..792fa2a 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
@@ -8,7 +8,6 @@
# http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
-
common_alert_high = HOCH
common_alert_low = NIEDRIG
common_alert_medium = MITTEL
@@ -138,6 +137,7 @@ common_title_icon = Ikone
common_title_id = ID
common_title_id_parent = ID des Vaters
common_title_info = Info
+##common_title_interval = Interval
common_title_inventory = Inventar
common_title_inventorySummary = Inventar Zusammenfassung
common_title_lastUpdated = Zuletzt aktualisiert
@@ -240,7 +240,6 @@ common_val_none = Kein(e)
common_val_nth = {0}er
common_val_yes = Ja
common_val_yes_lower = ja
-
dataSource_ContentRepoTree_error_load = Error loading repositories~
dataSource_ContentRepoTree_field_parentId = Parent ID~
dataSource_bundle_loadFailed = Konnte die Bundle-Daten nicht laden
@@ -338,7 +337,6 @@ dataSource_users_field_passwordVerify = Passwort überprüfen
dataSource_users_field_phoneNumber = Telefonnummer
dataSource_users_invalidEmailAddress = Ungültige E-Mail-Adresse
dataSource_users_passwordsDoNotMatch = Passworte stimmen nicht überein.
-
datasource_templateSchedules_disabled = Das Erfassen der Messwerte für [{0}] wurde eingestellt.
datasource_templateSchedules_disabled_detailed = Sammeln der Daten für Metrik [{0}] [{1}] als Standard für Ressource-Tpypen mit ID [{2}] eingestellt.
datasource_templateSchedules_disabled_failed = Konnte das Sammeln der Daten für die Metrik [{0}] [{1}] als Standard für Ressourcen-Typ [{2}] nicht einstellen.
@@ -348,15 +346,11 @@ datasource_templateSchedules_enabled_failed = Konnte das Sammeln der Daten für
datasource_templateSchedules_updated = Zeitpläne für die ausgewählte Metrik [{0}] aktualisiert.
datasource_templateSchedules_updated_detail = Zeitplan für das Sammeln von Daten für Metrik [{0}] [{1}] als Standard für Ressourcen mit Typ-ID [{2}] auf [{3}] Sekunden gesetzt.
datasource_templateSchedules_updated_failed = Aktualisieren des Zeitplans auf [{0}] Sekunden für das Sammeln von Daten für Metrik [{1}] [{2}] als Standard für Ressourcen mit Typ-ID [{3}] ist fehlgeschlagen.
-
favorites = Lesezeichen
-
favorites_groups = Gemerkte Gruppen
favorites_recentlyViewed = Kürzlich angesehen
favorites_resources = Gemerkte Ressourcen
-
group_tree_partialClusterTooltip = {0} der {1} Gruppenmitglieder haben eine ''{2}'' Ressource
-
util_disambiguationReportDecorator_pluginSuffix = ({0} Plugin)
util_errorHandler_nullException = Exception war null
util_monitoringRequestCallback_error_checkServerStatusFailure = Unable to determine login status - check Server status.~
@@ -367,7 +361,6 @@ util_userPerm_loadFailResource = Failed to load your permissions for Resource wi
util_userSession_loadFailSubject = UserSessionManager: Konnte das 'Subject' des Benutzers nicht laden.
util_userSession_logoutFail = Ausloggen fehlgeschlagen
util_widgetsField_unlimited = Unbeschränkt
-
view_aboutBox_allRightsReserved = All Rights Reserved.~
view_aboutBox_buildNumber = Build-Nummer:
view_aboutBox_failedToLoad = Kann die Produktinformation nicht laden
@@ -942,6 +935,8 @@ view_dashboards_title = Dashboard
##view_drift_failure_deleteAll = Failed to delete all drifts from this source
##view_drift_failure_load = Failed to fetch drift data
##view_drift_success_delete = Successfully deleted {0} drifts
+##view_drift_table_baseDir = Base Directory
+##view_drift_table_resourceHistory = Resource Drift History
view_dynagroup_children = DynaGroup Children~
view_dynagroup_compatible = Kompatible
view_dynagroup_definitionAlreadyExists = A group definition already exists with this name~
@@ -1368,6 +1363,7 @@ view_tabs_common_current = Aktuell
view_tabs_common_dashboard = Dashboard
view_tabs_common_definitions = Definitionen
view_tabs_common_deployed = Installiert
+##view_tabs_common_drift = Drift
view_tabs_common_events = Ereignisse
view_tabs_common_graphs = Diagramme
view_tabs_common_group_members = Gruppenmitglieder
@@ -1457,7 +1453,6 @@ view_upload_success = File successfully uploaded~
view_upload_tooltip_2 = File upload had previously failed~
view_upload_upload = Hochladen
view_upload_uploadFile = UploadFile~
-
widget_recordEditor_error_invalidViewPath = Ungültiger Anzeigepfad: [{0}]
widget_recordEditor_error_multipleRecords = Mehrere Datensätze gefunden - erwartet wurde genau einer.
widget_recordEditor_error_noRecords = Keine Datensätze gefunden - erwartet wurde genau einer.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
index f9fe2dc..856c5c9 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
@@ -8,7 +8,6 @@
# http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
-
common_alert_high = High
common_alert_low = Low
common_alert_medium = Medium
@@ -147,6 +146,7 @@ common_title_host = ホスト
common_title_id = ID
common_title_id_parent = 親のID
common_title_info = 情報
+##common_title_interval = Interval
common_title_inventory = インベントリ
common_title_inventorySummary = インベントリサマリ
common_title_lastUpdated = 最終更新
@@ -250,7 +250,6 @@ common_val_none = None
common_val_nth = {0}th
common_val_yes = Yes
common_val_yes_lower = yes
-
dataSource_ContentRepoTree_error_load = Error loading repositories
dataSource_ContentRepoTree_field_parentId = Parent ID
dataSource_bundle_loadFailed = Failed to load Bundle data
@@ -358,7 +357,6 @@ dataSource_users_field_passwordVerify = パスワードの確認
dataSource_users_field_phoneNumber = 電話番号
dataSource_users_invalidEmailAddress = 無効なEメールアドレス
dataSource_users_passwordsDoNotMatch = パスワードが一致していません
-
datasource_roles_field_ldapGroups = LDAPグループ
datasource_roles_field_permissions = パーミッション
datasource_roles_field_resourceGroups = リソースグループ
@@ -372,15 +370,11 @@ datasource_templateSchedules_enabled_failed = Failed to enable collection of met
datasource_templateSchedules_updated = Updated collection intervals of selected metric [{0}].
datasource_templateSchedules_updated_detail = Collection interval for metric [{0}] [{1}] by default for ResourceType with id [{2}] set to [{3}] seconds.
datasource_templateSchedules_updated_failed = Failed to set collection interval to [{0}] seconds for metric [{1}] [{2}] by default for ResourceType with id [{3}].
-
favorites = お気に入り
-
favorites_groups = お気に入りグループ
favorites_recentlyViewed = 最近閲覧した
favorites_resources = お気に入りリソース
-
group_tree_partialClusterTooltip = {0} out of {1} group members have a ''{2}'' resource
-
util_ancestry_parentAncestry = Parent Ancestry for:
util_disambiguationReportDecorator_pluginSuffix = ({0} plugin)
util_errorHandler_nullException = exception was null
@@ -392,7 +386,6 @@ util_userPerm_loadFailResource = Failed to load your permissions for Resource wi
util_userSession_loadFailSubject = UserSessionManager: Failed to load user Subject
util_userSession_logoutFail = Failed to logout.
util_widgetsField_unlimited = Unlimited
-
view_aboutBox_allRightsReserved = All Rights Reserved.
view_aboutBox_buildNumber = ビルド番号:
view_aboutBox_failedToLoad = Failed to load product information.
@@ -1119,6 +1112,8 @@ view_dashboards_title = ダッシュボード
##view_drift_failure_deleteAll = Failed to delete all drifts from this source
##view_drift_failure_load = Failed to fetch drift data
##view_drift_success_delete = Successfully deleted {0} drifts
+##view_drift_table_baseDir = Base Directory
+##view_drift_table_resourceHistory = Resource Drift History
view_dynagroup_children = DynaGroup Children
view_dynagroup_compatible = Compatible
view_dynagroup_definitionAlreadyExists = A group definition already exists with this name
@@ -1637,6 +1632,7 @@ view_tabs_common_current = 現在
view_tabs_common_dashboard = ダッシュボード
view_tabs_common_definitions = 定義
view_tabs_common_deployed = デプロイ済み
+##view_tabs_common_drift = Drift
view_tabs_common_events = イベント
view_tabs_common_graphs = グラフ
view_tabs_common_group_members = グループメンバー
@@ -1733,7 +1729,6 @@ view_upload_tooltip_1b = Select a file to upload, then click Next
view_upload_tooltip_2 = File upload had previously failed
view_upload_upload = Upload
view_upload_uploadFile = UploadFile
-
widget_colorPicker_tooltip = Click to select a new color
widget_durationItem_inputUnitLessThanTargetUnit = Input unit is less than target unit.
widget_durationItem_unitTypeNotSupported = Unit type [{0}] is not supported by this DurationItem.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
index 226400c..60bc292 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
@@ -6,7 +6,6 @@
# http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
-
common_alert_high = Alto
common_alert_low = Baixo
common_alert_medium = M\u00E9dio
@@ -149,6 +148,7 @@ common_title_icon = \u00EDcone
common_title_id = ID
common_title_id_parent = ID do Recurso pai
common_title_info = Info
+##common_title_interval = Interval
common_title_inventory = Invent\u00E1rio
common_title_inventorySummary = Sum\u00E1rio do Invent\u00E1rio
common_title_lastUpdated = \u00DAltima Atualiza\u00E7\u00E3o
@@ -253,7 +253,6 @@ common_val_none = Nenhum
common_val_nth = {0}\u00BA
common_val_yes = Sim
common_val_yes_lower = sim
-
dataSource_ContentRepoTree_error_load = Erro ao carregar os reposit\u00F3rios
dataSource_ContentRepoTree_field_parentId = ID pai
dataSource_bundle_loadFailed = Falha ao carregar os dados do Bundle
@@ -370,7 +369,6 @@ dataSource_users_field_passwordVerify = Verifique a Senha
dataSource_users_field_phoneNumber = N\u00FAmero de Telefone
dataSource_users_invalidEmailAddress = Endere\u00E7o de email inv\u00E1lido.
dataSource_users_passwordsDoNotMatch = Senhas n\u00E3o conferem.
-
datasource_roles_field_ldapGroups = Grupos LDAP
datasource_roles_field_permissions = Permiss\u00F5es
datasource_roles_field_resourceGroups = Grupos de Recurso
@@ -384,15 +382,11 @@ datasource_templateSchedules_enabled_failed = Falha ao habilitar a coleta da m\u
datasource_templateSchedules_updated = Intervalos de coleta atualizados para a m\u00E9trica [{0}].
datasource_templateSchedules_updated_detail = Intervalo de coleta da m\u00E9trica [{0}] [{1}] para o Tipo de Recurso com id [{2}] configurado para [{3}] segundos.
datasource_templateSchedules_updated_failed = Falha ao configurar o intervalo de coleta para [{0}] segundos para a m\u00E9trica [{1}] [{2}] para o Tipo de Recurso com id [{3}].
-
favorites = Favoritos
-
favorites_groups = Grupos Favoritos
favorites_recentlyViewed = Acessados Recentemente
favorites_resources = Recursos Favoritos
-
group_tree_partialClusterTooltip = {0} out of {1} group members have a ''{2}'' resource
-
util_ancestry_parentAncestry = Ancestral para:
util_errorHandler_nullException = Exce\u00E7\u00E3o nula
util_monitoringRequestCallback_error_checkServerStatusFailure = Imposs\u00EDvel verificar o status do login - verifique o status do Servidor.
@@ -403,7 +397,6 @@ util_userPerm_loadFailResource = Falha ao carregar suas permiss\u00F5es para o R
util_userSession_loadFailSubject = UserSessionManager: Falha ao carregar a credencial do usu\u00E1rio
util_userSession_logoutFail = Falha durante o logout.
util_widgetsField_unlimited = Ilimitado
-
view_aboutBox_allRightsReserved = Todos os Direitos Reservados.~
view_aboutBox_buildNumber = N\u00FAmero do Build:~
view_aboutBox_failedToLoad = Falha ao carregar informa\u00E7oes do produto.~
@@ -1142,6 +1135,8 @@ view_dashboards_title = Dashboard~
##view_drift_failure_deleteAll = Failed to delete all drifts from this source
##view_drift_failure_load = Failed to fetch drift data
##view_drift_success_delete = Successfully deleted {0} drifts
+##view_drift_table_baseDir = Base Directory
+##view_drift_table_resourceHistory = Resource Drift History
view_dynagroup_children = DynaGroup Children~
view_dynagroup_compatible = Compatible
view_dynagroup_definitionAlreadyExists = A group definition already exists with this name~
@@ -1749,6 +1744,7 @@ view_tabs_common_current = Current~
view_tabs_common_dashboard = Dashboard~
view_tabs_common_definitions = Definitions~
view_tabs_common_deployed = Deployed~
+##view_tabs_common_drift = Drift
view_tabs_common_events = Events~
view_tabs_common_graphs = Graphs~
view_tabs_common_group_members = Group Members
@@ -1850,7 +1846,6 @@ view_upload_tooltip_1b = Select a file to upload, then click Next
view_upload_tooltip_2 = File upload had previously failed~
view_upload_upload = Upload~
view_upload_uploadFile = UploadFile~
-
widget_colorPicker_tooltip = Clique para selecionar uma nova cor
widget_durationItem_inputUnitLessThanTargetUnit = A unidade de entrada \u00E9 menor que a unidade final.
widget_durationItem_unitTypeNotSupported = Tipo de unidade [{0}] n\u00E3o suportada por este Item de Dura\u00E7\u00E3o.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
index 2eff633..21dcd58 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
@@ -6,7 +6,6 @@
# http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
-
common_alert_high = High
common_alert_low = Low
common_alert_medium = Medium
@@ -147,6 +146,7 @@ common_title_host = \u4E3B\u673A
common_title_id = ID
common_title_id_parent = \u7236ID
common_title_info = Info
+##common_title_interval = Interval
common_title_inventory = \u6E05\u5355
common_title_inventorySummary = \u6E05\u5355\u6C47\u603B
common_title_lastUpdated = \u6700\u8FD1\u66F4\u65B0
@@ -250,7 +250,6 @@ common_val_none = None
common_val_nth = {0}th
common_val_yes = Yes
common_val_yes_lower = yes
-
dataSource_ContentRepoTree_error_load = \u52A0\u8F7D\u5E93\u9519\u8BEF
dataSource_ContentRepoTree_field_parentId = \u7236ID
dataSource_bundle_loadFailed = \u52A0\u8F7Dbundle\u6570\u636E\u5931\u8D25
@@ -358,7 +357,6 @@ dataSource_users_field_passwordVerify = \u786E\u8BA4\u5BC6\u7801
dataSource_users_field_phoneNumber = \u7535\u8BDD\u53F7\u7801
dataSource_users_invalidEmailAddress = \u90AE\u7BB1\u5730\u5740\u65E0\u6548.
dataSource_users_passwordsDoNotMatch = \u5BC6\u7801\u4E0D\u5339\u914D.
-
datasource_roles_field_ldapGroups = LDAP\u7EC4
datasource_roles_field_permissions = \u6743\u9650
datasource_roles_field_resourceGroups = \u8D44\u6E90\u7EC4
@@ -372,15 +370,11 @@ datasource_templateSchedules_enabled_failed = Failed to enable collection of met
datasource_templateSchedules_updated = Updated collection intervals of selected metric [{0}].
datasource_templateSchedules_updated_detail = Collection interval for metric [{0}] [{1}] by default for ResourceType with id [{2}] set to [{3}] seconds.
datasource_templateSchedules_updated_failed = Failed to set collection interval to [{0}] seconds for metric [{1}] [{2}] by default for ResourceType with id [{3}].
-
favorites = \u6536\u85CF\u5939
-
favorites_groups = \u7EC4\u6536\u85CF\u5939
favorites_recentlyViewed = \u6700\u8FD1\u67E5\u770B
favorites_resources = \u8D44\u6E90\u6536\u85CF\u5939
-
group_tree_partialClusterTooltip = \u9664\u53BB {1},{0}\u7684\u7EC4\u6210\u5458\u62E5\u6709 \u4E00\u4E2A''{2}''\u8D44\u6E90
-
util_ancestry_parentAncestry = Parent Ancestry for:
util_errorHandler_nullException = exception was null
util_monitoringRequestCallback_error_checkServerStatusFailure = \u65E0\u6CD5\u786E\u5B9A\u767B\u5F55\u72B6\u6001- \u68C0\u67E5\u670D\u52A1\u5668\u72B6\u6001.
@@ -391,7 +385,6 @@ util_userPerm_loadFailResource = \u65E0\u6CD5\u8BBF\u95EE\u8D44\u6E90[{0}] - \u6
util_userSession_loadFailSubject = UserSessionManager: \u52A0\u8F7D\u7528\u6237\u4E3B\u9898\u5931\u8D25
util_userSession_logoutFail = \u6CE8\u9500\u5931\u8D25.
util_widgetsField_unlimited = \u65E0\u9650\u5236
-
view_aboutBox_allRightsReserved = All Rights Reserved.
view_aboutBox_buildNumber = \u4EA7\u54C1\u7F16\u8BD1\u53F7:
view_aboutBox_failedToLoad = \u52A0\u8F7D\u4EA7\u54C1\u4FE1\u606F\u5931\u8D25.
@@ -1118,6 +1111,8 @@ view_dashboards_title = \u7EDF\u8BA1\u8868\u76D8
##view_drift_failure_deleteAll = Failed to delete all drifts from this source
##view_drift_failure_load = Failed to fetch drift data
##view_drift_success_delete = Successfully deleted {0} drifts
+##view_drift_table_baseDir = Base Directory
+##view_drift_table_resourceHistory = Resource Drift History
view_dynagroup_children = \u5B50\u52A8\u6001\u7EC4
view_dynagroup_compatible = \u517C\u5BB9\u6027
view_dynagroup_definitionAlreadyExists = \u5DF2\u7ECF\u5B58\u5728\u4EE5\u8BE5\u540D\u79F0\u547D\u540D\u7684\u7EC4\u5B9A\u4E49
@@ -1636,6 +1631,7 @@ view_tabs_common_current = \u5F53\u524D
view_tabs_common_dashboard = \u7EDF\u8BA1\u8868\u76D8
view_tabs_common_definitions = \u5B9A\u4E49
view_tabs_common_deployed = \u5DF2\u53D1\u5E03
+##view_tabs_common_drift = Drift
view_tabs_common_events = \u4E8B\u4EF6
view_tabs_common_graphs = Graphs
view_tabs_common_group_members = \u7EC4\u5458
@@ -1732,7 +1728,6 @@ view_upload_tooltip_1b = \u9009\u62E9\u4E00\u4E2A\u6587\u4EF6\u4E0A\u4F20, \u713
view_upload_tooltip_2 = \u6587\u4EF6\u4E0A\u4F20 \u524D\u53D1\u751F\u9519\u8BEF
view_upload_upload = \u4E0A\u4F20
view_upload_uploadFile = \u4E0A\u4F20\u6587\u4EF6
-
widget_colorPicker_tooltip = \u9009\u62E9\u989C\u8272
widget_durationItem_inputUnitLessThanTargetUnit = \u8F93\u5165\u5355\u4F4D\u662F\u5C0F\u4E8E\u76EE\u6807\u5355\u4F4D.
widget_durationItem_unitTypeNotSupported = \u5355\u4F4D\u7C7B\u578B[{0}]\u4E0D\u88ABDurationItem\u652F\u6301.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java
index f153c81..8b1a295 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java
@@ -377,7 +377,7 @@ public class ResourceTypeManagerBean implements ResourceTypeManagerLocal, Resour
query.setParameter("resourceTypeId", resourceTypeId);
List<ResourceFacets> facets = query.getResultList();
if (facets.size() != 1) {
- return new ResourceFacets(resourceTypeId, false, false, false, false, false, false, false, false);
+ return new ResourceFacets(resourceTypeId, false, false, false, false, false, false, false, false, false);
}
return facets.get(0);
}
@@ -393,9 +393,10 @@ public class ResourceTypeManagerBean implements ResourceTypeManagerLocal, Resour
public Map<Integer, ResourceTypeTemplateCountComposite> getTemplateCountCompositeMap() {
Query templateCountQuery = entityManager.createNamedQuery(ResourceType.FIND_ALL_TEMPLATE_COUNT_COMPOSITES);
-
+
@SuppressWarnings("unchecked")
- List<ResourceTypeTemplateCountComposite> results = (List<ResourceTypeTemplateCountComposite>) templateCountQuery.getResultList();
+ List<ResourceTypeTemplateCountComposite> results = (List<ResourceTypeTemplateCountComposite>) templateCountQuery
+ .getResultList();
for (ResourceTypeTemplateCountComposite result : results) {
ResourceType type = result.getType();
@@ -455,16 +456,14 @@ public class ResourceTypeManagerBean implements ResourceTypeManagerLocal, Resour
@SuppressWarnings("unchecked")
public List<Integer> getResourceTypeIdsByPlugin(String plugin) {
- return entityManager.createNamedQuery(ResourceType.QUERY_FIND_IDS_BY_PLUGIN)
- .setParameter("plugin", plugin)
+ return entityManager.createNamedQuery(ResourceType.QUERY_FIND_IDS_BY_PLUGIN).setParameter("plugin", plugin)
.getResultList();
}
@Override
public Integer getResourceTypeCountByPlugin(String plugin) {
- return (Integer) entityManager.createNamedQuery(ResourceType.QUERY_FIND_COUNT_BY_PLUGIN)
- .setParameter("plugin", plugin)
- .getSingleResult();
+ return (Integer) entityManager.createNamedQuery(ResourceType.QUERY_FIND_COUNT_BY_PLUGIN).setParameter("plugin",
+ plugin).getSingleResult();
}
@SuppressWarnings("unchecked")
12 years, 11 months
[rhq] modules/plugins
by Heiko W. Rupp
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/UploadAndDeployTest.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit d6718f1139ed78493364cbd25e19ebec436822e7
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Jun 22 20:53:15 2011 +0200
Disable the individual test methods, as the class one did not work.
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/UploadAndDeployTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/UploadAndDeployTest.java
index 2c9f546..dfa9fd9 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/UploadAndDeployTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/UploadAndDeployTest.java
@@ -49,7 +49,7 @@ public class UploadAndDeployTest {
private static final String DC_HOST = "localhost";
private static final int DC_HTTP_PORT = 9990;
- @Test(timeOut = 60*1000L)
+ @Test(timeOut = 60*1000L, enabled=false)
public void testUploadOnly() throws Exception {
String bytes_value = prepare();
@@ -61,7 +61,7 @@ public class UploadAndDeployTest {
}
- @Test(timeOut = 60*1000L)
+ @Test(timeOut = 60*1000L, enabled=false)
public void testDoubleUploadOnly() throws Exception {
String bytes_value = prepare();
@@ -74,7 +74,7 @@ public class UploadAndDeployTest {
assert bytes_value.equals("7jgpMVmynfxpqp8UDleKLmtgbrA=");
}
- @Test(timeOut = 60*1000L)
+ @Test(timeOut = 60*1000L,enabled=false)
public void testUploadIndividualSteps() throws Exception {
String bytes_value = prepare();
@@ -154,7 +154,7 @@ public class UploadAndDeployTest {
}
// Test for AS7-853
- @Test(timeOut = 60*1000L)
+ @Test(timeOut = 60*1000L,enabled = false)
public void testUploadIndividualSteps2() throws Exception {
String bytes_value = prepare();
@@ -228,7 +228,7 @@ public class UploadAndDeployTest {
}
- @Test(timeOut = 60*1000L)
+ @Test(timeOut = 60*1000L,enabled = false)
public void testUploadComposite() throws Exception {
String bytes_value = prepare();
12 years, 11 months
[rhq] modules/plugins
by Heiko W. Rupp
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/UploadAndDeployTest.java | 12 +++++-----
1 file changed, 6 insertions(+), 6 deletions(-)
New commits:
commit 2906b2db5c170ef6d80dad8e74a1a1a956bb4ba0
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Jun 22 20:26:16 2011 +0200
Disable the test, as it needs a running as7
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/UploadAndDeployTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/UploadAndDeployTest.java
index 57ec4f3..2c9f546 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/UploadAndDeployTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/UploadAndDeployTest.java
@@ -41,7 +41,7 @@ import org.rhq.modules.plugins.jbossas7.json.Result;
* the UPLOAD_FILE must point to a valid archive in the resources directory.
* @author Heiko W. Rupp
*/
-@Test
+@Test(enabled = false) // TODO add an "integration test profile" that is able to fire the server before running the test
public class UploadAndDeployTest {
static final String TEST_WAR = "test.war";
@@ -49,7 +49,7 @@ public class UploadAndDeployTest {
private static final String DC_HOST = "localhost";
private static final int DC_HTTP_PORT = 9990;
- @Test(timeOut = 60*1000L, enabled = true)
+ @Test(timeOut = 60*1000L)
public void testUploadOnly() throws Exception {
String bytes_value = prepare();
@@ -61,7 +61,7 @@ public class UploadAndDeployTest {
}
- @Test(timeOut = 60*1000L, enabled = true)
+ @Test(timeOut = 60*1000L)
public void testDoubleUploadOnly() throws Exception {
String bytes_value = prepare();
@@ -74,7 +74,7 @@ public class UploadAndDeployTest {
assert bytes_value.equals("7jgpMVmynfxpqp8UDleKLmtgbrA=");
}
- @Test(timeOut = 60*1000L, enabled = true)
+ @Test(timeOut = 60*1000L)
public void testUploadIndividualSteps() throws Exception {
String bytes_value = prepare();
@@ -154,7 +154,7 @@ public class UploadAndDeployTest {
}
// Test for AS7-853
- @Test(timeOut = 60*1000L, enabled = true)
+ @Test(timeOut = 60*1000L)
public void testUploadIndividualSteps2() throws Exception {
String bytes_value = prepare();
@@ -228,7 +228,7 @@ public class UploadAndDeployTest {
}
- @Test(timeOut = 60*1000L, enabled = true)
+ @Test(timeOut = 60*1000L)
public void testUploadComposite() throws Exception {
String bytes_value = prepare();
12 years, 11 months
[rhq] Branch 'drift' - modules/core
by mazz
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfiguration.java | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit ae048c6bd26e801de1fb186156502bcc44be0082
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Jun 22 13:52:12 2011 -0400
need no-arg constructor so web services module can generate code and compile correctly
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfiguration.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfiguration.java
index 73bd73d..a7f18f5 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfiguration.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfiguration.java
@@ -77,6 +77,10 @@ public class DriftConfiguration implements Serializable {
private Configuration configuration;
+ // required for jaxb/web services stuff
+ protected DriftConfiguration() {
+ }
+
public DriftConfiguration(Configuration c) {
configuration = c;
}
12 years, 11 months
[rhq] Branch 'drift' - modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Drift_16.png |binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Drift_24.png |binary
2 files changed
New commits:
commit 1e612ab8f29ccf60ae2f538266797a7442d09c19
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Jun 22 12:55:40 2011 -0400
add some simple drift icons
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Drift_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Drift_16.png
new file mode 100644
index 0000000..a368ad4
Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Drift_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Drift_24.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Drift_24.png
new file mode 100644
index 0000000..1b3a7b4
Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Drift_24.png differ
12 years, 11 months
[rhq] Branch 'apache-integration-tests' - modules/core modules/plugins modules/test-utils
by lkrejci
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java | 19
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UpgradeSimpleConfigurationWithResolvableServerNamesTest.java | 131 ++
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UpgradeTestBase.java | 30
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheDeploymentUtil.java | 61 -
modules/plugins/apache/src/test/resources/mocked-inventories/rhq-1.3.x/includes/inventory.xml | 539 ----------
modules/plugins/apache/src/test/resources/mocked-inventories/rhq-1.3.x/simple/inventory.xml | 539 ++++++++++
modules/test-utils/src/main/java/org/rhq/test/TokenReplacingProperties.java | 9
7 files changed, 729 insertions(+), 599 deletions(-)
New commits:
commit ac3bee9ff340818cda04d0613c1cb44b8893a643
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed Jun 22 18:14:07 2011 +0200
Adding a test for upgrading apache that has 4 vhosts using the same servername (that uses an unresolvable hostname) from RHQ 1.3.x to the latest code.
A bunch of fixes all around the place to make stuff more overridable from code rather than only from the system properties.
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
index 5f8a922..4d5dc7d 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
@@ -271,6 +271,14 @@ public class FakeServerInventory {
return result;
}
+ public void removeResource(Resource r) {
+ resourceStore.remove(r.getUuid());
+ Resource parent = r.getParentResource();
+ if (parent != null) {
+ parent.getChildResources().remove(r);
+ }
+ }
+
private Resource fakePersist(Resource agentSideResource, InventoryStatus requiredInventoryStatus,
Set<String> inProgressUUIds) {
Resource persisted = resourceStore.get(agentSideResource.getUuid());
@@ -307,11 +315,18 @@ public class FakeServerInventory {
persisted.setParentResource(parent);
}
- Set<Resource> childResources = persisted.getChildResources();
+ //persist the children
+ Set<Resource> childResources = new LinkedHashSet<Resource>();
for (Resource child : agentSideResource.getChildResources()) {
childResources.add(fakePersist(child, requiredInventoryStatus, inProgressUUIds));
}
-
+ //now update the list with whatever the persisted resource contained in the past
+ //i.e. we prefer the current results from the agent but keep the children we used to
+ //have in the past. This is the same behavior as the actual RHQ server has.
+ childResources.addAll(persisted.getChildResources());
+
+ persisted.setChildResources(childResources);
+
inProgressUUIds.remove(agentSideResource.getUuid());
return persisted;
diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UpgradeSimpleConfigurationWithResolvableServerNamesTest.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UpgradeSimpleConfigurationWithResolvableServerNamesTest.java
index b196654..2ba6108 100644
--- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UpgradeSimpleConfigurationWithResolvableServerNamesTest.java
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UpgradeSimpleConfigurationWithResolvableServerNamesTest.java
@@ -23,8 +23,12 @@ import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Set;
+import java.util.TreeSet;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -44,54 +48,137 @@ import org.rhq.test.pc.PluginContainerSetup;
@Test(groups = "apache-integration-tests")
public class UpgradeSimpleConfigurationWithResolvableServerNamesTest extends UpgradeTestBase {
private static final Log LOG = LogFactory.getLog(UpgradeSimpleConfigurationWithResolvableServerNamesTest.class);
-
+
private enum Apache {
- V_1_3_x{
+ V_1_3_x {
public String getConfigDirName() {
return "1.3.x";
}
},
-
+
V_2_2_x {
public String getConfigDirName() {
return "2.2.x";
}
};
-
+
public abstract String getConfigDirName();
}
+
+ private static class TestConfiguration {
+ public Apache version;
+ public String configurationName;
+ public String serverRoot;
+ public String binPath;
+ public Map<String, String> defaultOverrides;
+
+ public void beforeTestSetup(TestSetup testSetup) {
+
+ }
+
+ public void beforePluginContainerStart(TestSetup setup) {
+
+ }
+
+ public void beforeTests() {
+
+ }
+ }
+
@Test
@PluginContainerSetup(plugins = { PLATFORM_PLUGIN, AUGEAS_PLUGIN, APACHE_PLUGIN })
@Parameters({ "apache2.install.dir", "apache2.exe.path" })
- public void testSimpleConfigurationWithResolvableServerNames_Apache2_upgradeFromRHQ1_3(
- String apacheInstallationDirectory, String exePath) throws Throwable {
-
- testUpgradeFromRHQ1_3(Apache.V_2_2_x, DEPLOYMENT_SIMPLE_WITH_RESOLVABLE_SERVERNAMES, apacheInstallationDirectory, exePath);
+ public void testWithResolvableServerNames_Apache2_upgradeFromRHQ1_3(final String installPath, final String exePath)
+ throws Throwable {
+
+ testUpgradeFromRHQ1_3(new TestConfiguration() {
+ {
+ serverRoot = installPath;
+ binPath = exePath;
+ configurationName = DEPLOYMENT_SIMPLE_WITH_RESOLVABLE_SERVERNAMES;
+ version = Apache.V_2_2_x;
+ }
+ });
}
- @Test(enabled = false) //ApacheServerOperationsDelegate doesn't work with apache 1.3
+ @Test(enabled = false)
+ //ApacheServerOperationsDelegate doesn't work with apache 1.3
@PluginContainerSetup(plugins = { PLATFORM_PLUGIN, AUGEAS_PLUGIN, APACHE_PLUGIN })
@Parameters({ "apache1.install.dir", "apache1.exe.path" })
- public void testSimpleConfigurationWithResolvableServerNames_Apache1_upgradeFromRHQ1_3(
- String apacheInstallationDirectory, String exePath) throws Throwable {
+ public void testWithResolvableServerNames_Apache1_upgradeFromRHQ1_3(final String installPath, final String exePath)
+ throws Throwable {
+
+ testUpgradeFromRHQ1_3(new TestConfiguration() {{
+ serverRoot = installPath;
+ binPath = exePath;
+ configurationName = DEPLOYMENT_SIMPLE_WITH_RESOLVABLE_SERVERNAMES;
+ version = Apache.V_1_3_x;
+ }});
+ }
- testUpgradeFromRHQ1_3(Apache.V_1_3_x, DEPLOYMENT_SIMPLE_WITH_RESOLVABLE_SERVERNAMES, apacheInstallationDirectory, exePath);
+ @Test
+ @PluginContainerSetup(plugins = { PLATFORM_PLUGIN, AUGEAS_PLUGIN, APACHE_PLUGIN })
+ @Parameters({ "apache2.install.dir", "apache2.exe.path" })
+ public void testWithUnresolvableServerNames_Apache2_upgradeFromRHQ1_3(final String installPath, final String exePath) throws Throwable {
+ testUpgradeFromRHQ1_3(new TestConfiguration() {
+ {
+ configurationName = DEPLOYMENT_SIMPLE_WITH_UNRESOLVABLE_SERVER_NAMES;
+ serverRoot = installPath;
+ binPath = exePath;
+ version = Apache.V_2_2_x;
+
+ defaultOverrides = new HashMap<String, String>();
+ defaultOverrides.put(variableName(configurationName, "servername.directive"), "ServerName ${unresolvable.host}");
+ defaultOverrides.put(variableName(configurationName, "vhost1.servername.directive"), "ServerName ${unresolvable.host}");
+ defaultOverrides.put(variableName(configurationName, "vhost2.servername.directive"), "ServerName ${unresolvable.host}");
+ defaultOverrides.put(variableName(configurationName, "vhost3.servername.directive"), "ServerName ${unresolvable.host}");
+ defaultOverrides.put(variableName(configurationName, "vhost4.servername.directive"), "ServerName ${unresolvable.host}");
+ }
+
+ @Override
+ public void beforePluginContainerStart(TestSetup setup) {
+ //in this scenario, the RHQ 1.3 would only discover 1 vhost (and the main vhost), because they would have the same resource key
+ //due to the same ServerName. I need to process the default inventory to reflect that otherwise I would get upgrade
+ //failures.
+
+ Set<Resource> vhosts = setup.getFakeInventory().findResourcesByType(findApachePluginResourceTypeByName("Apache Virtual Host"));
+ Set<Resource> uniques = new TreeSet<Resource>(new Comparator<Resource>() {
+ public int compare(Resource a, Resource b) {
+ return a.getResourceKey().compareTo(b.getResourceKey());
+ }
+ });
+
+ for(Resource vhost : vhosts) {
+ if (uniques.contains(vhost)) {
+ //remove the vhost from the server's inventory
+ setup.getFakeInventory().removeResource(vhost);
+ } else {
+ uniques.add(vhost);
+ }
+ }
+ }
+ });
}
- private void testUpgradeFromRHQ1_3(Apache version, String configurationName, String serverRoot, String binPath) throws Throwable {
- final TestSetup setup = new TestSetup(configurationName);
+ private void testUpgradeFromRHQ1_3(TestConfiguration testConfiguration) throws Throwable {
+ final TestSetup setup = new TestSetup(testConfiguration.configurationName);
boolean testFailed = false;
try {
+ testConfiguration.beforeTestSetup(setup);
- String configPath = "/full-configurations/" + version.getConfigDirName() + "/simple/httpd.conf";
-
- setup.withInventoryFrom("/mocked-inventories/rhq-1.3.x/includes/inventory.xml")
- .withPlatformResource(platform).withDefaultExpectations().withApacheSetup()
- .withConfigurationFiles(configPath, "/snmpd.conf", "/mime.types")
- .withServerRoot(serverRoot).withExePath(binPath).setup();
+ String configPath = "/full-configurations/" + testConfiguration.version.getConfigDirName() + "/simple/httpd.conf";
+
+ setup.withInventoryFrom("/mocked-inventories/rhq-1.3.x/simple/inventory.xml")
+ .withPlatformResource(platform).withDefaultExpectations().withDefaultOverrides(testConfiguration.defaultOverrides)
+ .withApacheSetup().withConfigurationFiles(configPath, "/snmpd.conf", "/mime.types")
+ .withServerRoot(testConfiguration.serverRoot).withExePath(testConfiguration.binPath).setup();
+ testConfiguration.beforePluginContainerStart(setup);
+
startConfiguredPluginContainer();
+ testConfiguration.beforeTests();
+
//ok, now we should see the resources upgraded in the fake server inventory.
ResourceType serverResourceType = findApachePluginResourceTypeByName("Apache HTTP Server");
ResourceType vhostResourceType = findApachePluginResourceTypeByName("Apache Virtual Host");
@@ -102,7 +189,7 @@ public class UpgradeSimpleConfigurationWithResolvableServerNamesTest extends Upg
Resource server = servers.iterator().next();
- String expectedResourceKey = ApacheServerDiscoveryComponent.formatResourceKey(serverRoot, serverRoot
+ String expectedResourceKey = ApacheServerDiscoveryComponent.formatResourceKey(testConfiguration.serverRoot, testConfiguration.serverRoot
+ "/conf/httpd.conf");
assertEquals(server.getResourceKey(), expectedResourceKey,
@@ -110,7 +197,7 @@ public class UpgradeSimpleConfigurationWithResolvableServerNamesTest extends Upg
Set<Resource> vhosts = setup.getFakeInventory().findResourcesByType(vhostResourceType);
- assertEquals(vhosts.size(), 5, "There should be 5 vhosts discovered but found " + vhosts.size());
+ assertEquals(vhosts.size(), 5, "Unexpected number of vhosts discovered found");
List<String> expectedResourceKeys = new ArrayList<String>(5);
diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UpgradeTestBase.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UpgradeTestBase.java
index e44dc99..16bd06b 100644
--- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UpgradeTestBase.java
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UpgradeTestBase.java
@@ -31,15 +31,14 @@ import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import org.jmock.Expectations;
-import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Parameters;
import org.rhq.core.clientapi.agent.metadata.PluginMetadataParser;
import org.rhq.core.clientapi.descriptor.AgentPluginDescriptorUtil;
@@ -81,7 +80,8 @@ public class UpgradeTestBase extends PluginContainerTest {
private Resource platform;
private ApacheSetup apacheSetup = new ApacheSetup();
private DeploymentConfig deploymentConfig;
-
+ private Map<String, String> defaultOverrides = new HashMap<String, String>();
+
public class ApacheSetup {
private String serverRoot;
private String exePath;
@@ -97,7 +97,7 @@ public class UpgradeTestBase extends PluginContainerTest {
this.serverRoot = serverRoot;
//auto-define the server root property as if it was passed on the commandline
System.getProperties().put(configurationName + ".server.root", serverRoot);
- deploymentConfig = ApacheDeploymentUtil.getDeploymentConfigurationFromSystemProperties(configurationName);
+ deploymentConfig = ApacheDeploymentUtil.getDeploymentConfigurationFromSystemProperties(configurationName, defaultOverrides);
return this;
}
@@ -179,14 +179,20 @@ public class UpgradeTestBase extends PluginContainerTest {
public TestSetup(String configurationName) {
this.configurationName = configurationName;
- deploymentConfig = ApacheDeploymentUtil.getDeploymentConfigurationFromSystemProperties(configurationName);
+ deploymentConfig = ApacheDeploymentUtil.getDeploymentConfigurationFromSystemProperties(configurationName, defaultOverrides);
}
public TestSetup withInventoryFrom(String classPathUri) {
inventoryFile = classPathUri;
return this;
}
-
+
+ public TestSetup withDefaultOverrides(Map<String, String> defaultOverrides) {
+ this.defaultOverrides = defaultOverrides == null ? new HashMap<String, String>() : defaultOverrides;
+ deploymentConfig = ApacheDeploymentUtil.getDeploymentConfigurationFromSystemProperties(configurationName, this.defaultOverrides);
+ return this;
+ }
+
public TestSetup withPlatformResource(Resource platform) {
this.platform = platform;
return this;
@@ -255,7 +261,7 @@ public class UpgradeTestBase extends PluginContainerTest {
public TestSetup setup() throws Exception {
apacheSetup.doSetup();
- Map<String, String> replacements = deploymentConfig.getTokenReplacements();
+ Map<String, String> replacements = deploymentConfig.getTokenReplacements();
replacements.put("server.root", apacheSetup.serverRoot);
replacements.put("exe.path", apacheSetup.exePath);
replacements.put("localhost", determineLocalhost());
@@ -412,4 +418,14 @@ public class UpgradeTestBase extends PluginContainerTest {
return null;
}
+ protected static String variableName(String prefix, String name) {
+ StringBuilder bld = new StringBuilder();
+ if (prefix != null && !prefix.isEmpty()) {
+ bld.append(prefix).append(".");
+ }
+
+ bld.append(name);
+
+ return bld.toString();
+ }
}
diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheDeploymentUtil.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheDeploymentUtil.java
index 59e5d7e..97abce3 100644
--- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheDeploymentUtil.java
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheDeploymentUtil.java
@@ -203,30 +203,36 @@ public class ApacheDeploymentUtil {
checkOrAddDefault(variables, "port3", "11677");
checkOrAddDefault(variables, "port4", "11678");
- checkOrAddDefault(variables, prefix + ".listen1", "${port1}");
- checkOrAddDefault(variables, prefix + ".listen2", "${port2}");
- checkOrAddDefault(variables, prefix + ".listen3", "${port3}");
- checkOrAddDefault(variables, prefix + ".listen4", "${port4}");
-
- checkOrAddDefault(variables, prefix + ".vhost1.servername", "${localhost}:${port1}");
- checkOrAddDefault(variables, prefix + ".vhost1.urls", "${" + prefix + ".vhost1.servername}");
- checkOrAddDefault(variables, prefix + ".vhost1.servername.directive", "ServerName ${" + prefix
- + ".vhost1.servername}");
-
- checkOrAddDefault(variables, prefix + ".vhost2.servername", "${localhost}:${port2}");
- checkOrAddDefault(variables, prefix + ".vhost2.urls", "${" + prefix + ".vhost2.servername}");
- checkOrAddDefault(variables, prefix + ".vhost2.servername.directive", "ServerName ${" + prefix
- + ".vhost2.servername}");
-
- checkOrAddDefault(variables, prefix + ".vhost3.servername", "${localhost}:${port3}");
- checkOrAddDefault(variables, prefix + ".vhost3.urls", "${" + prefix + ".vhost3.servername}");
- checkOrAddDefault(variables, prefix + ".vhost3.servername.directive", "ServerName ${" + prefix
- + ".vhost3.servername}");
-
- checkOrAddDefault(variables, prefix + ".vhost4.servername", "${localhost}:${port4}");
- checkOrAddDefault(variables, prefix + ".vhost4.urls", "${" + prefix + ".vhost4.servername}");
- checkOrAddDefault(variables, prefix + ".vhost4.servername.directive", "ServerName ${" + prefix
- + ".vhost4.servername}");
+ if (prefix != null && !prefix.trim().isEmpty()) {
+ prefix += ".";
+ } else {
+ prefix = "";
+ }
+
+ checkOrAddDefault(variables, prefix + "listen1", "${port1}");
+ checkOrAddDefault(variables, prefix + "listen2", "${port2}");
+ checkOrAddDefault(variables, prefix + "listen3", "${port3}");
+ checkOrAddDefault(variables, prefix + "listen4", "${port4}");
+
+ checkOrAddDefault(variables, prefix + "vhost1.servername", "${localhost}:${port1}");
+ checkOrAddDefault(variables, prefix + "vhost1.urls", "${" + prefix + "vhost1.servername}");
+ checkOrAddDefault(variables, prefix + "vhost1.servername.directive", "ServerName ${" + prefix
+ + "vhost1.servername}");
+
+ checkOrAddDefault(variables, prefix + "vhost2.servername", "${localhost}:${port2}");
+ checkOrAddDefault(variables, prefix + "vhost2.urls", "${" + prefix + "vhost2.servername}");
+ checkOrAddDefault(variables, prefix + "vhost2.servername.directive", "ServerName ${" + prefix
+ + "vhost2.servername}");
+
+ checkOrAddDefault(variables, prefix + "vhost3.servername", "${localhost}:${port3}");
+ checkOrAddDefault(variables, prefix + "vhost3.urls", "${" + prefix + "vhost3.servername}");
+ checkOrAddDefault(variables, prefix + "vhost3.servername.directive", "ServerName ${" + prefix
+ + "vhost3.servername}");
+
+ checkOrAddDefault(variables, prefix + "vhost4.servername", "${localhost}:${port4}");
+ checkOrAddDefault(variables, prefix + "vhost4.urls", "${" + prefix + "vhost4.servername}");
+ checkOrAddDefault(variables, prefix + "vhost4.servername.directive", "ServerName ${" + prefix
+ + "vhost4.servername}");
}
private static void checkOrAddDefault(Map<String, String> map, String key, String value) {
@@ -234,12 +240,13 @@ public class ApacheDeploymentUtil {
map.put(key, value);
}
}
-
- public static DeploymentConfig getDeploymentConfigurationFromSystemProperties(String variablesPrefix) {
+
+ public static DeploymentConfig getDeploymentConfigurationFromSystemProperties(String variablesPrefix, Map<String, String> defaultOverrides) {
DeploymentConfig ret = new DeploymentConfig();
- Map<String, String> properties = new TokenReplacingProperties(System.getProperties());
+ TokenReplacingProperties properties = new TokenReplacingProperties(defaultOverrides);
addDefaultVariables(properties, variablesPrefix);
+ properties.putAll(System.getProperties());
variablesPrefix += ".";
diff --git a/modules/plugins/apache/src/test/resources/mocked-inventories/rhq-1.3.x/includes/inventory.xml b/modules/plugins/apache/src/test/resources/mocked-inventories/rhq-1.3.x/includes/inventory.xml
deleted file mode 100644
index c3a82eb..0000000
--- a/modules/plugins/apache/src/test/resources/mocked-inventories/rhq-1.3.x/includes/inventory.xml
+++ /dev/null
@@ -1,539 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<inventory-dump>
-<classes-used>
-<class>org.rhq.core.domain.resource.Resource</class>
-</classes-used>
-<objects>
-
-<resource>
- <id>10004</id>
- <uuid>ae8a7a3e-256e-4c0a-9a65-33d534523d92</uuid>
- <resourceKey>${server.root}</resourceKey>
- <name>${localhost} Apache 2.2.17 (${server.root}/)</name>
- <inventoryStatus>COMMITTED</inventoryStatus>
- <connected>true</connected>
- <version>2.2.17</version>
- <description>Apache Web Server</description>
- <ctime>1307353451273</ctime>
- <mtime>1307353509168</mtime>
- <itime>1307353509168</itime>
- <modifiedBy>
- <factive>false</factive>
- <fsystem>false</fsystem>
- <id>1</id>
- </modifiedBy>
- <resourceType>
- <category>SERVER</category>
- <createDeletePolicy>NEITHER</createDeletePolicy>
- <creationDataType>CONFIGURATION</creationDataType>
- <description>an Apache HTTP Server instance</description>
- <id>10013</id>
- <name>Apache HTTP Server</name>
- <plugin>Apache</plugin>
- <pluginConfigurationDefinition>
- <id>10012</id>
- <propertyDefinitions/>
- </pluginConfigurationDefinition>
- <singleton>false</singleton>
- <supportsManualAdd>true</supportsManualAdd>
- </resourceType>
- <childResources>
- <id>10022</id>
- <uuid>08290193-c716-4363-b841-8a1d9d83f580</uuid>
- <resourceKey>${localhost}:0</resourceKey>
- <name>Virtual Host ${localhost}:0</name>
- <inventoryStatus>COMMITTED</inventoryStatus>
- <connected>false</connected>
- <version></version>
- <description>Apache/2.2.17 (Unix) CovalentSNMP/2.3.0</description>
- <ctime>1307353587727</ctime>
- <mtime>1307353587727</mtime>
- <itime>1307353587721</itime>
- <modifiedBy>
- <factive>false</factive>
- <fsystem>false</fsystem>
- <id>1</id>
- </modifiedBy>
- <resourceType>
- <category>SERVICE</category>
- <createDeletePolicy>NEITHER</createDeletePolicy>
- <creationDataType>CONFIGURATION</creationDataType>
- <id>10014</id>
- <name>Apache Virtual Host</name>
- <plugin>Apache</plugin>
- <pluginConfigurationDefinition>
- <id>10013</id>
- <propertyDefinitions/>
- </pluginConfigurationDefinition>
- <singleton>false</singleton>
- <supportsManualAdd>false</supportsManualAdd>
- </resourceType>
- <resourceConfiguration>
- <id>10137</id>
- <version>0</version>
- <ctime>1307353587728</ctime>
- <mtime>1307353587728</mtime>
- </resourceConfiguration>
- <pluginConfiguration>
- <id>10138</id>
- <notes>null</notes>
- <version>0</version>
- <ctime>1307353587728</ctime>
- <mtime>1307353587728</mtime>
- <propertySimple>
- <id>10690</id>
- <name>responseTimeUrlExcludes</name>
- <override>false</override>
- </propertySimple>
- <propertySimple>
- <id>10689</id>
- <name>responseTimeLogFile</name>
- <override>false</override>
- <stringValue>${server.root}/logs/${localhost}0_rt.log</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10692</id>
- <name>url</name>
- <override>false</override>
- <stringValue>http://${localhost}:0/</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10693</id>
- <name>snmpWwwServiceIndex</name>
- <override>false</override>
- <stringValue>1</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10691</id>
- <name>responseTimeUrlTransforms</name>
- <override>false</override>
- </propertySimple>
- </pluginConfiguration>
- <agent>
- <backFilled>false</backFilled>
- <id>10001</id>
- <port>0</port>
- </agent>
- <currentAvailability>
- <availabilityType>DOWN</availabilityType>
- </currentAvailability>
- </childResources>
- <childResources>
- <id>10021</id>
- <uuid>3a20d809-7eba-422c-a3ef-baf65804498d</uuid>
- <resourceKey>${vhost2.snmp.identifier}</resourceKey>
- <name>Virtual Host ${vhost2.snmp.identifier}</name>
- <inventoryStatus>COMMITTED</inventoryStatus>
- <connected>false</connected>
- <version></version>
- <description>Apache/2.2.17 (Unix) CovalentSNMP/2.3.0</description>
- <ctime>1307353587648</ctime>
- <mtime>1307353587648</mtime>
- <itime>1307353587648</itime>
- <modifiedBy>
- <factive>false</factive>
- <fsystem>false</fsystem>
- <id>1</id>
- </modifiedBy>
- <resourceType>
- <category>SERVICE</category>
- <createDeletePolicy>NEITHER</createDeletePolicy>
- <creationDataType>CONFIGURATION</creationDataType>
- <id>10014</id>
- <name>Apache Virtual Host</name>
- <plugin>Apache</plugin>
- <pluginConfigurationDefinition>
- <id>10013</id>
- <propertyDefinitions/>
- </pluginConfigurationDefinition>
- <singleton>false</singleton>
- <supportsManualAdd>false</supportsManualAdd>
- </resourceType>
- <resourceConfiguration>
- <id>10135</id>
- <version>0</version>
- <ctime>1307353587666</ctime>
- <mtime>1307353587666</mtime>
- </resourceConfiguration>
- <pluginConfiguration>
- <id>10136</id>
- <notes>null</notes>
- <version>0</version>
- <ctime>1307353587667</ctime>
- <mtime>1307353587667</mtime>
- <propertySimple>
- <id>10685</id>
- <name>responseTimeUrlExcludes</name>
- <override>false</override>
- </propertySimple>
- <propertySimple>
- <id>10684</id>
- <name>responseTimeLogFile</name>
- <override>false</override>
- <stringValue>${server.root}/logs/127.0.0.111676_rt.log</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10687</id>
- <name>url</name>
- <override>false</override>
- <stringValue>http://${vhost2.snmp.identifier}/</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10688</id>
- <name>snmpWwwServiceIndex</name>
- <override>false</override>
- <stringValue>4</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10686</id>
- <name>responseTimeUrlTransforms</name>
- <override>false</override>
- </propertySimple>
- </pluginConfiguration>
- <agent>
- <backFilled>false</backFilled>
- <id>10001</id>
- <port>0</port>
- </agent>
- <currentAvailability>
- <availabilityType>UP</availabilityType>
- </currentAvailability>
- </childResources>
- <childResources>
- <id>10023</id>
- <uuid>c62c5d75-81dd-4b14-a768-2d8c1fca6c88</uuid>
- <resourceKey>${vhost3.snmp.identifier}</resourceKey>
- <name>Virtual Host ${vhost3.snmp.identifier}</name>
- <inventoryStatus>COMMITTED</inventoryStatus>
- <connected>false</connected>
- <version></version>
- <description>Apache/2.2.17 (Unix) CovalentSNMP/2.3.0</description>
- <ctime>1307353587738</ctime>
- <mtime>1307353587738</mtime>
- <itime>1307353587737</itime>
- <modifiedBy>
- <factive>false</factive>
- <fsystem>false</fsystem>
- <id>1</id>
- </modifiedBy>
- <resourceType>
- <category>SERVICE</category>
- <createDeletePolicy>NEITHER</createDeletePolicy>
- <creationDataType>CONFIGURATION</creationDataType>
- <id>10014</id>
- <name>Apache Virtual Host</name>
- <plugin>Apache</plugin>
- <pluginConfigurationDefinition>
- <id>10013</id>
- <propertyDefinitions/>
- </pluginConfigurationDefinition>
- <singleton>false</singleton>
- <supportsManualAdd>false</supportsManualAdd>
- </resourceType>
- <resourceConfiguration>
- <id>10139</id>
- <version>0</version>
- <ctime>1307353587738</ctime>
- <mtime>1307353587738</mtime>
- </resourceConfiguration>
- <pluginConfiguration>
- <id>10140</id>
- <notes>null</notes>
- <version>0</version>
- <ctime>1307353587738</ctime>
- <mtime>1307353587738</mtime>
- <propertySimple>
- <id>10695</id>
- <name>responseTimeUrlExcludes</name>
- <override>false</override>
- </propertySimple>
- <propertySimple>
- <id>10694</id>
- <name>responseTimeLogFile</name>
- <override>false</override>
- <stringValue>${server.root}/logs/127.0.0.111677_rt.log</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10697</id>
- <name>url</name>
- <override>false</override>
- <stringValue>http://${vhost3.snmp.identifier}/</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10698</id>
- <name>snmpWwwServiceIndex</name>
- <override>false</override>
- <stringValue>3</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10696</id>
- <name>responseTimeUrlTransforms</name>
- <override>false</override>
- </propertySimple>
- </pluginConfiguration>
- <agent>
- <backFilled>false</backFilled>
- <id>10001</id>
- <port>0</port>
- </agent>
- <currentAvailability>
- <availabilityType>UP</availabilityType>
- </currentAvailability>
- </childResources>
- <childResources>
- <id>10024</id>
- <uuid>d1b59168-8666-4bc0-957e-171bf16eec73</uuid>
- <resourceKey>${vhost1.snmp.identifier}</resourceKey>
- <name>Virtual Host ${vhost1.snmp.identifier}</name>
- <inventoryStatus>COMMITTED</inventoryStatus>
- <connected>false</connected>
- <version></version>
- <description>Apache/2.2.17 (Unix) CovalentSNMP/2.3.0</description>
- <ctime>1307353587751</ctime>
- <mtime>1307353587751</mtime>
- <itime>1307353587750</itime>
- <modifiedBy>
- <factive>false</factive>
- <fsystem>false</fsystem>
- <id>1</id>
- </modifiedBy>
- <resourceType>
- <category>SERVICE</category>
- <createDeletePolicy>NEITHER</createDeletePolicy>
- <creationDataType>CONFIGURATION</creationDataType>
- <id>10014</id>
- <name>Apache Virtual Host</name>
- <plugin>Apache</plugin>
- <pluginConfigurationDefinition>
- <id>10013</id>
- <propertyDefinitions/>
- </pluginConfigurationDefinition>
- <singleton>false</singleton>
- <supportsManualAdd>false</supportsManualAdd>
- </resourceType>
- <resourceConfiguration>
- <id>10171</id>
- <version>0</version>
- <ctime>1307353587751</ctime>
- <mtime>1307353587751</mtime>
- </resourceConfiguration>
- <pluginConfiguration>
- <id>10172</id>
- <notes>null</notes>
- <version>0</version>
- <ctime>1307353587751</ctime>
- <mtime>1307353587751</mtime>
- <propertySimple>
- <id>10700</id>
- <name>responseTimeUrlExcludes</name>
- <override>false</override>
- </propertySimple>
- <propertySimple>
- <id>10699</id>
- <name>responseTimeLogFile</name>
- <override>false</override>
- <stringValue>${server.root}/logs/127.0.0.111675_rt.log</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10702</id>
- <name>url</name>
- <override>false</override>
- <stringValue>http://${vhost1.snmp.identifier}/</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10703</id>
- <name>snmpWwwServiceIndex</name>
- <override>false</override>
- <stringValue>5</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10701</id>
- <name>responseTimeUrlTransforms</name>
- <override>false</override>
- </propertySimple>
- </pluginConfiguration>
- <agent>
- <backFilled>false</backFilled>
- <id>10001</id>
- <port>0</port>
- </agent>
- <currentAvailability>
- <availabilityType>UP</availabilityType>
- </currentAvailability>
- </childResources>
- <childResources>
- <id>10025</id>
- <uuid>310281d2-60c6-4d7d-bcdc-c51d7969c906</uuid>
- <resourceKey>${vhost4.snmp.identifier}</resourceKey>
- <name>Virtual Host ${vhost4.snmp.identifier}</name>
- <inventoryStatus>COMMITTED</inventoryStatus>
- <connected>false</connected>
- <version></version>
- <description>Apache/2.2.17 (Unix) CovalentSNMP/2.3.0</description>
- <ctime>1307353587761</ctime>
- <mtime>1307353587761</mtime>
- <itime>1307353587760</itime>
- <modifiedBy>
- <factive>false</factive>
- <fsystem>false</fsystem>
- <id>1</id>
- </modifiedBy>
- <resourceType>
- <category>SERVICE</category>
- <createDeletePolicy>NEITHER</createDeletePolicy>
- <creationDataType>CONFIGURATION</creationDataType>
- <id>10014</id>
- <name>Apache Virtual Host</name>
- <plugin>Apache</plugin>
- <pluginConfigurationDefinition>
- <id>10013</id>
- <propertyDefinitions/>
- </pluginConfigurationDefinition>
- <singleton>false</singleton>
- <supportsManualAdd>false</supportsManualAdd>
- </resourceType>
- <resourceConfiguration>
- <id>10173</id>
- <version>0</version>
- <ctime>1307353587761</ctime>
- <mtime>1307353587761</mtime>
- </resourceConfiguration>
- <pluginConfiguration>
- <id>10174</id>
- <notes>null</notes>
- <version>0</version>
- <ctime>1307353587761</ctime>
- <mtime>1307353587761</mtime>
- <propertySimple>
- <id>10705</id>
- <name>responseTimeUrlExcludes</name>
- <override>false</override>
- </propertySimple>
- <propertySimple>
- <id>10704</id>
- <name>responseTimeLogFile</name>
- <override>false</override>
- <stringValue>${server.root}/logs/127.0.0.111678_rt.log</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10707</id>
- <name>url</name>
- <override>false</override>
- <stringValue>http://${vhost4.snmp.identifier}/</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10708</id>
- <name>snmpWwwServiceIndex</name>
- <override>false</override>
- <stringValue>2</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10706</id>
- <name>responseTimeUrlTransforms</name>
- <override>false</override>
- </propertySimple>
- </pluginConfiguration>
- <agent>
- <backFilled>false</backFilled>
- <id>10001</id>
- <port>0</port>
- </agent>
- <currentAvailability>
- <availabilityType>UP</availabilityType>
- </currentAvailability>
- </childResources>
- <resourceConfiguration>
- <id>10142</id>
- <version>0</version>
- <ctime>1307353451273</ctime>
- <mtime>1307353451273</mtime>
- </resourceConfiguration>
- <pluginConfiguration>
- <id>10073</id>
- <notes>null</notes>
- <version>0</version>
- <ctime>1307353737118</ctime>
- <mtime>1307353737118</mtime>
- <propertySimple>
- <id>10365</id>
- <name>errorLogMinimumSeverity</name>
- <override>false</override>
- <stringValue>error</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10366</id>
- <name>errorLogIncludesPattern</name>
- <override>false</override>
- </propertySimple>
- <propertySimple>
- <id>10367</id>
- <name>snmpAgentCommunity</name>
- <override>false</override>
- <stringValue>public</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10368</id>
- <name>errorLogFilePath</name>
- <override>false</override>
- </propertySimple>
- <propertySimple>
- <id>10369</id>
- <name>errorLogEventsEnabled</name>
- <override>false</override>
- <stringValue>false</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10370</id>
- <name>snmpAgentHost</name>
- <override>false</override>
- <stringValue>127.0.0.1</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10713</id>
- <name>controlScriptPath</name>
- <override>false</override>
- </propertySimple>
- <propertySimple>
- <id>10714</id>
- <name>url</name>
- <override>false</override>
- </propertySimple>
- <propertySimple>
- <id>10364</id>
- <name>configFile</name>
- <override>false</override>
- <stringValue>conf/httpd.conf</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10711</id>
- <name>executablePath</name>
- <override>false</override>
- <stringValue>${exe.path}</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10712</id>
- <name>snmpAgentPort</name>
- <override>false</override>
- <stringValue>1610</stringValue>
- </propertySimple>
- <propertySimple>
- <id>10715</id>
- <name>serverRoot</name>
- <override>false</override>
- <stringValue>${server.root}</stringValue>
- </propertySimple>
- </pluginConfiguration>
- <agent>
- <backFilled>false</backFilled>
- <id>10001</id>
- <port>0</port>
- </agent>
- <currentAvailability>
- <availabilityType>UP</availabilityType>
- </currentAvailability>
- <productVersion>
- <id>10003</id>
- </productVersion>
-</resource>
-</objects>
-</inventory-dump>
diff --git a/modules/plugins/apache/src/test/resources/mocked-inventories/rhq-1.3.x/simple/inventory.xml b/modules/plugins/apache/src/test/resources/mocked-inventories/rhq-1.3.x/simple/inventory.xml
new file mode 100644
index 0000000..1aa8b38
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/mocked-inventories/rhq-1.3.x/simple/inventory.xml
@@ -0,0 +1,539 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<inventory-dump>
+<classes-used>
+<class>org.rhq.core.domain.resource.Resource</class>
+</classes-used>
+<objects>
+
+<resource>
+ <id>10004</id>
+ <uuid>ae8a7a3e-256e-4c0a-9a65-33d534523d92</uuid>
+ <resourceKey>${server.root}</resourceKey>
+ <name>${localhost} Apache 2.2.17 (${server.root}/)</name>
+ <inventoryStatus>COMMITTED</inventoryStatus>
+ <connected>true</connected>
+ <version>2.2.17</version>
+ <description>Apache Web Server</description>
+ <ctime>1307353451273</ctime>
+ <mtime>1307353509168</mtime>
+ <itime>1307353509168</itime>
+ <modifiedBy>
+ <factive>false</factive>
+ <fsystem>false</fsystem>
+ <id>1</id>
+ </modifiedBy>
+ <resourceType>
+ <category>SERVER</category>
+ <createDeletePolicy>NEITHER</createDeletePolicy>
+ <creationDataType>CONFIGURATION</creationDataType>
+ <description>an Apache HTTP Server instance</description>
+ <id>10013</id>
+ <name>Apache HTTP Server</name>
+ <plugin>Apache</plugin>
+ <pluginConfigurationDefinition>
+ <id>10012</id>
+ <propertyDefinitions/>
+ </pluginConfigurationDefinition>
+ <singleton>false</singleton>
+ <supportsManualAdd>true</supportsManualAdd>
+ </resourceType>
+ <childResources>
+ <id>10022</id>
+ <uuid>08290193-c716-4363-b841-8a1d9d83f580</uuid>
+ <resourceKey>${snmp.identifier}</resourceKey>
+ <name>Virtual Host ${snmp.identifier}</name>
+ <inventoryStatus>COMMITTED</inventoryStatus>
+ <connected>false</connected>
+ <version></version>
+ <description>Apache/2.2.17 (Unix) CovalentSNMP/2.3.0</description>
+ <ctime>1307353587727</ctime>
+ <mtime>1307353587727</mtime>
+ <itime>1307353587721</itime>
+ <modifiedBy>
+ <factive>false</factive>
+ <fsystem>false</fsystem>
+ <id>1</id>
+ </modifiedBy>
+ <resourceType>
+ <category>SERVICE</category>
+ <createDeletePolicy>NEITHER</createDeletePolicy>
+ <creationDataType>CONFIGURATION</creationDataType>
+ <id>10014</id>
+ <name>Apache Virtual Host</name>
+ <plugin>Apache</plugin>
+ <pluginConfigurationDefinition>
+ <id>10013</id>
+ <propertyDefinitions/>
+ </pluginConfigurationDefinition>
+ <singleton>false</singleton>
+ <supportsManualAdd>false</supportsManualAdd>
+ </resourceType>
+ <resourceConfiguration>
+ <id>10137</id>
+ <version>0</version>
+ <ctime>1307353587728</ctime>
+ <mtime>1307353587728</mtime>
+ </resourceConfiguration>
+ <pluginConfiguration>
+ <id>10138</id>
+ <notes>null</notes>
+ <version>0</version>
+ <ctime>1307353587728</ctime>
+ <mtime>1307353587728</mtime>
+ <propertySimple>
+ <id>10690</id>
+ <name>responseTimeUrlExcludes</name>
+ <override>false</override>
+ </propertySimple>
+ <propertySimple>
+ <id>10689</id>
+ <name>responseTimeLogFile</name>
+ <override>false</override>
+ <stringValue>${server.root}/logs/${localhost}0_rt.log</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10692</id>
+ <name>url</name>
+ <override>false</override>
+ <stringValue>http://${localhost}:0/</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10693</id>
+ <name>snmpWwwServiceIndex</name>
+ <override>false</override>
+ <stringValue>1</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10691</id>
+ <name>responseTimeUrlTransforms</name>
+ <override>false</override>
+ </propertySimple>
+ </pluginConfiguration>
+ <agent>
+ <backFilled>false</backFilled>
+ <id>10001</id>
+ <port>0</port>
+ </agent>
+ <currentAvailability>
+ <availabilityType>DOWN</availabilityType>
+ </currentAvailability>
+ </childResources>
+ <childResources>
+ <id>10021</id>
+ <uuid>3a20d809-7eba-422c-a3ef-baf65804498d</uuid>
+ <resourceKey>${vhost2.snmp.identifier}</resourceKey>
+ <name>Virtual Host ${vhost2.snmp.identifier}</name>
+ <inventoryStatus>COMMITTED</inventoryStatus>
+ <connected>false</connected>
+ <version></version>
+ <description>Apache/2.2.17 (Unix) CovalentSNMP/2.3.0</description>
+ <ctime>1307353587648</ctime>
+ <mtime>1307353587648</mtime>
+ <itime>1307353587648</itime>
+ <modifiedBy>
+ <factive>false</factive>
+ <fsystem>false</fsystem>
+ <id>1</id>
+ </modifiedBy>
+ <resourceType>
+ <category>SERVICE</category>
+ <createDeletePolicy>NEITHER</createDeletePolicy>
+ <creationDataType>CONFIGURATION</creationDataType>
+ <id>10014</id>
+ <name>Apache Virtual Host</name>
+ <plugin>Apache</plugin>
+ <pluginConfigurationDefinition>
+ <id>10013</id>
+ <propertyDefinitions/>
+ </pluginConfigurationDefinition>
+ <singleton>false</singleton>
+ <supportsManualAdd>false</supportsManualAdd>
+ </resourceType>
+ <resourceConfiguration>
+ <id>10135</id>
+ <version>0</version>
+ <ctime>1307353587666</ctime>
+ <mtime>1307353587666</mtime>
+ </resourceConfiguration>
+ <pluginConfiguration>
+ <id>10136</id>
+ <notes>null</notes>
+ <version>0</version>
+ <ctime>1307353587667</ctime>
+ <mtime>1307353587667</mtime>
+ <propertySimple>
+ <id>10685</id>
+ <name>responseTimeUrlExcludes</name>
+ <override>false</override>
+ </propertySimple>
+ <propertySimple>
+ <id>10684</id>
+ <name>responseTimeLogFile</name>
+ <override>false</override>
+ <stringValue>${server.root}/logs/127.0.0.111676_rt.log</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10687</id>
+ <name>url</name>
+ <override>false</override>
+ <stringValue>http://${vhost2.snmp.identifier}/</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10688</id>
+ <name>snmpWwwServiceIndex</name>
+ <override>false</override>
+ <stringValue>4</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10686</id>
+ <name>responseTimeUrlTransforms</name>
+ <override>false</override>
+ </propertySimple>
+ </pluginConfiguration>
+ <agent>
+ <backFilled>false</backFilled>
+ <id>10001</id>
+ <port>0</port>
+ </agent>
+ <currentAvailability>
+ <availabilityType>UP</availabilityType>
+ </currentAvailability>
+ </childResources>
+ <childResources>
+ <id>10023</id>
+ <uuid>c62c5d75-81dd-4b14-a768-2d8c1fca6c88</uuid>
+ <resourceKey>${vhost3.snmp.identifier}</resourceKey>
+ <name>Virtual Host ${vhost3.snmp.identifier}</name>
+ <inventoryStatus>COMMITTED</inventoryStatus>
+ <connected>false</connected>
+ <version></version>
+ <description>Apache/2.2.17 (Unix) CovalentSNMP/2.3.0</description>
+ <ctime>1307353587738</ctime>
+ <mtime>1307353587738</mtime>
+ <itime>1307353587737</itime>
+ <modifiedBy>
+ <factive>false</factive>
+ <fsystem>false</fsystem>
+ <id>1</id>
+ </modifiedBy>
+ <resourceType>
+ <category>SERVICE</category>
+ <createDeletePolicy>NEITHER</createDeletePolicy>
+ <creationDataType>CONFIGURATION</creationDataType>
+ <id>10014</id>
+ <name>Apache Virtual Host</name>
+ <plugin>Apache</plugin>
+ <pluginConfigurationDefinition>
+ <id>10013</id>
+ <propertyDefinitions/>
+ </pluginConfigurationDefinition>
+ <singleton>false</singleton>
+ <supportsManualAdd>false</supportsManualAdd>
+ </resourceType>
+ <resourceConfiguration>
+ <id>10139</id>
+ <version>0</version>
+ <ctime>1307353587738</ctime>
+ <mtime>1307353587738</mtime>
+ </resourceConfiguration>
+ <pluginConfiguration>
+ <id>10140</id>
+ <notes>null</notes>
+ <version>0</version>
+ <ctime>1307353587738</ctime>
+ <mtime>1307353587738</mtime>
+ <propertySimple>
+ <id>10695</id>
+ <name>responseTimeUrlExcludes</name>
+ <override>false</override>
+ </propertySimple>
+ <propertySimple>
+ <id>10694</id>
+ <name>responseTimeLogFile</name>
+ <override>false</override>
+ <stringValue>${server.root}/logs/127.0.0.111677_rt.log</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10697</id>
+ <name>url</name>
+ <override>false</override>
+ <stringValue>http://${vhost3.snmp.identifier}/</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10698</id>
+ <name>snmpWwwServiceIndex</name>
+ <override>false</override>
+ <stringValue>3</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10696</id>
+ <name>responseTimeUrlTransforms</name>
+ <override>false</override>
+ </propertySimple>
+ </pluginConfiguration>
+ <agent>
+ <backFilled>false</backFilled>
+ <id>10001</id>
+ <port>0</port>
+ </agent>
+ <currentAvailability>
+ <availabilityType>UP</availabilityType>
+ </currentAvailability>
+ </childResources>
+ <childResources>
+ <id>10024</id>
+ <uuid>d1b59168-8666-4bc0-957e-171bf16eec73</uuid>
+ <resourceKey>${vhost1.snmp.identifier}</resourceKey>
+ <name>Virtual Host ${vhost1.snmp.identifier}</name>
+ <inventoryStatus>COMMITTED</inventoryStatus>
+ <connected>false</connected>
+ <version></version>
+ <description>Apache/2.2.17 (Unix) CovalentSNMP/2.3.0</description>
+ <ctime>1307353587751</ctime>
+ <mtime>1307353587751</mtime>
+ <itime>1307353587750</itime>
+ <modifiedBy>
+ <factive>false</factive>
+ <fsystem>false</fsystem>
+ <id>1</id>
+ </modifiedBy>
+ <resourceType>
+ <category>SERVICE</category>
+ <createDeletePolicy>NEITHER</createDeletePolicy>
+ <creationDataType>CONFIGURATION</creationDataType>
+ <id>10014</id>
+ <name>Apache Virtual Host</name>
+ <plugin>Apache</plugin>
+ <pluginConfigurationDefinition>
+ <id>10013</id>
+ <propertyDefinitions/>
+ </pluginConfigurationDefinition>
+ <singleton>false</singleton>
+ <supportsManualAdd>false</supportsManualAdd>
+ </resourceType>
+ <resourceConfiguration>
+ <id>10171</id>
+ <version>0</version>
+ <ctime>1307353587751</ctime>
+ <mtime>1307353587751</mtime>
+ </resourceConfiguration>
+ <pluginConfiguration>
+ <id>10172</id>
+ <notes>null</notes>
+ <version>0</version>
+ <ctime>1307353587751</ctime>
+ <mtime>1307353587751</mtime>
+ <propertySimple>
+ <id>10700</id>
+ <name>responseTimeUrlExcludes</name>
+ <override>false</override>
+ </propertySimple>
+ <propertySimple>
+ <id>10699</id>
+ <name>responseTimeLogFile</name>
+ <override>false</override>
+ <stringValue>${server.root}/logs/127.0.0.111675_rt.log</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10702</id>
+ <name>url</name>
+ <override>false</override>
+ <stringValue>http://${vhost1.snmp.identifier}/</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10703</id>
+ <name>snmpWwwServiceIndex</name>
+ <override>false</override>
+ <stringValue>5</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10701</id>
+ <name>responseTimeUrlTransforms</name>
+ <override>false</override>
+ </propertySimple>
+ </pluginConfiguration>
+ <agent>
+ <backFilled>false</backFilled>
+ <id>10001</id>
+ <port>0</port>
+ </agent>
+ <currentAvailability>
+ <availabilityType>UP</availabilityType>
+ </currentAvailability>
+ </childResources>
+ <childResources>
+ <id>10025</id>
+ <uuid>310281d2-60c6-4d7d-bcdc-c51d7969c906</uuid>
+ <resourceKey>${vhost4.snmp.identifier}</resourceKey>
+ <name>Virtual Host ${vhost4.snmp.identifier}</name>
+ <inventoryStatus>COMMITTED</inventoryStatus>
+ <connected>false</connected>
+ <version></version>
+ <description>Apache/2.2.17 (Unix) CovalentSNMP/2.3.0</description>
+ <ctime>1307353587761</ctime>
+ <mtime>1307353587761</mtime>
+ <itime>1307353587760</itime>
+ <modifiedBy>
+ <factive>false</factive>
+ <fsystem>false</fsystem>
+ <id>1</id>
+ </modifiedBy>
+ <resourceType>
+ <category>SERVICE</category>
+ <createDeletePolicy>NEITHER</createDeletePolicy>
+ <creationDataType>CONFIGURATION</creationDataType>
+ <id>10014</id>
+ <name>Apache Virtual Host</name>
+ <plugin>Apache</plugin>
+ <pluginConfigurationDefinition>
+ <id>10013</id>
+ <propertyDefinitions/>
+ </pluginConfigurationDefinition>
+ <singleton>false</singleton>
+ <supportsManualAdd>false</supportsManualAdd>
+ </resourceType>
+ <resourceConfiguration>
+ <id>10173</id>
+ <version>0</version>
+ <ctime>1307353587761</ctime>
+ <mtime>1307353587761</mtime>
+ </resourceConfiguration>
+ <pluginConfiguration>
+ <id>10174</id>
+ <notes>null</notes>
+ <version>0</version>
+ <ctime>1307353587761</ctime>
+ <mtime>1307353587761</mtime>
+ <propertySimple>
+ <id>10705</id>
+ <name>responseTimeUrlExcludes</name>
+ <override>false</override>
+ </propertySimple>
+ <propertySimple>
+ <id>10704</id>
+ <name>responseTimeLogFile</name>
+ <override>false</override>
+ <stringValue>${server.root}/logs/127.0.0.111678_rt.log</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10707</id>
+ <name>url</name>
+ <override>false</override>
+ <stringValue>http://${vhost4.snmp.identifier}/</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10708</id>
+ <name>snmpWwwServiceIndex</name>
+ <override>false</override>
+ <stringValue>2</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10706</id>
+ <name>responseTimeUrlTransforms</name>
+ <override>false</override>
+ </propertySimple>
+ </pluginConfiguration>
+ <agent>
+ <backFilled>false</backFilled>
+ <id>10001</id>
+ <port>0</port>
+ </agent>
+ <currentAvailability>
+ <availabilityType>UP</availabilityType>
+ </currentAvailability>
+ </childResources>
+ <resourceConfiguration>
+ <id>10142</id>
+ <version>0</version>
+ <ctime>1307353451273</ctime>
+ <mtime>1307353451273</mtime>
+ </resourceConfiguration>
+ <pluginConfiguration>
+ <id>10073</id>
+ <notes>null</notes>
+ <version>0</version>
+ <ctime>1307353737118</ctime>
+ <mtime>1307353737118</mtime>
+ <propertySimple>
+ <id>10365</id>
+ <name>errorLogMinimumSeverity</name>
+ <override>false</override>
+ <stringValue>error</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10366</id>
+ <name>errorLogIncludesPattern</name>
+ <override>false</override>
+ </propertySimple>
+ <propertySimple>
+ <id>10367</id>
+ <name>snmpAgentCommunity</name>
+ <override>false</override>
+ <stringValue>public</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10368</id>
+ <name>errorLogFilePath</name>
+ <override>false</override>
+ </propertySimple>
+ <propertySimple>
+ <id>10369</id>
+ <name>errorLogEventsEnabled</name>
+ <override>false</override>
+ <stringValue>false</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10370</id>
+ <name>snmpAgentHost</name>
+ <override>false</override>
+ <stringValue>127.0.0.1</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10713</id>
+ <name>controlScriptPath</name>
+ <override>false</override>
+ </propertySimple>
+ <propertySimple>
+ <id>10714</id>
+ <name>url</name>
+ <override>false</override>
+ </propertySimple>
+ <propertySimple>
+ <id>10364</id>
+ <name>configFile</name>
+ <override>false</override>
+ <stringValue>conf/httpd.conf</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10711</id>
+ <name>executablePath</name>
+ <override>false</override>
+ <stringValue>${exe.path}</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10712</id>
+ <name>snmpAgentPort</name>
+ <override>false</override>
+ <stringValue>1610</stringValue>
+ </propertySimple>
+ <propertySimple>
+ <id>10715</id>
+ <name>serverRoot</name>
+ <override>false</override>
+ <stringValue>${server.root}</stringValue>
+ </propertySimple>
+ </pluginConfiguration>
+ <agent>
+ <backFilled>false</backFilled>
+ <id>10001</id>
+ <port>0</port>
+ </agent>
+ <currentAvailability>
+ <availabilityType>UP</availabilityType>
+ </currentAvailability>
+ <productVersion>
+ <id>10003</id>
+ </productVersion>
+</resource>
+</objects>
+</inventory-dump>
diff --git a/modules/test-utils/src/main/java/org/rhq/test/TokenReplacingProperties.java b/modules/test-utils/src/main/java/org/rhq/test/TokenReplacingProperties.java
index 9e359cb..0b9e87d 100644
--- a/modules/test-utils/src/main/java/org/rhq/test/TokenReplacingProperties.java
+++ b/modules/test-utils/src/main/java/org/rhq/test/TokenReplacingProperties.java
@@ -136,8 +136,7 @@ public class TokenReplacingProperties extends HashMap<String, String> {
@SuppressWarnings("unchecked")
public TokenReplacingProperties(Properties properties) {
@SuppressWarnings("rawtypes")
- Map map = (Map<Object, Object>) properties;
-
+ Map map = properties;
this.wrapped = (Map<String, String>) map;
}
@@ -186,6 +185,12 @@ public class TokenReplacingProperties extends HashMap<String, String> {
wrapped.putAll(m);
}
+ public void putAll(Properties properties) {
+ for(String propName : properties.stringPropertyNames()) {
+ put(propName, properties.getProperty(propName));
+ }
+ }
+
@Override
public void clear() {
wrapped.clear();
12 years, 11 months
[rhq] Branch 'drift' - modules/core modules/enterprise
by Jay Shaughnessy
modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml | 12
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/DriftChangeSetCriteria.java | 11
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/DriftCriteria.java | 104 ++
modules/core/domain/src/main/java/org/rhq/core/domain/drift/Drift.java | 4
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftCategory.java | 9
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftChangeSet.java | 49 -
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftChangeSetCategory.java | 36
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftFile.java | 50 -
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftFileContent.java | 72 +
modules/core/domain/src/main/java/org/rhq/core/domain/drift/Snapshot.java | 94 --
modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java | 2
modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java | 4
modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourcePermission.java | 6
modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftFileTest.java | 36
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java | 444 ++++++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/RecentDriftsPortlet.java | 48 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDataSource.java | 302 ++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftHistoryView.java | 290 ++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/SubsystemResourceDriftView.java | 31
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java | 65 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java | 17
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java | 14
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java | 72 +
modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/RHQDomain.gwt.xml | 5
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml | 1
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 24
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 25
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties | 26
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties | 26
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties | 26
modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml | 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java | 29
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java | 10
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftManagerBeanTest.java | 4
40 files changed, 1758 insertions(+), 228 deletions(-)
New commits:
commit 313db966df12f807eef40cb4ad44b2edcff3934b
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jun 22 10:51:07 2011 -0400
Initial Drift GUI Work and some domain model changes
- Add infra for GUI drift history, datasource, gwt service etc
- Add recent drifts report
- Find a way to keep usupported data model stuff out of gwt (java.sql.Blob)
- change DriftFile.sha256 to DriftFile.hashId (spring feedback to not tie to sha256)
- Add new category for ChangeSets (Coverage report, Drift report)
- note: the report does not yet provide this info
- Add DriftCriteria
- add "_MAP" to the two drift mapping tables to make their purpose clear and to be
similar to our other mapping tables
- remove the blob from DriftChangeSet, as we have not identified a reason to keep that raw data
- add very preliminary support for MANAGE_DRIFT resource perm
- variety of I18N additions and a few changes to use common props
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml
index 8cdac36..de72bb6 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml
@@ -650,7 +650,8 @@
<!-- Content of a file being managed for drift. Used for diff and/or remediation -->
<table name="RHQ_DRIFT_FILE">
- <column name="SHA256" type="VARCHAR2" size="64" primarykey="true" required="true"/>
+ <column name="HASH_ID" type="VARCHAR2" size="64" primarykey="true" required="true"/>
+ <column name="DTYPE" type="VARCHAR2" required="true" size="10"/>
<column name="CTIME" type="LONG" required="true"/>
<column name="DATA" type="LARGEOBJECT" required="false"/>
<column name="DATA_SIZE" type="LONG" required="false"/>
@@ -662,9 +663,8 @@
<column name="ID" default="sequence-only" initial="10001" primarykey="true" required="true" type="INTEGER"/>
<column name="CTIME" type="LONG" required="true"/>
<!-- Version 0 is initial change-set -->
- <column name="VERSION" type="INTEGER" required="true"/>
- <column name="DATA" type="LARGEOBJECT" required="false"/>
- <column name="DATA_SIZE" type="LONG" required="false"/>
+ <column name="VERSION" type="INTEGER" required="true"/>
+ <column name="CATEGORY" type="VARCHAR2" size="20" required="true"/>
<column name="RESOURCE_ID" type="INTEGER" required="true" references="RHQ_RESOURCE"/>
</table>
@@ -684,7 +684,7 @@
elements declared in the plugin descriptor. A drift template is represented as a
config template.
-->
- <table name="RHQ_DRIFT_TEMPLATE">
+ <table name="RHQ_DRIFT_TEMPLATE_MAP">
<column name="RESOURCE_TYPE_ID" type="INTEGER" required="true" references="RHQ_RESOURCE_TYPE"/>
<column name="CONFIG_TEMPLATE_ID" type="INTEGER" required="true" references="RHQ_CONFIG_TEMPLATE"/>
</table>
@@ -693,7 +693,7 @@
A resource can have zero or more drift configurations used for guiding drift
detection for the resource.
-->
- <table name="RHQ_DRIFT_CONFIG">
+ <table name="RHQ_DRIFT_CONFIG_MAP">
<column name="RESOURCE_ID" type="INTEGER" required="true" references="RHQ_RESOURCE"/>
<column name="CONFIG_ID" type="INTEGER" required="true" references="RHQ_CONFIG"/>
</table>
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/DriftChangeSetCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/DriftChangeSetCriteria.java
index 761e7bb..6a40fc9 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/DriftChangeSetCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/DriftChangeSetCriteria.java
@@ -24,6 +24,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import org.rhq.core.domain.drift.DriftChangeSet;
+import org.rhq.core.domain.drift.DriftChangeSetCategory;
import org.rhq.core.domain.util.PageOrdering;
/**
@@ -39,9 +40,9 @@ public class DriftChangeSetCriteria extends Criteria {
private Integer filterInitial; // needs override
private Integer filterResourceId; // needs override
private String filterVersion;
+ private DriftChangeSetCategory filterCategory;
private boolean fetchDrifts;
- private boolean fetchResource;
private PageOrdering sortVersion;
@@ -67,12 +68,12 @@ public class DriftChangeSetCriteria extends Criteria {
this.filterResourceId = filterResourceId;
}
- public void fetchDrifts(boolean fetchDrifts) {
- this.fetchDrifts = fetchDrifts;
+ public void addFilterCategory(DriftChangeSetCategory filterCategory) {
+ this.filterCategory = filterCategory;
}
- public void fetchResource(boolean fetchResource) {
- this.fetchResource = fetchResource;
+ public void fetchDrifts(boolean fetchDrifts) {
+ this.fetchDrifts = fetchDrifts;
}
public void addSortVersion(PageOrdering sortVersion) {
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/DriftCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/DriftCriteria.java
new file mode 100644
index 0000000..e302729
--- /dev/null
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/DriftCriteria.java
@@ -0,0 +1,104 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.core.domain.criteria;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.rhq.core.domain.drift.Drift;
+import org.rhq.core.domain.drift.DriftCategory;
+import org.rhq.core.domain.util.CriteriaUtils;
+import org.rhq.core.domain.util.PageOrdering;
+
+/**
+ * @author Jay Shaughnessy
+ */
+@XmlRootElement
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@SuppressWarnings("unused")
+public class DriftCriteria extends Criteria {
+ private static final long serialVersionUID = 1L;
+
+ private Integer filterId;
+ private List<DriftCategory> filterCategories;
+ private Integer filterChangeSetId; // needs override
+ private String filterPath;
+ private List<Integer> filterResourceIds; // requires overrides
+ private Long filterStartTime; // requires overrides
+ private Long filterEndTime; // requires overrides
+
+ private boolean fetchChangeSet;
+
+ private PageOrdering sortCtime;
+
+ public DriftCriteria() {
+ filterOverrides.put("changeSetId", "changeSet.id = ?");
+ filterOverrides.put("categories", "category IN ( ? )");
+ filterOverrides.put("resourceIds", "changeSet.resource.id IN ( ? )");
+ filterOverrides.put("startTime", "ctime >= ?");
+ filterOverrides.put("endTime", "ctime <= ?");
+ }
+
+ @Override
+ public Class<Drift> getPersistentClass() {
+ return Drift.class;
+ }
+
+ public void addFilterId(Integer filterId) {
+ this.filterId = filterId;
+ }
+
+ public void addFilterCategories(DriftCategory... filterCategories) {
+ this.filterCategories = CriteriaUtils.getListIgnoringNulls(filterCategories);
+ }
+
+ public void addFilterChangeSetId(Integer filterChangeSetId) {
+ this.filterChangeSetId = filterChangeSetId;
+ }
+
+ public void addFilterPath(String filterPath) {
+ this.filterPath = filterPath;
+ }
+
+ public void addFilterResourceIds(Integer... filterResourceIds) {
+ this.filterResourceIds = CriteriaUtils.getListIgnoringNulls(filterResourceIds);
+ }
+
+ public void addFilterStartTime(Long filterStartTime) {
+ this.filterStartTime = filterStartTime;
+ }
+
+ public void addFilterEndTime(Long filterEndTime) {
+ this.filterEndTime = filterEndTime;
+ }
+
+ public void fetchChangeSet(boolean fetchChangeSet) {
+ this.fetchChangeSet = fetchChangeSet;
+ }
+
+ public void addSortCtime(PageOrdering sortCtime) {
+ addSortField("ctime");
+ this.sortCtime = sortCtime;
+ }
+
+}
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/Drift.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/Drift.java
index 61856d6..9d5bb46 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/Drift.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/Drift.java
@@ -77,11 +77,11 @@ public class Drift implements Serializable {
@ManyToOne(fetch = FetchType.LAZY, optional = false)
private DriftChangeSet changeSet;
- @JoinColumn(name = "OLD_DRIFT_FILE", referencedColumnName = "SHA256", nullable = true)
+ @JoinColumn(name = "OLD_DRIFT_FILE", referencedColumnName = "HASH_ID", nullable = true)
@ManyToOne(fetch = FetchType.EAGER, optional = true)
private DriftFile oldDriftFile;
- @JoinColumn(name = "NEW_DRIFT_FILE", referencedColumnName = "SHA256", nullable = true)
+ @JoinColumn(name = "NEW_DRIFT_FILE", referencedColumnName = "HASH_ID", nullable = true)
@ManyToOne(fetch = FetchType.EAGER, optional = true)
private DriftFile newDriftFile;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftCategory.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftCategory.java
index 31a95be..a0b04ef 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftCategory.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftCategory.java
@@ -52,4 +52,13 @@ public enum DriftCategory {
}
throw new IllegalArgumentException(code + " is not a DriftCategory code");
}
+
+ public static String[] names() {
+ String[] names = new String[values().length];
+ int i = 0;
+ for (DriftCategory c : values()) {
+ names[i++] = c.name();
+ }
+ return names;
+ }
}
\ No newline at end of file
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftChangeSet.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftChangeSet.java
index afd79b7..0b35f0a 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftChangeSet.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftChangeSet.java
@@ -22,22 +22,19 @@
*/
package org.rhq.core.domain.drift;
-import java.io.InputStream;
import java.io.Serializable;
-import java.sql.Blob;
-import java.sql.SQLException;
import java.util.LinkedHashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
-import javax.persistence.FetchType;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
-import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
@@ -75,15 +72,12 @@ public class DriftChangeSet implements Serializable {
@Column(name = "VERSION", nullable = false)
private int version;
- @Lob
- @Column(name = "DATA", nullable = true)
- private Blob data;
-
- @Column(name = "DATA_SIZE", nullable = true)
- private Long dataSize;
+ @Column(name = "CATEGORY", nullable = false)
+ @Enumerated(EnumType.STRING)
+ private DriftChangeSetCategory category;
@JoinColumn(name = "RESOURCE_ID", referencedColumnName = "ID", nullable = false)
- @ManyToOne(fetch = FetchType.LAZY, optional = false)
+ @ManyToOne(optional = false)
private Resource resource;
@OneToMany(mappedBy = "changeSet", cascade = { CascadeType.ALL })
@@ -92,9 +86,10 @@ public class DriftChangeSet implements Serializable {
protected DriftChangeSet() {
}
- public DriftChangeSet(Resource resource, int version) {
+ public DriftChangeSet(Resource resource, int version, DriftChangeSetCategory category) {
this.resource = resource;
this.version = version;
+ this.category = category;
}
public int getId() {
@@ -122,32 +117,12 @@ public class DriftChangeSet implements Serializable {
this.version = version;
}
- public boolean isInitialVersion() {
- return 0 == version;
- }
-
- public void setDataSize(Long dataSize) {
- this.dataSize = dataSize;
- }
-
- public Blob getBlob() {
- return data;
- }
-
- public InputStream getData() throws SQLException {
- return data.getBinaryStream();
- }
-
- public void setData(Blob blob) {
- this.data = blob;
- }
-
- public long getDataSize() {
- return dataSize;
+ public DriftChangeSetCategory getCategory() {
+ return category;
}
- public void setDataSize(long size) {
- dataSize = size;
+ public void setCategory(DriftChangeSetCategory category) {
+ this.category = category;
}
public Resource getResource() {
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftChangeSetCategory.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftChangeSetCategory.java
new file mode 100644
index 0000000..bc04c31
--- /dev/null
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftChangeSetCategory.java
@@ -0,0 +1,36 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.core.domain.drift;
+
+/**
+ * Type of change set report.
+ *
+ * @author Jay Shaughnesssy
+ */
+public enum DriftChangeSetCategory {
+ COVERAGE, // Reports only on files being covered by a drift configuration.
+ DRIFT; // Reports on actual drift.
+
+ DriftChangeSetCategory() {
+ }
+}
\ No newline at end of file
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftFile.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftFile.java
index e8e6e21..a52d957 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftFile.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftFile.java
@@ -22,40 +22,41 @@
*/
package org.rhq.core.domain.drift;
-import java.io.InputStream;
import java.io.Serializable;
-import java.sql.Blob;
-import java.sql.SQLException;
import javax.persistence.Column;
+import javax.persistence.DiscriminatorColumn;
+import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
-import javax.persistence.Lob;
import javax.persistence.PrePersist;
import javax.persistence.Table;
/**
+ * A DriftFile represents one unique piece of content used for drift tracking. Note that DriftFile does not
+ * include the actual bits, and therefore can be used freely client-side (gwt). The bits are stored via the
+ * DriftFileContent sub-class, which adds only a Blob field.
+ *
* @author Jay Shaughnessy
* @author John Sanda
*/
+@DiscriminatorColumn(name = "DTYPE")
+@DiscriminatorValue("no-content")
@Entity
@Table(name = "RHQ_DRIFT_FILE")
public class DriftFile implements Serializable {
private static final long serialVersionUID = 1L;
+ // this is a hash/digest that should uniquely identify the content
@Id
- @Column(name = "SHA256", nullable = false)
- private String sha256;
+ @Column(name = "HASH_ID", nullable = false)
+ private String hashId;
@Column(name = "CTIME", nullable = false)
private Long ctime = -1L;
- @Lob
- @Column(name = "DATA", nullable = true)
- private Blob data;
-
@Column(name = "DATA_SIZE", nullable = true)
private Long dataSize;
@@ -66,16 +67,16 @@ public class DriftFile implements Serializable {
protected DriftFile() {
}
- public DriftFile(String sha256) {
- this.sha256 = sha256;
+ public DriftFile(String hashId) {
+ this.hashId = hashId;
}
- public String getSha256() {
- return sha256;
+ public String getHashId() {
+ return hashId;
}
- public void setSha256(String sha256) {
- this.sha256 = sha256;
+ public void setHashId(String hashId) {
+ this.hashId = hashId;
}
public Long getCtime() {
@@ -91,18 +92,6 @@ public class DriftFile implements Serializable {
this.dataSize = dataSize;
}
- public Blob getBlob() {
- return data;
- }
-
- public InputStream getData() throws SQLException {
- return data.getBinaryStream();
- }
-
- public void setData(Blob blob) {
- this.data = blob;
- }
-
public long getDataSize() {
return dataSize;
}
@@ -119,4 +108,9 @@ public class DriftFile implements Serializable {
this.status = status;
}
+ @Override
+ public String toString() {
+ return "DriftFile [hashId=" + hashId + ", status=" + status + "]";
+ }
+
}
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftFileContent.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftFileContent.java
new file mode 100644
index 0000000..f2c23d1
--- /dev/null
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftFileContent.java
@@ -0,0 +1,72 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.core.domain.drift;
+
+import java.io.InputStream;
+import java.io.Serializable;
+import java.sql.Blob;
+import java.sql.SQLException;
+
+import javax.persistence.Column;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.Lob;
+
+/**
+ * A DriftFile represents onee unique piece of content used for drift tracking. Note that DriftFileContent provides
+ * access to the bits through java.sql.Blob. This entity can not be used client-side (gwt) whereas the super-class,
+ * DriftFile can. See RHQDomain.gwt.xml for how to exclude unwanted domain classes from the gwt compile.
+ *
+ * @author Jay Shaughnessy
+ * @author John Sanda
+ */
+@DiscriminatorValue("content")
+@Entity
+public class DriftFileContent extends DriftFile implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @Lob
+ @Column(name = "DATA", nullable = true)
+ private Blob data;
+
+ protected DriftFileContent() {
+ }
+
+ public Blob getBlob() {
+ return data;
+ }
+
+ public InputStream getData() throws SQLException {
+ return data.getBinaryStream();
+ }
+
+ public void setData(Blob blob) {
+ this.data = blob;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString();
+ }
+
+}
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/Snapshot.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/Snapshot.java
deleted file mode 100644
index bef88b6..0000000
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/Snapshot.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package org.rhq.core.domain.drift;
-
-import java.io.InputStream;
-import java.io.Serializable;
-import java.sql.Blob;
-import java.sql.SQLException;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.Lob;
-import javax.persistence.OneToOne;
-import javax.persistence.SequenceGenerator;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "RHQ_SNAPSHOT")
-@SequenceGenerator(name = "SEQ", sequenceName = "RHQ_SNAPSHOT_ID_SEQ")
-public class Snapshot implements Serializable {
- private static final long serialVersionUID = 1L;
-
- @Id
- @Column(name = "ID")
- @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ")
- private int id;
-
- //private SnapshotMetadata metadata = new SnapshotMetadata();
-
- @Column(name = "BASEDIR", nullable = false, length = 512)
- private String basedir;
-
- @Lob
- @Column(name = "DATA")
- private Blob data;
-
- @Column(name = "DATA_SIZE")
- private long dataSize;
-
- @Column(name = "CTIME")
- private long ctime = System.currentTimeMillis();
-
- public int getId() {
- return id;
- }
-
-// public SnapshotMetadata getMetadata() {
-// return metadata;
-// }
-//
-// public InputStream getData() {
-// return data;
-// }
-//
-// public void setData(InputStream data) {
-// this.data = data;
-// }
-
- public Blob getBlob() {
- return data;
- }
-
- public InputStream getData() throws SQLException {
- return data.getBinaryStream();
- }
-
- public void setData(Blob blob) {
- this.data = blob;
- }
-
- public long getDataSize() {
- return dataSize;
- }
-
- public void setDataSize(long size) {
- dataSize = size;
- }
-
- public String getBasedir() {
- return basedir;
- }
-
- public void setBasedir(String dir) {
- basedir = dir;
- }
-
- public long getCtime() {
- return ctime;
- }
-}
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
index b029e02..25c8113 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
@@ -1072,7 +1072,7 @@ public class Resource implements Comparable<Resource>, Serializable {
@OneToMany(mappedBy = "resource", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
private Set<Dashboard> dashboards = null;
- @JoinTable(name = "RHQ_DRIFT_CONFIG", joinColumns = { @JoinColumn(name = "RESOURCE_ID") }, inverseJoinColumns = { @JoinColumn(name = "CONFIG_ID") })
+ @JoinTable(name = "RHQ_DRIFT_CONFIG_MAP", joinColumns = { @JoinColumn(name = "RESOURCE_ID") }, inverseJoinColumns = { @JoinColumn(name = "CONFIG_ID") })
@OneToMany(fetch = FetchType.LAZY, cascade = { CascadeType.ALL })
private Set<Configuration> driftConfigurations = null;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
index d92118a..c9935ae 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
@@ -393,9 +393,7 @@ public class ResourceType implements Serializable, Comparable<ResourceType> {
private BundleType bundleType;
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
- @JoinTable(name = "RHQ_DRIFT_TEMPLATE",
- joinColumns = @JoinColumn(name = "RESOURCE_TYPE_ID", nullable = false),
- inverseJoinColumns = @JoinColumn(name = "CONFIG_TEMPLATE_ID", nullable = false))
+ @JoinTable(name = "RHQ_DRIFT_TEMPLATE_MAP", joinColumns = @JoinColumn(name = "RESOURCE_TYPE_ID", nullable = false), inverseJoinColumns = @JoinColumn(name = "CONFIG_TEMPLATE_ID", nullable = false))
private Set<ConfigurationTemplate> driftConfigurationTemplates = new HashSet<ConfigurationTemplate>();
@Transient
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourcePermission.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourcePermission.java
index 4141593..cd7a058 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourcePermission.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourcePermission.java
@@ -119,6 +119,12 @@ public class ResourcePermission implements Serializable {
return this.permissions.contains(Permission.MANAGE_ALERTS);
}
+ // TODO geta real resource perm
+ public boolean isDrift() {
+ return true;
+ //return this.permissions.contains(Permission.MANAGE_DRIFT);
+ }
+
public boolean isEvent() {
return this.permissions.contains(Permission.MANAGE_EVENTS);
}
diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftFileTest.java b/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftFileTest.java
index 59220ac..532da59 100644
--- a/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftFileTest.java
+++ b/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftFileTest.java
@@ -46,11 +46,11 @@ public class DriftFileTest extends AbstractEJB3Test {
@Test(groups = { "integration.ejb3", "driftFile" })
public void updateDriftFileData() throws Exception {
String content = "driftFile data";
- String sha256 = digestGen.calcDigestString(content);
+ String hashId = digestGen.calcDigestString(content);
// Create the initial driftFile
- final DriftFile df1 = new DriftFile();
- df1.setSha256(sha256);
+ final DriftFileContent df1 = new DriftFileContent();
+ df1.setHashId(hashId);
df1.setDataSize(content.length());
df1.setData(Hibernate.createBlob(toInputStream(content), content.length()));
@@ -66,7 +66,7 @@ public class DriftFileTest extends AbstractEJB3Test {
executeInTransaction(new TransactionCallback() {
@Override
public void execute() {
- DriftFile df2 = getEntityManager().find(DriftFile.class, df1.getSha256());
+ DriftFileContent df2 = getEntityManager().find(DriftFileContent.class, df1.getHashId());
df2.setData(Hibernate.createBlob(toInputStream(newContent), newContent.length()));
getEntityManager().merge(df2);
}
@@ -77,7 +77,7 @@ public class DriftFileTest extends AbstractEJB3Test {
@Override
public void execute() {
try {
- DriftFile df3 = getEntityManager().find(DriftFile.class, df1.getSha256());
+ DriftFileContent df3 = getEntityManager().find(DriftFileContent.class, df1.getHashId());
String expected = newContent;
String actual = IOUtils.toString(df3.getData());
@@ -97,13 +97,13 @@ public class DriftFileTest extends AbstractEJB3Test {
@Test(groups = { "integration.ejb3", "driftFile" })
public void loadMultipleDriftFilesWithoutLoadingData() throws Exception {
int numDriftFiles = 10;
- final List<String> driftFileShas = new ArrayList<String>();
+ final List<String> driftFileHashIds = new ArrayList<String>();
for (int i = 0; i < numDriftFiles; ++i) {
File dataFile = createDataFile("test_data.txt", 10, (char) ('a' + i));
- final DriftFile driftFile = new DriftFile();
+ final DriftFileContent driftFile = new DriftFileContent();
driftFile.setDataSize(dataFile.length());
- driftFile.setSha256(digestGen.calcDigestString(dataFile));
+ driftFile.setHashId(digestGen.calcDigestString(dataFile));
driftFile.setData(Hibernate.createBlob(new BufferedInputStream(new FileInputStream(dataFile))));
dataFile.delete();
@@ -111,18 +111,18 @@ public class DriftFileTest extends AbstractEJB3Test {
@Override
public void execute() {
getEntityManager().persist(driftFile);
- driftFileShas.add(driftFile.getSha256());
+ driftFileHashIds.add(driftFile.getHashId());
}
});
}
final List<Blob> blobs = new ArrayList<Blob>();
final List<DriftFile> driftFiles = new ArrayList<DriftFile>();
- for (final String sha256 : driftFileShas) {
+ for (final String hashId : driftFileHashIds) {
executeInTransaction(new TransactionCallback() {
@Override
public void execute() {
- DriftFile driftFile = getEntityManager().find(DriftFile.class, sha256);
+ DriftFileContent driftFile = getEntityManager().find(DriftFileContent.class, hashId);
blobs.add(driftFile.getBlob());
driftFiles.add(driftFile);
}
@@ -137,14 +137,14 @@ public class DriftFileTest extends AbstractEJB3Test {
@Test(groups = { "integration.ejb3", "driftFile" })
public void loadSameFile() throws Exception {
int numDriftFiles = 2;
- final List<String> driftFileShas = new ArrayList<String>();
+ final List<String> driftFileHashIds = new ArrayList<String>();
for (int i = 0; i < numDriftFiles; ++i) {
File dataFile = createDataFile("test_data.txt", 10, 'X');
- final DriftFile driftFile = new DriftFile();
+ final DriftFileContent driftFile = new DriftFileContent();
final int driftFileNum = i;
driftFile.setDataSize(dataFile.length());
- driftFile.setSha256(digestGen.calcDigestString(dataFile));
+ driftFile.setHashId(digestGen.calcDigestString(dataFile));
driftFile.setData(Hibernate.createBlob(new BufferedInputStream(new FileInputStream(dataFile))));
dataFile.delete();
@@ -153,24 +153,24 @@ public class DriftFileTest extends AbstractEJB3Test {
@Override
public void execute() {
getEntityManager().persist(driftFile);
- driftFileShas.add(driftFile.getSha256());
+ driftFileHashIds.add(driftFile.getHashId());
}
});
} catch (Exception e) {
// expected for file 2 or higher
if (driftFileNum == 0) {
- fail("Should not be able to store DriftFile with same sha256 more than once.");
+ fail("Should not be able to store DriftFile with same hashId more than once.");
}
}
}
final List<Blob> blobs = new ArrayList<Blob>();
final List<DriftFile> driftFiles = new ArrayList<DriftFile>();
- for (final String sha256 : driftFileShas) {
+ for (final String hashId : driftFileHashIds) {
executeInTransaction(new TransactionCallback() {
@Override
public void execute() {
- DriftFile driftFile = getEntityManager().find(DriftFile.class, sha256);
+ DriftFileContent driftFile = getEntityManager().find(DriftFileContent.class, hashId);
blobs.add(driftFile.getBlob());
driftFiles.add(driftFile);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
index 26fe3d2..c1bfb95 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
@@ -218,6 +218,10 @@ public class LinkManager {
return link;
}
+ public static String getSubsystemDriftHistoryLink(int resourceId, int driftId) {
+ return "#Resource/" + resourceId + "/Drift/History/" + driftId;
+ }
+
public static String getAutodiscoveryQueueLink() {
if (GWT) {
return "#Administration/Security/Auto%20Discovery%20Queue";
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
index b4abbb0..a5f21d0 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
@@ -100,14 +100,13 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
public ArrayList<ListGridField> getListGridFields() {
ArrayList<ListGridField> fields = new ArrayList<ListGridField>(6);
- ListGridField ctimeField = new ListGridField(AlertCriteria.SORT_FIELD_CTIME, MSG
- .view_alerts_field_created_time());
+ ListGridField ctimeField = new ListGridField(AlertCriteria.SORT_FIELD_CTIME, MSG.common_title_createTime());
ctimeField.setCellFormatter(new TimestampCellFormatter());
ctimeField.setShowHover(true);
ctimeField.setHoverCustomizer(TimestampCellFormatter.getHoverCustomizer(AlertCriteria.SORT_FIELD_CTIME));
fields.add(ctimeField);
- ListGridField nameField = new ListGridField("name", MSG.view_alerts_field_name());
+ ListGridField nameField = new ListGridField("name", MSG.common_title_name());
nameField.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
Integer resourceId = listGridRecord.getAttributeAsInt(AncestryUtil.RESOURCE_ID);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java
index ad272f7..c206db6 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java
@@ -158,7 +158,7 @@ public class AlertDetailsView extends LocatableVLayout implements BookmarkableVi
prioTextItem.setValueMap(priorityMap);
items.add(prioTextItem);
- StaticTextItem createdTextItem = new StaticTextItem("ctime", MSG.view_alerts_field_created_time());
+ StaticTextItem createdTextItem = new StaticTextItem("ctime", MSG.common_title_createTime());
createdTextItem.setValue(TimestampCellFormatter.format(record.getAttributeAsDate("ctime")));
items.add(createdTextItem);
@@ -188,6 +188,7 @@ public class AlertDetailsView extends LocatableVLayout implements BookmarkableVi
return form;
}
+ @SuppressWarnings("unchecked")
private class NotificationLogsTable extends Table {
private final Record record;
@@ -246,12 +247,14 @@ public class AlertDetailsView extends LocatableVLayout implements BookmarkableVi
}
}
+ @SuppressWarnings("unchecked")
private Table getNotificationsForAlert(Record record) {
Table notifTable = new NotificationLogsTable("AlertDetailsNotifications", MSG
.view_alert_common_tab_notifications(), record);
return notifTable;
}
+ @SuppressWarnings("unchecked")
private class ConditionLogsTable extends Table {
private final Record record;
@@ -275,6 +278,7 @@ public class AlertDetailsView extends LocatableVLayout implements BookmarkableVi
}
}
+ @SuppressWarnings("unchecked")
private Table getConditionsForAlert(Record record) {
String mode = record.getAttribute("conditionExpression");
Table table = new ConditionLogsTable("AlertDetailsConditionLog", MSG.view_alert_common_tab_conditions()
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java
index 24176bb..ac50686 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java
@@ -78,7 +78,7 @@ public abstract class AbstractAlertDefinitionsDataSource extends
public ArrayList<ListGridField> getListGridFields() {
ArrayList<ListGridField> fields = new ArrayList<ListGridField>(6);
- ListGridField nameField = new ListGridField(FIELD_NAME, MSG.view_alerts_field_name());
+ ListGridField nameField = new ListGridField(FIELD_NAME, MSG.common_title_name());
nameField.setWidth("20%");
nameField.setCellFormatter(new EscapedHtmlCellFormatter());
fields.add(nameField);
@@ -88,7 +88,7 @@ public abstract class AbstractAlertDefinitionsDataSource extends
descriptionField.setCellFormatter(new EscapedHtmlCellFormatter());
fields.add(descriptionField);
- ListGridField ctimeField = new ListGridField(FIELD_CTIME, MSG.view_alerts_field_created_time());
+ ListGridField ctimeField = new ListGridField(FIELD_CTIME, MSG.common_title_createTime());
ctimeField.setType(ListGridFieldType.DATE);
TimestampCellFormatter.prepareDateField(ctimeField);
ctimeField.setWidth("15%");
@@ -163,14 +163,14 @@ public abstract class AbstractAlertDefinitionsDataSource extends
protected List<DataSourceField> addDataSourceFields() {
List<DataSourceField> fields = super.addDataSourceFields();
- DataSourceTextField nameField = new DataSourceTextField(FIELD_NAME, MSG.view_alerts_field_name());
+ DataSourceTextField nameField = new DataSourceTextField(FIELD_NAME, MSG.common_title_name());
fields.add(nameField);
DataSourceTextField descriptionField = new DataSourceTextField(FIELD_DESCRIPTION, MSG
.common_title_description());
fields.add(descriptionField);
- DataSourceTextField ctimeField = new DataSourceTextField(FIELD_CTIME, MSG.view_alerts_field_created_time());
+ DataSourceTextField ctimeField = new DataSourceTextField(FIELD_CTIME, MSG.common_title_createTime());
ctimeField.setType(FieldType.DATETIME);
fields.add(ctimeField);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java
new file mode 100644
index 0000000..8e858de
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java
@@ -0,0 +1,444 @@
+package org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.drift;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Set;
+
+import com.google.gwt.user.client.Timer;
+import com.smartgwt.client.data.DSRequest;
+import com.smartgwt.client.data.DSResponse;
+import com.smartgwt.client.types.MultipleAppearance;
+import com.smartgwt.client.types.Overflow;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.events.SubmitValuesEvent;
+import com.smartgwt.client.widgets.form.events.SubmitValuesHandler;
+import com.smartgwt.client.widgets.form.fields.CheckboxItem;
+import com.smartgwt.client.widgets.form.fields.FormItem;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
+
+import org.rhq.core.domain.authz.Permission;
+import org.rhq.core.domain.common.EntityContext;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.criteria.DriftCriteria;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
+import org.rhq.core.domain.drift.Drift;
+import org.rhq.core.domain.drift.DriftCategory;
+import org.rhq.core.domain.resource.composite.ResourcePermission;
+import org.rhq.core.domain.util.OrderingField;
+import org.rhq.core.domain.util.PageControl;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.core.domain.util.PageOrdering;
+import org.rhq.enterprise.gui.coregui.client.components.measurement.CustomConfigMeasurementRangeEditor;
+import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshPortletUtil;
+import org.rhq.enterprise.gui.coregui.client.dashboard.CustomSettingsPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.PortletWindow;
+import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent;
+import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent.Constant;
+import org.rhq.enterprise.gui.coregui.client.drift.DriftDataSource;
+import org.rhq.enterprise.gui.coregui.client.drift.DriftHistoryView;
+import org.rhq.enterprise.gui.coregui.client.util.MeasurementUtility;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
+
+/**
+ * A base class for deriving recent drift portlets for different entity contexts. In this way the
+ * basic plumbing is shared, giving a consistent behavior and configuration for the concrete portlets.
+ *
+ * @author Jay Shaughnessy
+ */
+public abstract class AbstractRecentDriftsPortlet extends DriftHistoryView implements CustomSettingsPortlet,
+ AutoRefreshPortlet {
+
+ private static final String DRIFT_CATEGORY = "DRIFT_CATEGORY";
+ private static final String DRIFT_CATEGORY_DEFAULT = ""; // all categories
+
+ // set on initial configuration, the window for this portlet view.
+ private PortletWindow portletWindow;
+
+ private DriftsPortletDataSource dataSource;
+
+ // autorefresh timer
+ private Timer refreshTimer;
+
+ public AbstractRecentDriftsPortlet(String locatorId, EntityContext entityContext) {
+ super(locatorId, null, entityContext);
+
+ setShowFilterForm(false); //disable filter form for portlet
+ setOverflow(Overflow.VISIBLE);
+ setShowFooterRefresh(false); //disable footer refresh button as redundant for portlets
+ setShowHeader(false);//disable header for portlets
+ }
+
+ public Timer getRefreshTimer() {
+ return refreshTimer;
+ }
+
+ public void setRefreshTimer(Timer refreshTimer) {
+ this.refreshTimer = refreshTimer;
+ }
+
+ public PortletWindow getPortletWindow() {
+ return portletWindow;
+ }
+
+ @Override
+ public DriftsPortletDataSource getDataSource() {
+ if (null == this.dataSource) {
+ this.dataSource = new DriftsPortletDataSource(getContext());
+ }
+ return this.dataSource;
+ }
+
+ @Override
+ public Canvas getHelpCanvas() {
+ return new HTMLFlow(MSG.view_portlet_help_recentDrifts());
+ }
+
+ @Override
+ public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
+
+ // the portletWindow does not change, so we can hold onto it locally
+ if (null == this.portletWindow && null != portletWindow) {
+ this.portletWindow = portletWindow;
+ }
+
+ // if there is no configuration there is nothing to set
+ if ((null == storedPortlet) || (null == storedPortlet.getConfiguration())) {
+ return;
+ }
+
+ Configuration config = storedPortlet.getConfiguration();
+
+ // not sure I love the fact that this common portlet config assigns some irrelevant/unused config props,
+ // may be better to prune the common set and add the specific properties locally in this method
+ for (String key : PortletConfigurationEditorComponent.CONFIG_PROPERTY_INITIALIZATION.keySet()) {
+ if (config.getSimple(key) == null) {
+ config.put(new PropertySimple(key, PortletConfigurationEditorComponent.CONFIG_PROPERTY_INITIALIZATION
+ .get(key)));
+ }
+ }
+
+ getDataSource().setConfiguration(config);
+ }
+
+ @Override
+ public DynamicForm getCustomSettingsForm() {
+
+ LocatableDynamicForm customSettingsForm = new LocatableDynamicForm(extendLocatorId("CustomSettings"));
+ LocatableVLayout page = new LocatableVLayout(customSettingsForm.extendLocatorId("Page"));
+ LocatableDynamicForm filterForm = new LocatableDynamicForm(page.extendLocatorId("Filter"));
+ filterForm.setMargin(5);
+
+ final DashboardPortlet storedPortlet = this.portletWindow.getStoredPortlet();
+ final Configuration portletConfig = storedPortlet.getConfiguration();
+
+ // drift category selector
+ SelectItem categoryFilter = new SelectItem("Category", MSG.common_title_category());
+ categoryFilter.setWrapTitle(false);
+ categoryFilter.setWidth(200);
+ categoryFilter.setMultiple(true);
+ categoryFilter.setMultipleAppearance(MultipleAppearance.PICKLIST);
+
+ LinkedHashMap<String, String> categories = new LinkedHashMap<String, String>(3);
+ categories.put(DriftCategory.FILE_ADDED.name(), MSG.view_drift_category_fileAdded());
+ categories.put(DriftCategory.FILE_CHANGED.name(), MSG.view_drift_category_fileChanged());
+ categories.put(DriftCategory.FILE_REMOVED.name(), MSG.view_drift_category_fileRemoved());
+ //TODO icons?
+ /*
+ LinkedHashMap<String, String> priorityIcons = new LinkedHashMap<String, String>(3);
+ priorityIcons.put(AlertPriority.HIGH.name(), ImageManager.getAlertIcon(AlertPriority.HIGH));
+ priorityIcons.put(AlertPriority.MEDIUM.name(), ImageManager.getAlertIcon(AlertPriority.MEDIUM));
+ priorityIcons.put(AlertPriority.LOW.name(), ImageManager.getAlertIcon(AlertPriority.LOW));
+ */
+ categoryFilter.setValueMap(categories);
+ //categoryFilter.setValueIcons(priorityIcons);
+ //reload current settings if they exist, otherwise enable all.
+ String currentValue = portletConfig.getSimple(DRIFT_CATEGORY).getStringValue();
+ if (currentValue.isEmpty() || currentValue.split(",").length == DriftCategory.values().length) {
+ categoryFilter.setValues(DriftCategory.names());
+ } else {
+ //spinder:3/4/11 doing this nonsense due to some weird smartgwt issue with SelectItem in VLayout.
+ if (currentValue.equalsIgnoreCase(DriftCategory.FILE_ADDED.name())) {
+ categoryFilter.setValues(DriftCategory.FILE_ADDED.name());
+ } else if (currentValue.equalsIgnoreCase(DriftCategory.FILE_CHANGED.name())) {
+ categoryFilter.setValues(DriftCategory.FILE_CHANGED.name());
+ } else if (currentValue.equalsIgnoreCase(DriftCategory.FILE_REMOVED.name())) {
+ categoryFilter.setValues(DriftCategory.FILE_REMOVED.name());
+ } else if (currentValue.equalsIgnoreCase(DriftCategory.FILE_ADDED.name() + ","
+ + DriftCategory.FILE_CHANGED.name())) {
+ categoryFilter.setValues(DriftCategory.FILE_ADDED.name(), DriftCategory.FILE_CHANGED.name());
+ } else if (currentValue.equalsIgnoreCase(DriftCategory.FILE_ADDED.name() + ","
+ + DriftCategory.FILE_REMOVED.name())) {
+ categoryFilter.setValues(DriftCategory.FILE_ADDED.name(), DriftCategory.FILE_REMOVED.name());
+ } else {
+ categoryFilter.setValues(DriftCategory.FILE_CHANGED.name(), DriftCategory.FILE_REMOVED.name());
+ }
+ }
+
+ final SelectItem driftCategorySelector = categoryFilter;
+
+ // result count selector
+ final SelectItem resultCountSelector = PortletConfigurationEditorComponent.getResultCountEditor(portletConfig);
+
+ // range selector
+ final CustomConfigMeasurementRangeEditor measurementRangeEditor = PortletConfigurationEditorComponent
+ .getMeasurementRangeEditor(portletConfig);
+
+ filterForm.setItems(driftCategorySelector, resultCountSelector);
+
+ //submit handler
+ customSettingsForm.addSubmitValuesHandler(new SubmitValuesHandler() {
+
+ @Override
+ public void onSubmitValues(SubmitValuesEvent event) {
+ // category
+ String selectedValue = driftCategorySelector.getValue().toString();
+ if ((selectedValue.trim().isEmpty())
+ || (selectedValue.split(",").length == DriftCategory.values().length)) {
+ // no severity filter
+ selectedValue = Constant.ALERT_PRIORITY_DEFAULT;
+ }
+ portletConfig.put(new PropertySimple(DRIFT_CATEGORY, selectedValue));
+
+ // result count
+ selectedValue = resultCountSelector.getValue().toString();
+ if (selectedValue.trim().isEmpty()) {
+ selectedValue = Constant.RESULT_COUNT_DEFAULT;
+ }
+ portletConfig.put(new PropertySimple(Constant.RESULT_COUNT, selectedValue));
+
+ // time range settings
+ saveMeasurementRangeEditorSettings(measurementRangeEditor, portletConfig);
+
+ // persist and reload portlet
+ storedPortlet.setConfiguration(portletConfig);
+ configure(portletWindow, storedPortlet);
+ //apply latest settings to the visible result set
+ refresh();
+ }
+ });
+
+ page.addMember(measurementRangeEditor);
+ page.addMember(filterForm);
+ customSettingsForm.addChild(page);
+
+ return customSettingsForm;
+ }
+
+ /**
+ * Takes the current value of the widget and persists it into the configuration object passed in.
+ *
+ * @param measurementRangeEditor
+ * @param portletConfig
+ * returns populated configuration object.
+ */
+ private void saveMeasurementRangeEditorSettings(final CustomConfigMeasurementRangeEditor measurementRangeEditor,
+ Configuration portletConfig) {
+ String selectedValue = null;
+ if ((measurementRangeEditor != null) && (portletConfig != null)) {
+ //time range filter. Check for enabled and then persist property. Dealing with compound widget.
+ FormItem item = measurementRangeEditor.getItem(CustomConfigMeasurementRangeEditor.ENABLE_RANGE_ITEM);
+ CheckboxItem itemC = (CheckboxItem) item;
+ boolean persistTimeRangeSettings = itemC.getValueAsBoolean();
+ if (persistTimeRangeSettings) {//retrieve values and persist
+ selectedValue = String.valueOf(itemC.getValueAsBoolean());
+ if (!selectedValue.trim().isEmpty()) {//then call
+ portletConfig.put(new PropertySimple(Constant.METRIC_RANGE_ENABLE, selectedValue));
+ }
+
+ //time advanced time filter enabled.
+ boolean isAdvanceTimeSetting = false;
+ selectedValue = String.valueOf(measurementRangeEditor.isAdvanced());
+ if ((selectedValue != null) && (!selectedValue.trim().isEmpty())) {
+ portletConfig.put(new PropertySimple(Constant.METRIC_RANGE_BEGIN_END_FLAG, selectedValue));
+ isAdvanceTimeSetting = Boolean.valueOf(selectedValue);
+ }
+
+ //time frame
+ List<Long> begEnd = measurementRangeEditor.getBeginEndTimes();
+ if (isAdvanceTimeSetting) {//advanced settings
+ portletConfig.put(new PropertySimple(Constant.METRIC_RANGE, (begEnd.get(0) + "," + begEnd.get(1))));
+ } else {
+ //save not advanced time range
+ portletConfig.put(new PropertySimple(Constant.METRIC_RANGE_LASTN, measurementRangeEditor
+ .getMetricRangePreferences().lastN));
+ portletConfig.put(new PropertySimple(Constant.METRIC_RANGE_UNIT, measurementRangeEditor
+ .getMetricRangePreferences().unit));
+ }
+ } else {//if disabled, reset time defaults
+ portletConfig.put(new PropertySimple(Constant.METRIC_RANGE_ENABLE, false));
+ portletConfig.put(new PropertySimple(Constant.METRIC_RANGE_BEGIN_END_FLAG, false));
+ List<Long> rangeArray = MeasurementUtility.calculateTimeFrame(Integer
+ .valueOf(Constant.METRIC_RANGE_LASTN_DEFAULT), Integer.valueOf(Constant.METRIC_RANGE_UNIT_DEFAULT));
+ // String[] range = {String.valueOf(rangeArray.get(0)),String.valueOf(rangeArray.get(1))};
+ portletConfig.put(new PropertySimple(Constant.METRIC_RANGE,
+ (String.valueOf(rangeArray.get(0)) + "," + String.valueOf(rangeArray.get(1)))));
+ }
+ }
+ }
+
+ @Override
+ protected void setupTableInteractions(boolean hasWriteAccess) {
+ if (!hasWriteAccess) {
+ Set<Permission> globalPerm = this.getPortletWindow().getGlobalPermissions();
+ ResourcePermission resPerm = this.getPortletWindow().getResourcePermissions();
+ hasWriteAccess = (globalPerm.contains(Permission.MANAGE_INVENTORY) || (null != resPerm && resPerm.isDrift()));
+ }
+ super.setupTableInteractions(hasWriteAccess);
+ }
+
+ @Override
+ protected void refreshTableInfo() {
+ super.refreshTableInfo();
+ if (getTableInfo() != null) {
+ int count = getListGrid().getSelection().length;
+ getTableInfo().setContents(
+ MSG.view_table_matchingRows(String.valueOf(getListGrid().getTotalRows()), String.valueOf(count)));
+ }
+ }
+
+ public void startRefreshCycle() {
+ refreshTimer = AutoRefreshPortletUtil.startRefreshCycle(this, this, refreshTimer);
+ }
+
+ public boolean isRefreshing() {
+ return false;
+ }
+
+ @Override
+ protected void onDestroy() {
+ AutoRefreshPortletUtil.onDestroy(this, refreshTimer);
+
+ super.onDestroy();
+ }
+
+ @Override
+ public void refresh() {
+ if (!isRefreshing()) {
+ super.refresh();
+ }
+ }
+
+ static public class DriftsPortletDataSource extends DriftDataSource {
+ private Configuration configuration;
+
+ public DriftsPortletDataSource(EntityContext entityContext) {
+ this(entityContext, null);
+ }
+
+ public DriftsPortletDataSource(EntityContext entityContext, Configuration configuration) {
+ super(entityContext);
+ this.configuration = configuration;
+ }
+
+ public Configuration getConfiguration() {
+ return configuration;
+ }
+
+ public void setConfiguration(Configuration configuration) {
+ this.configuration = configuration;
+ }
+
+ /* (non-Javadoc)
+ * This override allows us to set the total rows to the number of recent op history configured for
+ * the portlet. This sets the counter appropriately and stops further queries to the server.
+ */
+ @Override
+ protected int getTotalRows(final PageList<Drift> result, final DSResponse response, final DSRequest request) {
+
+ return result.size();
+ }
+
+ @Override
+ protected DriftCriteria getFetchCriteria(DSRequest request) {
+ DriftCriteria criteria = new DriftCriteria();
+
+ // result count
+ String currentSetting = this.configuration.getSimpleValue(Constant.RESULT_COUNT,
+ Constant.RESULT_COUNT_DEFAULT);
+
+ // We have to set a PageControl override here, or RPCDataSource will apply default paging based on the
+ // request. But, once setting a paging override the CriteriaQueryGenerator will use it for
+ // paging *and* sorting, so we need to also ensure our desired sorting is included in the override. So,
+ // to get the most recent drifts, apply a descending ordering on create time.
+ int pageNumber = 0;
+ int pageSize = Integer.valueOf(currentSetting);
+ OrderingField orderingField = new OrderingField("ctime", PageOrdering.DESC);
+ criteria.setPageControl(new PageControl(pageNumber, pageSize, orderingField));
+
+ // filter priority
+ currentSetting = this.configuration.getSimpleValue(DRIFT_CATEGORY, DRIFT_CATEGORY_DEFAULT);
+ String[] parsedValues = currentSetting.trim().split(",");
+ if (!(currentSetting.trim().isEmpty() || parsedValues.length == 3)) {
+ DriftCategory[] filterCategories = new DriftCategory[parsedValues.length];
+ int i = 0;
+ for (String priority : parsedValues) {
+ DriftCategory c = DriftCategory.valueOf(priority);
+ filterCategories[i++] = c;
+ }
+ criteria.addFilterCategories(filterCategories);
+ }
+
+ //result timeframe if enabled
+ currentSetting = this.configuration.getSimpleValue(Constant.METRIC_RANGE_ENABLE, null);
+ if (Boolean.valueOf(currentSetting)) {//then proceed setting
+
+ boolean isAdvanced = false;
+ //detect type of widget[Simple|Advanced]
+ PropertySimple property = this.configuration.getSimple(Constant.METRIC_RANGE_BEGIN_END_FLAG);
+ if (property != null) {
+ isAdvanced = property.getBooleanValue();
+ }
+ if (isAdvanced) {
+ //Advanced time settings
+ property = this.configuration.getSimple(Constant.METRIC_RANGE);
+ if (property != null) {
+ currentSetting = property.getStringValue();
+ String[] range = currentSetting.split(",");
+ criteria.addFilterStartTime(Long.valueOf(range[0]));
+ criteria.addFilterEndTime(Long.valueOf(range[1]));
+ }
+ } else {
+ //Simple time settings
+ property = this.configuration.getSimple(Constant.METRIC_RANGE_LASTN);
+ if (property != null) {
+ int lastN = property.getIntegerValue();
+ property = this.configuration.getSimple(Constant.METRIC_RANGE_UNIT);
+ int lastUnits = property.getIntegerValue();
+ ArrayList<Long> beginEnd = MeasurementUtility.calculateTimeFrame(lastN, Integer
+ .valueOf(lastUnits));
+ criteria.addFilterStartTime(Long.valueOf(beginEnd.get(0)));
+ criteria.addFilterEndTime(Long.valueOf(beginEnd.get(1)));
+ }
+ }
+ }
+
+ // add any context related filters
+ switch (getEntityContext().type) {
+ case Resource:
+ criteria.addFilterResourceIds(getEntityContext().getResourceId());
+ break;
+
+ /*
+ case ResourceGroup:
+ criteria.addFilterResourceGroupIds(getEntityContext().getGroupId());
+ */
+ }
+
+ criteria.fetchChangeSet(true);
+
+ return criteria;
+ }
+ }
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+ getListGrid().setEmptyMessage(MSG.view_portlet_results_empty());
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/RecentDriftsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/RecentDriftsPortlet.java
new file mode 100644
index 0000000..89f370d
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/RecentDriftsPortlet.java
@@ -0,0 +1,48 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2010 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.drift;
+
+import org.rhq.core.domain.common.EntityContext;
+import org.rhq.enterprise.gui.coregui.client.dashboard.Portlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.PortletViewFactory;
+
+/**
+ * @author Jay Shaughnessy
+ */
+public class RecentDriftsPortlet extends AbstractRecentDriftsPortlet {
+
+ // A non-displayed, persisted identifier for the portlet
+ public static final String KEY = "RecentDrifts";
+ // A default displayed, persisted name for the portlet
+ public static final String NAME = MSG.view_portlet_defaultName_recentDrifts();
+
+ public RecentDriftsPortlet(String locatorId) {
+ super(locatorId, EntityContext.forSubsystemView());
+ }
+
+ public static final class Factory implements PortletViewFactory {
+ public static PortletViewFactory INSTANCE = new Factory();
+
+ public final Portlet getInstance(String locatorId) {
+
+ return new RecentDriftsPortlet(locatorId);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDataSource.java
new file mode 100644
index 0000000..555e799
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDataSource.java
@@ -0,0 +1,302 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.drift;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.DSRequest;
+import com.smartgwt.client.data.DSResponse;
+import com.smartgwt.client.data.Record;
+import com.smartgwt.client.rpc.RPCResponse;
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.HoverCustomizer;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.common.EntityContext;
+import org.rhq.core.domain.criteria.DriftCriteria;
+import org.rhq.core.domain.drift.Drift;
+import org.rhq.core.domain.drift.DriftCategory;
+import org.rhq.core.domain.drift.DriftChangeSet;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
+import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
+import org.rhq.enterprise.gui.coregui.client.gwt.DriftGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.AncestryUtil;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository.TypesLoadedCallback;
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
+
+/**
+ * @author Jay Shaughnessy
+ */
+public class DriftDataSource extends RPCDataSource<Drift, DriftCriteria> {
+
+ public static final String FILTER_CATEGORIES = "categories";
+
+ private DriftGWTServiceAsync driftService = GWTServiceLookup.getDriftService();
+
+ private EntityContext entityContext;
+
+ public DriftDataSource() {
+ this(EntityContext.forSubsystemView());
+ }
+
+ public DriftDataSource(EntityContext context) {
+ super();
+ this.entityContext = context;
+
+ addDataSourceFields();
+ }
+
+ /**
+ * The view that contains the list grid which will display this datasource's data will call this
+ * method to get the field information which is used to control the display of the data.
+ *
+ * @return list grid fields used to display the datasource data
+ */
+ public ArrayList<ListGridField> getListGridFields() {
+ ArrayList<ListGridField> fields = new ArrayList<ListGridField>(6);
+
+ ListGridField ctimeField = new ListGridField("ctime", MSG.common_title_createTime());
+ ctimeField.setCellFormatter(new TimestampCellFormatter());
+ ctimeField.setShowHover(true);
+ ctimeField.setHoverCustomizer(TimestampCellFormatter.getHoverCustomizer("ctime"));
+ fields.add(ctimeField);
+
+ ListGridField categoryField = new ListGridField("category", MSG.common_title_category());
+ fields.add(categoryField);
+
+ ListGridField pathField = new ListGridField("path", MSG.common_title_path());
+ fields.add(pathField);
+
+ if (this.entityContext.type != EntityContext.Type.Resource) {
+ ListGridField resourceNameField = new ListGridField(AncestryUtil.RESOURCE_NAME, MSG.common_title_resource());
+ resourceNameField.setCellFormatter(new CellFormatter() {
+ public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
+ String url = LinkManager
+ .getResourceLink(listGridRecord.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
+ return SeleniumUtility.getLocatableHref(url, o.toString(), null);
+ }
+ });
+ resourceNameField.setShowHover(true);
+ resourceNameField.setHoverCustomizer(new HoverCustomizer() {
+
+ public String hoverHTML(Object value, ListGridRecord listGridRecord, int rowNum, int colNum) {
+ return AncestryUtil.getResourceHoverHTML(listGridRecord, 0);
+ }
+ });
+ fields.add(resourceNameField);
+
+ ListGridField ancestryField = AncestryUtil.setupAncestryListGridField();
+ fields.add(ancestryField);
+
+ ctimeField.setWidth(100);
+ categoryField.setWidth(100);
+ pathField.setWidth("35%");
+ resourceNameField.setWidth("25%");
+ ancestryField.setWidth("40%");
+ } else {
+ ctimeField.setWidth(200);
+ pathField.setWidth("*");
+ categoryField.setWidth(100);
+ }
+
+ return fields;
+ }
+
+ @Override
+ protected void executeFetch(final DSRequest request, final DSResponse response, final DriftCriteria criteria) {
+ if (criteria == null) {
+ // the user selected no categories in the filter - it makes sense from the UI perspective to show 0 rows
+ response.setTotalRows(0);
+ processResponse(request.getRequestId(), response);
+ return;
+ }
+
+ final long start = System.currentTimeMillis();
+
+ this.driftService.findDriftsByCriteria(criteria, new AsyncCallback<PageList<Drift>>() {
+
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(MSG.view_drift_failure_load(), caught);
+ response.setStatus(RPCResponse.STATUS_FAILURE);
+ processResponse(request.getRequestId(), response);
+ }
+
+ public void onSuccess(PageList<Drift> result) {
+ long fetchTime = System.currentTimeMillis() - start;
+ Log.info(result.size() + " drifts fetched in: " + fetchTime + "ms");
+
+ dataRetrieved(result, response, request);
+ }
+ });
+ }
+
+ /**
+ * Additional processing to support entity-specific or cross-resource views, and something that can be overidden.
+ */
+ protected void dataRetrieved(final PageList<Drift> result, final DSResponse response, final DSRequest request) {
+ switch (entityContext.type) {
+
+ // no need to disambiguate, the drifts are for a single resource
+ case Resource:
+ response.setData(buildRecords(result));
+ // for paging to work we have to specify size of full result set
+ response.setTotalRows(getTotalRows(result, response, request));
+ processResponse(request.getRequestId(), response);
+ break;
+
+ // disambiguate as the results could be cross-resource
+ default:
+ Set<Integer> typesSet = new HashSet<Integer>();
+ Set<String> ancestries = new HashSet<String>();
+ for (Drift drift : result) {
+ Resource resource = drift.getChangeSet().getResource();
+ typesSet.add(resource.getResourceType().getId());
+ ancestries.add(resource.getAncestry());
+ }
+
+ // In addition to the types of the result resources, get the types of their ancestry
+ typesSet.addAll(AncestryUtil.getAncestryTypeIds(ancestries));
+
+ ResourceTypeRepository typeRepo = ResourceTypeRepository.Cache.getInstance();
+ typeRepo.getResourceTypes(typesSet.toArray(new Integer[typesSet.size()]), new TypesLoadedCallback() {
+ @Override
+ public void onTypesLoaded(Map<Integer, ResourceType> types) {
+ // Smartgwt has issues storing a Map as a ListGridRecord attribute. Wrap it in a pojo.
+ AncestryUtil.MapWrapper typesWrapper = new AncestryUtil.MapWrapper(types);
+
+ Record[] records = buildRecords(result);
+ for (Record record : records) {
+ // To avoid a lot of unnecessary String construction, be lazy about building ancestry hover text.
+ // Store the types map off the records so we can build a detailed hover string as needed.
+ record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY_TYPES, typesWrapper);
+
+ // Build the decoded ancestry Strings now for display
+ record
+ .setAttribute(AncestryUtil.RESOURCE_ANCESTRY_VALUE, AncestryUtil.getAncestryValue(record));
+ }
+ response.setData(records);
+ // for paging to work we have to specify size of full result set
+ response.setTotalRows(getTotalRows(result, response, request));
+ processResponse(request.getRequestId(), response);
+ }
+ });
+ }
+ }
+
+ /**
+ * Sub-classes can override this to add fine-grained control over the result set size. By default the
+ * total rows are set to the total result set for the query, allowing proper paging. But some views (portlets)
+ * may want to limit results to a small set (like most recent).
+ * @param result
+ * @param response
+ * @param request
+ *
+ * @return should not exceed result.getTotalSize().
+ */
+ protected int getTotalRows(final PageList<Drift> result, final DSResponse response, final DSRequest request) {
+
+ return result.getTotalSize();
+ }
+
+ @Override
+ protected DriftCriteria getFetchCriteria(DSRequest request) {
+ DriftCategory[] categoriesFilter = getArrayFilter(request, FILTER_CATEGORIES, DriftCategory.class);
+
+ if (categoriesFilter == null || categoriesFilter.length == 0) {
+ return null; // user didn't select any priorities - return null to indicate no data should be displayed
+ }
+
+ DriftCriteria criteria = new DriftCriteria();
+ criteria.addFilterCategories(categoriesFilter);
+ criteria.fetchChangeSet(true);
+ criteria.setPageControl(getPageControl(request));
+
+ return criteria;
+ }
+
+ @Override
+ protected String getSortFieldForColumn(String columnName) {
+ if (AncestryUtil.RESOURCE_ANCESTRY.equals(columnName)) {
+ return "changeSet.resource.ancestry";
+ }
+
+ return super.getSortFieldForColumn(columnName);
+ }
+
+ @Override
+ public Drift copyValues(Record from) {
+ return null;
+ }
+
+ @Override
+ public ListGridRecord copyValues(Drift from) {
+ return convert(from);
+ }
+
+ public static ListGridRecord convert(Drift from) {
+ ListGridRecord record = new ListGridRecord();
+ record.setAttribute("id", from.getId());
+ record.setAttribute("ctime", new Date(from.getCtime()));
+ record.setAttribute("category", from.getCategory());
+ record.setAttribute("path", from.getPath());
+
+ DriftChangeSet changeSet = from.getChangeSet();
+ Resource resource = changeSet.getResource();
+
+ // for ancestry handling
+ record.setAttribute(AncestryUtil.RESOURCE_ID, resource.getId());
+ record.setAttribute(AncestryUtil.RESOURCE_NAME, resource.getName());
+ record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY, resource.getAncestry());
+ record.setAttribute(AncestryUtil.RESOURCE_TYPE_ID, resource.getResourceType().getId());
+
+ return record;
+ }
+
+ protected void executeRemove(Record recordToRemove, final DSRequest request, final DSResponse response) {
+ Window.alert(String.valueOf(recordToRemove.getAttributeAsInt("id")));
+ }
+
+ public DriftGWTServiceAsync getDriftService() {
+ return driftService;
+ }
+
+ protected EntityContext getEntityContext() {
+ return entityContext;
+ }
+
+ protected void setEntityContext(EntityContext entityContext) {
+ this.entityContext = entityContext;
+ }
+
+}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftHistoryView.java
new file mode 100644
index 0000000..c1dea6d
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftHistoryView.java
@@ -0,0 +1,290 @@
+/*
+ * RHQ Management Platform
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.drift;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.data.ResultSet;
+import com.smartgwt.client.data.SortSpecifier;
+import com.smartgwt.client.types.SortDirection;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.ListGrid;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.common.EntityContext;
+import org.rhq.core.domain.drift.DriftCategory;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
+import org.rhq.enterprise.gui.coregui.client.alert.AlertDetailsView;
+import org.rhq.enterprise.gui.coregui.client.components.form.EnumSelectItem;
+import org.rhq.enterprise.gui.coregui.client.components.table.AbstractTableAction;
+import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
+import org.rhq.enterprise.gui.coregui.client.components.table.TableActionEnablement;
+import org.rhq.enterprise.gui.coregui.client.components.table.TableSection;
+import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
+import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.AncestryUtil;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
+
+/**
+ * A view that displays a paginated table of fired {@link org.rhq.core.domain.drift.Drift}s, along with the
+ * ability to filter those drifts, sort those drifts, double-click a row to view full details a drift, and perform
+ * various operations on the the drifts: delete selected, delete all from source, etc.
+ * This view full respects the user's authorization, and will not allow operations on the drifts unless the user is
+ * either the inventory manager or has MANAGE_DRIFT permission on every resource corresponding to the drifts being
+ * operated on.
+ *
+ * @author Jay Shaughnessy
+ */
+public class DriftHistoryView extends TableSection<DriftDataSource> {
+
+ public static final ViewName SUBSYSTEM_VIEW_ID = new ViewName("RecentDrifts", MSG.common_title_recent_drifts());
+
+ private static SortSpecifier DEFAULT_SORT_SPECIFIER = new SortSpecifier("ctime", SortDirection.DESCENDING);
+
+ private static final Criteria INITIAL_CRITERIA = new Criteria();
+
+ EntityContext context;
+ boolean hasWriteAccess;
+ DriftDataSource dataSource;
+
+ static {
+ DriftCategory[] categoryValues = DriftCategory.values();
+ String[] categoryNames = new String[categoryValues.length];
+ int i = 0;
+ for (DriftCategory c : categoryValues) {
+ categoryNames[i++] = c.name();
+ }
+
+ INITIAL_CRITERIA.addCriteria(DriftDataSource.FILTER_CATEGORIES, categoryNames);
+ }
+
+ // for subsystem views
+ public DriftHistoryView(String locatorId) {
+ this(locatorId, SUBSYSTEM_VIEW_ID.getTitle(), EntityContext.forSubsystemView(), false);
+ }
+
+ public DriftHistoryView(String locatorId, EntityContext entityContext) {
+ this(locatorId, SUBSYSTEM_VIEW_ID.getTitle(), entityContext, false);
+ }
+
+ public DriftHistoryView(String locatorId, String tableTitle, EntityContext entityContext) {
+ this(locatorId, tableTitle, entityContext, false);
+ }
+
+ protected DriftHistoryView(String locatorId, String tableTitle, EntityContext context, boolean hasWriteAccess) {
+ super(locatorId, tableTitle, INITIAL_CRITERIA, new SortSpecifier[] { DEFAULT_SORT_SPECIFIER });
+ this.context = context;
+ this.hasWriteAccess = hasWriteAccess;
+
+ setInitialCriteriaFixed(false);
+ setDataSource(getDataSource());
+ }
+
+ @Override
+ public DriftDataSource getDataSource() {
+ if (null == this.dataSource) {
+ this.dataSource = new DriftDataSource(context);
+ }
+ return this.dataSource;
+ }
+
+ @Override
+ protected void configureTableFilters() {
+ LinkedHashMap<String, String> categories = new LinkedHashMap<String, String>(3);
+ categories.put(DriftCategory.FILE_ADDED.name(), MSG.view_drift_category_fileAdded());
+ categories.put(DriftCategory.FILE_CHANGED.name(), MSG.view_drift_category_fileChanged());
+ categories.put(DriftCategory.FILE_REMOVED.name(), MSG.view_drift_category_fileRemoved());
+ // TODO icons needed ?
+ //LinkedHashMap<String, String> priorityIcons = new LinkedHashMap<String, String>(3);
+ //priorityIcons.put(AlertPriority.HIGH.name(), ImageManager.getAlertIcon(AlertPriority.HIGH));
+ //priorityIcons.put(AlertPriority.MEDIUM.name(), ImageManager.getAlertIcon(AlertPriority.MEDIUM));
+ //priorityIcons.put(AlertPriority.LOW.name(), ImageManager.getAlertIcon(AlertPriority.LOW));
+ SelectItem categoryFilter = new EnumSelectItem(DriftDataSource.FILTER_CATEGORIES, MSG.common_title_category(),
+ DriftCategory.class, categories, null);
+
+ if (isShowFilterForm()) {
+ setFilterFormItems(categoryFilter);
+ }
+ }
+
+ @Override
+ protected void configureTable() {
+ ArrayList<ListGridField> dataSourceFields = getDataSource().getListGridFields();
+ getListGrid().setFields(dataSourceFields.toArray(new ListGridField[dataSourceFields.size()]));
+ setupTableInteractions(this.hasWriteAccess);
+
+ super.configureTable();
+ }
+
+ @Override
+ protected String getDetailsLinkColumnName() {
+ return "ctime";
+ }
+
+ @Override
+ protected CellFormatter getDetailsLinkColumnCellFormatter() {
+ return new CellFormatter() {
+ public String format(Object value, ListGridRecord record, int i, int i1) {
+ Integer resourceId = record.getAttributeAsInt(AncestryUtil.RESOURCE_ID);
+ Integer driftId = getId(record);
+ String url = LinkManager.getSubsystemDriftHistoryLink(resourceId, driftId);
+ String formattedValue = TimestampCellFormatter.format(value);
+ return SeleniumUtility.getLocatableHref(url, formattedValue, null);
+ }
+ };
+ }
+
+ protected void setupTableInteractions(final boolean hasWriteAccess) {
+ TableActionEnablement singleTargetEnablement = hasWriteAccess ? TableActionEnablement.ANY
+ : TableActionEnablement.NEVER;
+
+ addTableAction("DeleteDrift", MSG.common_button_delete(), MSG.view_drift_delete_confirm(),
+ new AbstractTableAction(singleTargetEnablement) {
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ delete(selection);
+ }
+ });
+ // TODO add ack
+ /*
+ addTableAction("AcknowledgeDrift", MSG.common_button_ack(), MSG.view_drift_ack_confirm(),
+ new AbstractTableAction(singleTargetEnablement) {
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ acknowledge(selection);
+ }
+ });
+ */
+ addTableAction("DeleteAll", MSG.common_button_delete_all(), MSG.view_drift_delete_confirmAll(),
+ new TableAction() {
+ public boolean isEnabled(ListGridRecord[] selection) {
+ ListGrid grid = getListGrid();
+ ResultSet resultSet = (null != grid) ? grid.getResultSet() : null;
+ return (hasWriteAccess && grid != null && resultSet != null && !resultSet.isEmpty());
+ }
+
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ deleteAll();
+ }
+ });
+ /*
+ addTableAction("AcknowledgeAll", MSG.common_button_ack_all(), MSG.view_alerts_ack_confirm_all(),
+ new TableAction() {
+ public boolean isEnabled(ListGridRecord[] selection) {
+ ListGrid grid = getListGrid();
+ ResultSet resultSet = (null != grid) ? grid.getResultSet() : null;
+ return (hasWriteAccess && grid != null && resultSet != null && !resultSet.isEmpty());
+ }
+
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ acknowledgeAll();
+ }
+ });
+ */
+ }
+
+ void delete(ListGridRecord[] records) {
+ final int[] driftIds = new int[records.length];
+ for (int i = 0, selectionLength = records.length; i < selectionLength; i++) {
+ ListGridRecord record = records[i];
+ Integer driftId = record.getAttributeAsInt("id");
+ driftIds[i] = driftId;
+ }
+
+ GWTServiceLookup.getDriftService().deleteDrifts(driftIds, new AsyncCallback<Integer>() {
+ public void onSuccess(Integer resultCount) {
+ CoreGUI.getMessageCenter().notify(
+ new Message(MSG.view_drift_success_delete(String.valueOf(resultCount)), Message.Severity.Info));
+ refresh();
+ }
+
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(MSG.view_drift_failure_delete(Arrays.toString(driftIds)), caught);
+ }
+ });
+ }
+
+ void deleteAll() {
+ GWTServiceLookup.getAlertService().deleteAlertsByContext(context, new AsyncCallback<Integer>() {
+ public void onSuccess(Integer resultCount) {
+ CoreGUI.getMessageCenter().notify(
+ new Message(MSG.view_drift_success_delete(String.valueOf(resultCount)), Message.Severity.Info));
+ refresh();
+ }
+
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(MSG.view_drift_failure_deleteAll(), caught);
+ }
+ });
+ }
+
+ //
+ // public void acknowledge(ListGridRecord[] records) {
+ // final int[] alertIds = new int[records.length];
+ // for (int i = 0, selectionLength = records.length; i < selectionLength; i++) {
+ // ListGridRecord record = records[i];
+ // Integer alertId = record.getAttributeAsInt("id");
+ // alertIds[i] = alertId;
+ // }
+ //
+ // GWTServiceLookup.getAlertService().acknowledgeAlerts(alertIds, new AsyncCallback<Integer>() {
+ // public void onSuccess(Integer resultCount) {
+ // CoreGUI.getMessageCenter().notify(
+ // new Message(MSG.view_alerts_ack_success(String.valueOf(resultCount)), Message.Severity.Info));
+ // refresh();
+ // }
+ //
+ // public void onFailure(Throwable caught) {
+ // CoreGUI.getErrorHandler().handleError(MSG.view_alerts_ack_failure(Arrays.toString(alertIds)), caught);
+ // }
+ // });
+ // }
+
+ // void acknowledgeAll() {
+ // GWTServiceLookup.getAlertService().acknowledgeAlertsByContext(context, new AsyncCallback<Integer>() {
+ // public void onSuccess(Integer resultCount) {
+ // CoreGUI.getMessageCenter().notify(
+ // new Message(MSG.view_alerts_ack_success(String.valueOf(resultCount)), Message.Severity.Info));
+ // refresh();
+ // }
+ //
+ // public void onFailure(Throwable caught) {
+ // CoreGUI.getErrorHandler().handleError(MSG.view_alerts_ack_failure_all(), caught);
+ // }
+ // });
+ // }
+
+ @Override
+ public Canvas getDetailsView(int alertId) {
+ return AlertDetailsView.getInstance();
+ }
+
+ public EntityContext getContext() {
+ return context;
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/SubsystemResourceDriftView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/SubsystemResourceDriftView.java
new file mode 100644
index 0000000..53309f7
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/SubsystemResourceDriftView.java
@@ -0,0 +1,31 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.drift;
+
+import org.rhq.core.domain.common.EntityContext;
+
+public class SubsystemResourceDriftView extends DriftHistoryView {
+ public SubsystemResourceDriftView(String locatorId, boolean hasWriteAccess) {
+ super(locatorId, MSG.common_title_recent_drifts(), EntityContext.forSubsystemView(), hasWriteAccess);
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java
new file mode 100644
index 0000000..9100ce3
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java
@@ -0,0 +1,65 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.gwt;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+
+import org.rhq.core.domain.criteria.DriftChangeSetCriteria;
+import org.rhq.core.domain.criteria.DriftCriteria;
+import org.rhq.core.domain.drift.Drift;
+import org.rhq.core.domain.drift.DriftChangeSet;
+import org.rhq.core.domain.util.PageList;
+
+/**
+ * @author Jay Shaughnessy
+ */
+public interface DriftGWTService extends RemoteService {
+
+ /**
+ * Delete the drifts with the specified ids if the current user has permission to do so (i.e. either
+ * the MANAGE_INVENTORY global permission, or the MANAGE_DRIFT permission for all corresponding resources).
+ * If the user does not have permission for all of the specified drifts, then none of the drifts will be deleted
+ * and a PermissionException will be thrown.
+ *
+ * If any of the ids do not correspond to drift entities that exist, those ids will be gracefully ignored.
+ *
+ * @param driftIds the ids of the drifts to be deleted
+ * @return the number of drifts deleted
+ */
+ int deleteDrifts(int[] driftIds) throws RuntimeException;
+
+ /**
+ * Find all drift changesets that match the specified criteria.
+ *
+ * @param criteria the criteria
+ *
+ * @return all drift changesets that matches the specified criteria
+ */
+ PageList<DriftChangeSet> findDriftChangeSetsByCriteria(DriftChangeSetCriteria criteria) throws RuntimeException;
+
+ /**
+ * Find all drifts that match the specified criteria.
+ *
+ * @param criteria the criteria
+ *
+ * @return all drifts that match the specified criteria
+ */
+ PageList<Drift> findDriftsByCriteria(DriftCriteria criteria) throws RuntimeException;
+
+}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
index fd9e3ed..65af432 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
@@ -58,6 +58,10 @@ public class GWTServiceLookup {
return secure(ConfigurationGWTServiceAsync.Util.getInstance());
}
+ public static DriftGWTServiceAsync getDriftService() {
+ return secure(DriftGWTServiceAsync.Util.getInstance());
+ }
+
public static PluginGWTServiceAsync getPluginService() {
return secure(PluginGWTServiceAsync.Util.getInstance());
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 84555a8..4ee7130 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -74,8 +74,9 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
* Right panel of the Resource view (#Resource/*).
*
- * @author Greg Hinkle
* @author Ian Springer
+ * @author Jay Shaughnessy
+ * @author Greg Hinkle
*/
public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceComposite, ResourceTitleBar> {
@@ -109,6 +110,7 @@ public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceCompo
private TwoLevelTab alertsTab;
private TwoLevelTab configurationTab;
private TwoLevelTab eventsTab;
+ private TwoLevelTab driftTab;
private TwoLevelTab contentTab;
private SubTab summaryActivity;
@@ -132,6 +134,7 @@ public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceCompo
private SubTab configCurrent;
private SubTab configHistory;
private SubTab eventHistory;
+ private SubTab driftHistory;
private SubTab contentDeployed;
private SubTab contentNew;
private SubTab contentSubscrip;
@@ -207,6 +210,7 @@ public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceCompo
.view_tabs_common_history()), null);
eventsTab.registerSubTabs(eventHistory);
tabs.add(eventsTab);
+
operationsTab = new TwoLevelTab(getTabSet().extendLocatorId(Tab.OPERATIONS), new ViewName(Tab.OPERATIONS, MSG
.view_tabs_common_operations()), "/images/icons/Operation_grey_16.png");
this.operationsSchedules = new SubTab(operationsTab.extendLocatorId(OperationsSubTab.SCHEDULES), new ViewName(
@@ -225,6 +229,17 @@ public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceCompo
configurationTab.registerSubTabs(this.configCurrent, this.configHistory);
tabs.add(configurationTab);
+ /*
+ driftTab = new TwoLevelTab(getTabSet().extendLocatorId("Drift"), new ViewName("Drift", MSG
+ .view_tabs_common_drift()), "/images/icons/Alert_grey_16.png");
+ this.alertHistory = new SubTab(driftTab.extendLocatorId("History"), new ViewName("History", MSG
+ .view_tabs_common_history()), null);
+ this.alertDef = new SubTab(driftTab.extendLocatorId("Definitions"), new ViewName("Definitions", MSG
+ .view_tabs_common_definitions()), null);
+ driftTab.registerSubTabs(alertHistory, alertDef);
+ tabs.add(driftTab);
+ */
+
contentTab = new TwoLevelTab(getTabSet().extendLocatorId("Content"), new ViewName("Content", MSG
.view_tabs_common_content()), "/images/icons/Content_grey_16.png");
this.contentDeployed = new SubTab(contentTab.extendLocatorId("Deployed"), new ViewName("Deployed", MSG
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
index 90e3ea4..8bd4960 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
@@ -41,6 +41,8 @@ import org.rhq.enterprise.gui.coregui.client.components.view.NavigationSection;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewFactory;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.platform.PlatformSummaryPortlet;
+import org.rhq.enterprise.gui.coregui.client.drift.DriftHistoryView;
+import org.rhq.enterprise.gui.coregui.client.drift.SubsystemResourceDriftView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ConfigurationHistoryView;
import org.rhq.enterprise.gui.coregui.client.operation.OperationHistoryView;
import org.rhq.enterprise.gui.coregui.client.report.measurement.MeasurementOOBView;
@@ -141,8 +143,18 @@ public class ReportTopView extends AbstractSectionedLeftNavigationView {
}
});
+ NavigationItem recentDriftsItem = new NavigationItem(DriftHistoryView.SUBSYSTEM_VIEW_ID,
+ "subsystems/configure/Configure_16.png", new ViewFactory() {
+ public Canvas createView() {
+ return new SubsystemResourceDriftView(
+ extendLocatorId(DriftHistoryView.SUBSYSTEM_VIEW_ID.getName()), getGlobalPermissions().contains(
+ Permission.MANAGE_INVENTORY));
+ }
+ });
+
return new NavigationSection(SECTION_SUBSYSTEMS_VIEW_ID, tagItem, suspectMetricsItem,
- recentConfigurationChangesItem, recentOperationsItem, recentAlertsItem, alertDefinitionsItem);
+ recentConfigurationChangesItem, recentOperationsItem, recentAlertsItem, alertDefinitionsItem,
+ recentDriftsItem);
}
private NavigationSection buildInventorySection() {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
index 2bd57d2..d916075 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
@@ -49,6 +49,7 @@ import com.smartgwt.client.widgets.form.validator.LengthRangeValidator;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.alert.AlertPriority;
+import org.rhq.core.domain.drift.DriftCategory;
import org.rhq.core.domain.event.EventSeverity;
import org.rhq.core.domain.operation.OperationRequestStatus;
import org.rhq.core.domain.resource.ResourceCategory;
@@ -535,6 +536,8 @@ public abstract class RPCDataSource<T, C extends org.rhq.core.domain.criteria.Cr
return (S[]) new OperationRequestStatus[size];
} else if (genericEnumType == ResourceCategory.class) {
return (S[]) new ResourceCategory[size];
+ } else if (genericEnumType == DriftCategory.class) {
+ return (S[]) new DriftCategory[size];
} else {
throw new IllegalArgumentException(MSG.dataSource_rpc_error_unsupportedEnumType(genericEnumType.getName()));
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java
new file mode 100644
index 0000000..26a9734
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java
@@ -0,0 +1,72 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.server.gwt;
+
+import org.rhq.core.domain.criteria.DriftChangeSetCriteria;
+import org.rhq.core.domain.criteria.DriftCriteria;
+import org.rhq.core.domain.drift.Drift;
+import org.rhq.core.domain.drift.DriftChangeSet;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.gwt.DriftGWTService;
+import org.rhq.enterprise.gui.coregui.server.util.SerialUtility;
+import org.rhq.enterprise.server.drift.DriftManagerLocal;
+import org.rhq.enterprise.server.util.LookupUtil;
+
+/**
+ * @author Jay Shaughnessy
+ */
+public class DriftGWTServiceImpl extends AbstractGWTServiceImpl implements DriftGWTService {
+ private static final long serialVersionUID = 1L;
+
+ private DriftManagerLocal driftManager = LookupUtil.getDriftManager();
+
+ @Override
+ public int deleteDrifts(int[] driftIds) throws RuntimeException {
+ try {
+ // TODO
+ //return this.driftManager.deleteDrifts(getSessionSubject(), driftIds);
+ return 0;
+ } catch (Throwable t) {
+ throw getExceptionToThrowToClient(t);
+ }
+ }
+
+ @Override
+ public PageList<DriftChangeSet> findDriftChangeSetsByCriteria(DriftChangeSetCriteria criteria)
+ throws RuntimeException {
+ try {
+ PageList<DriftChangeSet> result = this.driftManager.findDriftChangeSetsByCriteria(getSessionSubject(),
+ criteria);
+ return SerialUtility.prepare(result, "DriftService.findDriftChangeSetsByCriteria");
+ } catch (Throwable t) {
+ throw getExceptionToThrowToClient(t);
+ }
+ }
+
+ @Override
+ public PageList<Drift> findDriftsByCriteria(DriftCriteria criteria) throws RuntimeException {
+ try {
+ PageList<Drift> result = this.driftManager.findDriftsByCriteria(getSessionSubject(), criteria);
+ return SerialUtility.prepare(result, "DriftService.findDriftsByCriteria");
+ } catch (Throwable t) {
+ throw getExceptionToThrowToClient(t);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/RHQDomain.gwt.xml b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/RHQDomain.gwt.xml
index 35f03f0..7eadf2a 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/RHQDomain.gwt.xml
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/RHQDomain.gwt.xml
@@ -30,7 +30,10 @@
<entry-point class='org.rhq.core.client.RHQDomain'/>
<source path="client"/>
- <source path="domain"/>
+ <source path="domain">
+ <!-- Exclude any domain classes that can not be used client-side due to use of unsupported class use -->
+ <exclude name="**/DriftFileContent.*"/>
+ </source>
<!--<generate-with class="org.rhq.core.rebind.RecordBuilderGenerator">
<when-type-assignable class="org.rhq.core.domain.util.Recordizable"/>
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index e880e49..fdfbcde 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@ -138,6 +138,7 @@
<servlet path="/ConfigurationGwtService" class="org.rhq.enterprise.gui.coregui.server.gwt.ConfigurationGWTServiceImpl"/>
<servlet path="/ContentGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ContentGWTServiceImpl"/>
<servlet path="/DashboardGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.DashboardGWTServiceImpl"/>
+ <servlet path="/DriftGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.DriftGWTServiceImpl"/>
<servlet path="/EventGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.EventGWTServiceImpl"/>
<servlet path="/GroupAlertDefinitionGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.GroupAlertDefinitionGWTServiceImpl"/>
<servlet path="/GroupDefinitionExpressionBuilderGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.GroupDefinitionExpressionBuilderGWTServiceImpl"/>
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 c1e745b..d90336d 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
@@ -6,6 +6,7 @@
# http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
+
common_alert_high = High
common_alert_low = Low
common_alert_medium = Medium
@@ -121,6 +122,7 @@ common_title_component_errors = Component Errors
common_title_config_update_status = Update Status
common_title_configuration = Configuration
common_title_count = Count
+common_title_createTime = Creation Time
common_title_custom = Custom
common_title_dashboard_name = Dashboard Name
common_title_dateCreated = Date Created
@@ -176,6 +178,7 @@ common_title_providers = Providers
common_title_recent_alerts = Recent Alerts
common_title_recent_bundle_deployments = Recent Bundle Deployments
common_title_recent_configuration_updates = Recent Configuration Updates
+common_title_recent_drifts = Recent Drifts
common_title_recent_event_counts = Recent Event Counts
common_title_recent_measurements = Recent Measurements
common_title_recent_oob_metrics = Recent Out of Bound metrics
@@ -247,6 +250,7 @@ common_val_none = None
common_val_nth = {0}th
common_val_yes = Yes
common_val_yes_lower = yes
+
dataSource_ContentRepoTree_error_load = Error loading repositories
dataSource_ContentRepoTree_field_parentId = Parent ID
dataSource_bundle_loadFailed = Failed to load Bundle data
@@ -354,6 +358,7 @@ dataSource_users_field_passwordVerify = Verify Password
dataSource_users_field_phoneNumber = Phone Number
dataSource_users_invalidEmailAddress = Invalid email address.
dataSource_users_passwordsDoNotMatch = Passwords do not match.
+
datasource_roles_field_ldapGroups = LDAP Groups
datasource_roles_field_permissions = Permissions
datasource_roles_field_resourceGroups = Resource Groups
@@ -367,11 +372,15 @@ datasource_templateSchedules_enabled_failed = Failed to enable collection of met
datasource_templateSchedules_updated = Updated collection intervals of selected metric [{0}].
datasource_templateSchedules_updated_detail = Collection interval for metric [{0}] [{1}] by default for ResourceType with id [{2}] set to [{3}] seconds.
datasource_templateSchedules_updated_failed = Failed to set collection interval to [{0}] seconds for metric [{1}] [{2}] by default for ResourceType with id [{3}].
+
favorites = Favorites
+
favorites_groups = Favorite Groups
favorites_recentlyViewed = Recently Viewed
favorites_resources = Favorite Resources
+
group_tree_partialClusterTooltip = {0} out of {1} group members have a ''{2}'' resource
+
util_ancestry_parentAncestry = Parent Ancestry for:
util_errorHandler_nullException = exception was null
util_monitoringRequestCallback_error_checkServerStatusFailure = Unable to determine login status - check Server status.
@@ -382,6 +391,7 @@ util_userPerm_loadFailResource = Failed to load your permissions for Resource wi
util_userSession_loadFailSubject = UserSessionManager: Failed to load user Subject
util_userSession_logoutFail = Failed to logout.
util_widgetsField_unlimited = Unlimited
+
view_aboutBox_allRightsReserved = All Rights Reserved.
view_aboutBox_buildNumber = Build Number:
view_aboutBox_failedToLoad = Failed to load product information.
@@ -817,10 +827,8 @@ view_alerts_field_condition_text = Condition Text
view_alerts_field_condition_text_many = Multiple Conditions
view_alerts_field_condition_text_none = No Conditions
view_alerts_field_condition_value = Condition Value
-view_alerts_field_created_time = Creation Time
view_alerts_field_enabled = Enabled
view_alerts_field_modified_time = Modified Time
-view_alerts_field_name = Name
view_alerts_field_parent = Parent
view_alerts_field_priority = Priority
view_alerts_field_protected = Protected
@@ -1101,6 +1109,15 @@ view_dashboards_portlets_refresh_one_min = 1 minute
view_dashboards_portlets_refresh_success1 = Updated interval for portlets that auto-refresh
view_dashboards_portlets_refresh_success2 = Stopping reload for portlets that auto-refresh
view_dashboards_title = Dashboard
+view_drift_category_fileAdded = File Added
+view_drift_category_fileChanged = File Changed
+view_drift_category_fileRemoved = File Removed
+view_drift_delete_confirm = Delete the selected drift(s)?
+view_drift_delete_confirmAll = Delete all drifts from this source?
+view_drift_failure_delete = Failed to delete drifts with id''s: {0}
+view_drift_failure_deleteAll = Failed to delete all drifts from this source
+view_drift_failure_load = Failed to fetch drift data
+view_drift_success_delete = Successfully deleted {0} drifts
view_dynagroup_children = DynaGroup Children
view_dynagroup_compatible = Compatible
view_dynagroup_definitionAlreadyExists = A group definition already exists with this name
@@ -1428,6 +1445,7 @@ view_portlet_defaultName_operations = Recent Operations
view_portlet_defaultName_platformSummary = Platform Utilization
view_portlet_defaultName_problemResources = Alerted or Unavailable Resources
view_portlet_defaultName_recentAlerts = Recent Alerts
+view_portlet_defaultName_recentDrifts = Recent Drifts
view_portlet_defaultName_recentlyAddedResources = Recently Added Resources
view_portlet_defaultName_resourceMetric = Resource Metric Graph
view_portlet_defaultName_resource_alerts = Resource: Alerts
@@ -1460,6 +1478,7 @@ view_portlet_help_pkg_history = This portlet shows relevant package history base
view_portlet_help_platformSummary = This portlet displays utilization data (such as current CPU and memory usage) for platform resources that are accessible by the current user.
view_portlet_help_problemResources = This portlet displays the current user''s alerted or unavailable resources.
view_portlet_help_recentAlerts = This portlet displays alerts recently fired on the current user''s viewable inventory.
+view_portlet_help_recentDrifts = This portlet displays recent file drift on the current user''s viewable inventory.
view_portlet_help_recentlyAdded = This portlet displays resources that have recently been imported into inventory.
view_portlet_help_scheduledOperations = This portlet displays the next scheduled operations for the current user''s inventory.
view_portlet_help_tagCloud = This portlet displays the relative tag counts for the current user''s inventory.
@@ -1713,6 +1732,7 @@ view_upload_tooltip_1b = Select a file to upload, then click Next
view_upload_tooltip_2 = File upload had previously failed
view_upload_upload = Upload
view_upload_uploadFile = UploadFile
+
widget_colorPicker_tooltip = Click to select a new color
widget_durationItem_inputUnitLessThanTargetUnit = Input unit is less than target unit.
widget_durationItem_unitTypeNotSupported = Unit type [{0}] is not supported by this DurationItem.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
index 9e1efbd..42d5ebb 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
@@ -8,6 +8,7 @@
# http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
+
common_alert_high = HOCH
common_alert_low = NIEDRIG
common_alert_medium = MITTEL
@@ -111,6 +112,7 @@ common_title_component_errors = Fehler der Komponente
common_title_config_update_status = Status aktualisieren
common_title_configuration = Konfiguration
common_title_count = Anzahl
+common_title_createTime = Erstellungszeitpunkt
common_title_custom = Eigen
common_title_dashboard_name = Dashboard-Name
common_title_dateCreated = Zeitpunkt d. Erzeugung
@@ -167,6 +169,7 @@ common_title_providers = Provider
common_title_recent_alerts = Kürzlich ausgelöste Alarme
common_title_recent_bundle_deployments = Kürzliche Bundle-Deployments
common_title_recent_configuration_updates = Frische Konfigurationsaktualisierungen
+##common_title_recent_drifts = Recent Drifts
common_title_recent_event_counts = Anzahl frischer Events
common_title_recent_measurements = Frische Messwerte
common_title_recent_oob_metrics = Kürzlich aus dem Ruder gelaufene Metriken
@@ -237,6 +240,7 @@ common_val_none = Kein(e)
common_val_nth = {0}er
common_val_yes = Ja
common_val_yes_lower = ja
+
dataSource_ContentRepoTree_error_load = Error loading repositories~
dataSource_ContentRepoTree_field_parentId = Parent ID~
dataSource_bundle_loadFailed = Konnte die Bundle-Daten nicht laden
@@ -334,6 +338,7 @@ dataSource_users_field_passwordVerify = Passwort überprüfen
dataSource_users_field_phoneNumber = Telefonnummer
dataSource_users_invalidEmailAddress = Ungültige E-Mail-Adresse
dataSource_users_passwordsDoNotMatch = Passworte stimmen nicht überein.
+
datasource_templateSchedules_disabled = Das Erfassen der Messwerte für [{0}] wurde eingestellt.
datasource_templateSchedules_disabled_detailed = Sammeln der Daten für Metrik [{0}] [{1}] als Standard für Ressource-Tpypen mit ID [{2}] eingestellt.
datasource_templateSchedules_disabled_failed = Konnte das Sammeln der Daten für die Metrik [{0}] [{1}] als Standard für Ressourcen-Typ [{2}] nicht einstellen.
@@ -343,11 +348,15 @@ datasource_templateSchedules_enabled_failed = Konnte das Sammeln der Daten für
datasource_templateSchedules_updated = Zeitpläne für die ausgewählte Metrik [{0}] aktualisiert.
datasource_templateSchedules_updated_detail = Zeitplan für das Sammeln von Daten für Metrik [{0}] [{1}] als Standard für Ressourcen mit Typ-ID [{2}] auf [{3}] Sekunden gesetzt.
datasource_templateSchedules_updated_failed = Aktualisieren des Zeitplans auf [{0}] Sekunden für das Sammeln von Daten für Metrik [{1}] [{2}] als Standard für Ressourcen mit Typ-ID [{3}] ist fehlgeschlagen.
+
favorites = Lesezeichen
+
favorites_groups = Gemerkte Gruppen
favorites_recentlyViewed = Kürzlich angesehen
favorites_resources = Gemerkte Ressourcen
+
group_tree_partialClusterTooltip = {0} der {1} Gruppenmitglieder haben eine ''{2}'' Ressource
+
util_disambiguationReportDecorator_pluginSuffix = ({0} Plugin)
util_errorHandler_nullException = Exception war null
util_monitoringRequestCallback_error_checkServerStatusFailure = Unable to determine login status - check Server status.~
@@ -358,6 +367,7 @@ util_userPerm_loadFailResource = Failed to load your permissions for Resource wi
util_userSession_loadFailSubject = UserSessionManager: Konnte das 'Subject' des Benutzers nicht laden.
util_userSession_logoutFail = Ausloggen fehlgeschlagen
util_widgetsField_unlimited = Unbeschränkt
+
view_aboutBox_allRightsReserved = All Rights Reserved.~
view_aboutBox_buildNumber = Build-Nummer:
view_aboutBox_failedToLoad = Kann die Produktinformation nicht laden
@@ -686,10 +696,8 @@ view_alerts_field_condition_text = Bedingung(en)
view_alerts_field_condition_text_many = Mehrere Bedingungen
view_alerts_field_condition_text_none = Keine Bedingungen
view_alerts_field_condition_value = Bedingung
-view_alerts_field_created_time = Erstellungszeitpunkt
view_alerts_field_enabled = Aktiviert
view_alerts_field_modified_time = Zuletzt geändert
-view_alerts_field_name = Name
view_alerts_field_parent = Eltern
view_alerts_field_priority = Priorität
view_alerts_field_protected = Geschützt
@@ -925,6 +933,15 @@ view_dashboardsManager_error1 = Failed to add new dashboard~
view_dashboardsManager_message_title_details = <h1>Willkommen bei RHQ</h1>\n<p>Das RHQ-Projekt is an abstraction and plug-in based systems management suite that provides extensible and integrated systems management for multiple products and platforms across a set of core features. The project is designed with layered modules that provide a flexible architecture for deployment. It delivers a core user interface that delivers audited and historical management across an entire enterprise. A Server/Agent architecture provides remote management and plugins implement all specific support for managed products.</p>\n <p>This default dashboard can be edited by clicking the (edit mode) button above.</p>~
view_dashboards_confirm1 = Sind Sie sicher, dass Sie löschen möchten
view_dashboards_title = Dashboard
+##view_drift_category_fileAdded = File Added
+##view_drift_category_fileChanged = File Changed
+##view_drift_category_fileRemoved = File Removed
+##view_drift_delete_confirm = Delete the selected drift(s)?
+##view_drift_delete_confirmAll = Delete all drifts from this source?
+##view_drift_failure_delete = Failed to delete drifts with id''s: {0}
+##view_drift_failure_deleteAll = Failed to delete all drifts from this source
+##view_drift_failure_load = Failed to fetch drift data
+##view_drift_success_delete = Successfully deleted {0} drifts
view_dynagroup_children = DynaGroup Children~
view_dynagroup_compatible = Kompatible
view_dynagroup_definitionAlreadyExists = A group definition already exists with this name~
@@ -1179,6 +1196,7 @@ view_operationScheduleDetails_noParameters = Diese Operation benötigt keine Par
view_portlet_autodiscovery_config_platform_selection = Number of platforms to display~
view_portlet_autodiscovery_help_msg = This portlet offers the ability to import newly discovered resources into the inventory for monitoring and management or to ignore them from further action.~
view_portlet_autodiscovery_title = Discovery-Warteschlange
+##view_portlet_defaultName_recentDrifts = Recent Drifts
view_portlet_favoriteResources_msg = Dieses Potlet zeigt Ihre gemerkten Ressourcen
view_portlet_favoriteResources_title = Gemerkete Resourcen
view_portlet_generic_help = Für dieses Portlet liegt keine Hilfe vor
@@ -1191,6 +1209,8 @@ view_portlet_graph_help_msg = This Portlet supports the graphing of a resource m
view_portlet_graph_help_title = Graph Portlet~
view_portlet_graph_help_unconfigured = This graph is unconfigured, click the settings button to configure.~
view_portlet_graph_title = Resource Graph~
+##view_portlet_help_recentAlerts = This portlet displays alerts recently fired on the current user''s viewable inventory.
+##view_portlet_help_recentDrifts = This portlet displays recent file drift on the current user''s viewable inventory.
view_portlet_inventory_error1 = Konnte die Inventarübersicht nicht laden
view_portlet_inventory_tooltip_collapse = Klicken, um Details für diese Ressource zu verbergen.
view_portlet_inventory_tooltip_expand = Klicken, um mehr Details für diese Ressource zu sehen
@@ -1437,6 +1457,7 @@ view_upload_success = File successfully uploaded~
view_upload_tooltip_2 = File upload had previously failed~
view_upload_upload = Hochladen
view_upload_uploadFile = UploadFile~
+
widget_recordEditor_error_invalidViewPath = Ungültiger Anzeigepfad: [{0}]
widget_recordEditor_error_multipleRecords = Mehrere Datensätze gefunden - erwartet wurde genau einer.
widget_recordEditor_error_noRecords = Keine Datensätze gefunden - erwartet wurde genau einer.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
index 3e43cf4..f9fe2dc 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
@@ -8,6 +8,7 @@
# http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
+
common_alert_high = High
common_alert_low = Low
common_alert_medium = Medium
@@ -121,6 +122,7 @@ common_title_component_errors = コンポーネントエラー
common_title_config_update_status = 更新状態
common_title_configuration = 構成
common_title_count = 数
+common_title_createTime = 生成時刻
common_title_custom = カスタム
common_title_dashboard_name = ダッシュボード名
common_title_dateCreated = 生成日
@@ -176,6 +178,7 @@ common_title_providers = プロバイダ
common_title_recent_alerts = 最近のアラート
common_title_recent_bundle_deployments = 最近のバンドルのデプロイ
common_title_recent_configuration_updates = 最近の構成の更新
+##common_title_recent_drifts = Recent Drifts
common_title_recent_event_counts = 最近のイベント数
common_title_recent_measurements = 最近の測定
common_title_recent_oob_metrics = 最近の境界外のメトリックス
@@ -247,6 +250,7 @@ common_val_none = None
common_val_nth = {0}th
common_val_yes = Yes
common_val_yes_lower = yes
+
dataSource_ContentRepoTree_error_load = Error loading repositories
dataSource_ContentRepoTree_field_parentId = Parent ID
dataSource_bundle_loadFailed = Failed to load Bundle data
@@ -354,6 +358,7 @@ dataSource_users_field_passwordVerify = パスワードの確認
dataSource_users_field_phoneNumber = 電話番号
dataSource_users_invalidEmailAddress = 無効なEメールアドレス
dataSource_users_passwordsDoNotMatch = パスワードが一致していません
+
datasource_roles_field_ldapGroups = LDAPグループ
datasource_roles_field_permissions = パーミッション
datasource_roles_field_resourceGroups = リソースグループ
@@ -367,11 +372,15 @@ datasource_templateSchedules_enabled_failed = Failed to enable collection of met
datasource_templateSchedules_updated = Updated collection intervals of selected metric [{0}].
datasource_templateSchedules_updated_detail = Collection interval for metric [{0}] [{1}] by default for ResourceType with id [{2}] set to [{3}] seconds.
datasource_templateSchedules_updated_failed = Failed to set collection interval to [{0}] seconds for metric [{1}] [{2}] by default for ResourceType with id [{3}].
+
favorites = お気に入り
+
favorites_groups = お気に入りグループ
favorites_recentlyViewed = 最近閲覧した
favorites_resources = お気に入りリソース
+
group_tree_partialClusterTooltip = {0} out of {1} group members have a ''{2}'' resource
+
util_ancestry_parentAncestry = Parent Ancestry for:
util_disambiguationReportDecorator_pluginSuffix = ({0} plugin)
util_errorHandler_nullException = exception was null
@@ -383,6 +392,7 @@ util_userPerm_loadFailResource = Failed to load your permissions for Resource wi
util_userSession_loadFailSubject = UserSessionManager: Failed to load user Subject
util_userSession_logoutFail = Failed to logout.
util_widgetsField_unlimited = Unlimited
+
view_aboutBox_allRightsReserved = All Rights Reserved.
view_aboutBox_buildNumber = ビルド番号:
view_aboutBox_failedToLoad = Failed to load product information.
@@ -818,10 +828,8 @@ view_alerts_field_condition_text = 条件テキスト
view_alerts_field_condition_text_many = Multiple Conditions
view_alerts_field_condition_text_none = No Conditions
view_alerts_field_condition_value = Condition Value
-view_alerts_field_created_time = 生成時刻
view_alerts_field_enabled = 有効
view_alerts_field_modified_time = 修正時刻
-view_alerts_field_name = 名前
view_alerts_field_parent = 親
view_alerts_field_priority = 優先度
view_alerts_field_protected = Protected
@@ -1102,6 +1110,15 @@ view_dashboards_portlets_refresh_one_min = 1 minute
view_dashboards_portlets_refresh_success1 = Updated interval for portlets that auto-refresh
view_dashboards_portlets_refresh_success2 = Stopping reload for portlets that auto-refresh
view_dashboards_title = ダッシュボード
+##view_drift_category_fileAdded = File Added
+##view_drift_category_fileChanged = File Changed
+##view_drift_category_fileRemoved = File Removed
+##view_drift_delete_confirm = Delete the selected drift(s)?
+##view_drift_delete_confirmAll = Delete all drifts from this source?
+##view_drift_failure_delete = Failed to delete drifts with id''s: {0}
+##view_drift_failure_deleteAll = Failed to delete all drifts from this source
+##view_drift_failure_load = Failed to fetch drift data
+##view_drift_success_delete = Successfully deleted {0} drifts
view_dynagroup_children = DynaGroup Children
view_dynagroup_compatible = Compatible
view_dynagroup_definitionAlreadyExists = A group definition already exists with this name
@@ -1429,6 +1446,7 @@ view_portlet_defaultName_operations = 最近のオペレーション
view_portlet_defaultName_platformSummary = プラットフォーム利用率
view_portlet_defaultName_problemResources = アラートまたは利用できないリソース
view_portlet_defaultName_recentAlerts = 最近のアラート
+##view_portlet_defaultName_recentDrifts = Recent Drifts
view_portlet_defaultName_recentlyAddedResources = 最近追加されたリソース
view_portlet_defaultName_resourceMetric = Resource Metric Graph
view_portlet_defaultName_resource_alerts = リソース: アラート
@@ -1460,7 +1478,8 @@ view_portlet_help_operations_criteria = This portlet displays Operations consist
view_portlet_help_pkg_history = This portlet shows relevant package history based on display criteria configured.
view_portlet_help_platformSummary = This portlet displays utilization data (such as current CPU and memory usage) for platform resources that are accessible by the current user.
view_portlet_help_problemResources = This portlet displays the current user''s alerted or unavailable resources.
-view_portlet_help_recentAlerts = This portlet displays alerts recently fired on the current user''s viewable inventory.
+##view_portlet_help_recentAlerts = This portlet displays alerts recently fired on the current user''s viewable inventory.
+##view_portlet_help_recentDrifts = This portlet displays recent file drift on the current user''s viewable inventory.
view_portlet_help_recentlyAdded = This portlet displays resources that have recently been imported into inventory.
view_portlet_help_scheduledOperations = This portlet displays the next scheduled operations for the current user''s inventory.
view_portlet_help_tagCloud = This portlet displays the relative tag counts for the current user''s inventory.
@@ -1714,6 +1733,7 @@ view_upload_tooltip_1b = Select a file to upload, then click Next
view_upload_tooltip_2 = File upload had previously failed
view_upload_upload = Upload
view_upload_uploadFile = UploadFile
+
widget_colorPicker_tooltip = Click to select a new color
widget_durationItem_inputUnitLessThanTargetUnit = Input unit is less than target unit.
widget_durationItem_unitTypeNotSupported = Unit type [{0}] is not supported by this DurationItem.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
index 3dd563c..226400c 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
@@ -6,6 +6,7 @@
# http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
+
common_alert_high = Alto
common_alert_low = Baixo
common_alert_medium = M\u00E9dio
@@ -121,6 +122,7 @@ common_title_component_errors = Componentes com erro
common_title_config_update_status = Atualizar Status
common_title_configuration = Configura\u00E7\u00E3o
common_title_count = Quantidade
+common_title_createTime = Data de Cria\u00E7\u00E3o
common_title_custom = Personalizado
common_title_dashboard_name = Nome do Painel de Controle
common_title_dateCreated = Data de Cria\u00E7\u00E3o
@@ -178,6 +180,7 @@ common_title_providers = Provedores
common_title_recent_alerts = Alertas Recentes
common_title_recent_bundle_deployments = Recent Bundle Deployments
common_title_recent_configuration_updates = Configura\u00E7\u00F5es Alteradas Recentemente
+##common_title_recent_drifts = Recent Drifts
common_title_recent_event_counts = Totaliza\u00E7\u00E3o de Eventos Recentes
common_title_recent_measurements = M\u00E9tricas Recentes
common_title_recent_oob_metrics = M\u00E9tricas fora dos limites Recentes
@@ -250,6 +253,7 @@ common_val_none = Nenhum
common_val_nth = {0}\u00BA
common_val_yes = Sim
common_val_yes_lower = sim
+
dataSource_ContentRepoTree_error_load = Erro ao carregar os reposit\u00F3rios
dataSource_ContentRepoTree_field_parentId = ID pai
dataSource_bundle_loadFailed = Falha ao carregar os dados do Bundle
@@ -366,6 +370,7 @@ dataSource_users_field_passwordVerify = Verifique a Senha
dataSource_users_field_phoneNumber = N\u00FAmero de Telefone
dataSource_users_invalidEmailAddress = Endere\u00E7o de email inv\u00E1lido.
dataSource_users_passwordsDoNotMatch = Senhas n\u00E3o conferem.
+
datasource_roles_field_ldapGroups = Grupos LDAP
datasource_roles_field_permissions = Permiss\u00F5es
datasource_roles_field_resourceGroups = Grupos de Recurso
@@ -379,11 +384,15 @@ datasource_templateSchedules_enabled_failed = Falha ao habilitar a coleta da m\u
datasource_templateSchedules_updated = Intervalos de coleta atualizados para a m\u00E9trica [{0}].
datasource_templateSchedules_updated_detail = Intervalo de coleta da m\u00E9trica [{0}] [{1}] para o Tipo de Recurso com id [{2}] configurado para [{3}] segundos.
datasource_templateSchedules_updated_failed = Falha ao configurar o intervalo de coleta para [{0}] segundos para a m\u00E9trica [{1}] [{2}] para o Tipo de Recurso com id [{3}].
+
favorites = Favoritos
+
favorites_groups = Grupos Favoritos
favorites_recentlyViewed = Acessados Recentemente
favorites_resources = Recursos Favoritos
+
group_tree_partialClusterTooltip = {0} out of {1} group members have a ''{2}'' resource
+
util_ancestry_parentAncestry = Ancestral para:
util_errorHandler_nullException = Exce\u00E7\u00E3o nula
util_monitoringRequestCallback_error_checkServerStatusFailure = Imposs\u00EDvel verificar o status do login - verifique o status do Servidor.
@@ -394,6 +403,7 @@ util_userPerm_loadFailResource = Falha ao carregar suas permiss\u00F5es para o R
util_userSession_loadFailSubject = UserSessionManager: Falha ao carregar a credencial do usu\u00E1rio
util_userSession_logoutFail = Falha durante o logout.
util_widgetsField_unlimited = Ilimitado
+
view_aboutBox_allRightsReserved = Todos os Direitos Reservados.~
view_aboutBox_buildNumber = N\u00FAmero do Build:~
view_aboutBox_failedToLoad = Falha ao carregar informa\u00E7oes do produto.~
@@ -834,10 +844,8 @@ view_alerts_field_condition_text = Condi\u00E7\u00E3o
view_alerts_field_condition_text_many = M\u00FAltiplas condi\u00E7\u00F5es
view_alerts_field_condition_text_none = Sem condi\u00E7\u00F5es
view_alerts_field_condition_value = Valor da Condi\u00E7\u00E3o
-view_alerts_field_created_time = Data de Cria\u00E7\u00E3o
view_alerts_field_enabled = Habilitado
view_alerts_field_modified_time = Data de Altera\u00E7\u00E3o
-view_alerts_field_name = Nome
view_alerts_field_parent = Pai
view_alerts_field_priority = Prioridade
view_alerts_field_protected = Protegido
@@ -1125,6 +1133,15 @@ view_dashboards_portlets_refresh_one_min = 1 minute
view_dashboards_portlets_refresh_success1 = Updated interval for portlets that auto-refresh
view_dashboards_portlets_refresh_success2 = Stopping reload for portlets that auto-refresh
view_dashboards_title = Dashboard~
+##view_drift_category_fileAdded = File Added
+##view_drift_category_fileChanged = File Changed
+##view_drift_category_fileRemoved = File Removed
+##view_drift_delete_confirm = Delete the selected drift(s)?
+##view_drift_delete_confirmAll = Delete all drifts from this source?
+##view_drift_failure_delete = Failed to delete drifts with id''s: {0}
+##view_drift_failure_deleteAll = Failed to delete all drifts from this source
+##view_drift_failure_load = Failed to fetch drift data
+##view_drift_success_delete = Successfully deleted {0} drifts
view_dynagroup_children = DynaGroup Children~
view_dynagroup_compatible = Compatible
view_dynagroup_definitionAlreadyExists = A group definition already exists with this name~
@@ -1502,6 +1519,7 @@ view_portlet_defaultName_operations = Recent Operations
view_portlet_defaultName_platformSummary = Platform Utilization
view_portlet_defaultName_problemResources = Alerted or Unavailable Resources
view_portlet_defaultName_recentAlerts = Recent Alerts
+##view_portlet_defaultName_recentDrifts = Recent Drifts
view_portlet_defaultName_recentlyAddedResources = Recently Added Resources
view_portlet_defaultName_resourceMetric = Resource Metric Graph
view_portlet_defaultName_resource_alerts = Resource: Alerts
@@ -1543,7 +1561,8 @@ view_portlet_help_operations_criteria = This portlet displays Operations consist
view_portlet_help_pkg_history = This portlet shows relevant package history based on display criteria configured.
view_portlet_help_platformSummary = This portlet displays utilization data (such as current CPU and memory usage) for platform resources that are accessible by the current user.
view_portlet_help_problemResources = This portlet displays the current user''s alerted or unavailable resources.
-view_portlet_help_recentAlerts = This portlet displays alerts recently fired on the current user''s viewable inventory.
+##view_portlet_help_recentAlerts = This portlet displays alerts recently fired on the current user''s viewable inventory.
+##view_portlet_help_recentDrifts = This portlet displays recent file drift on the current user''s viewable inventory.
view_portlet_help_recentlyAdded = This portlet displays resources that have recently been imported into inventory.
view_portlet_help_scheduledOperations = This portlet displays the next scheduled operations for the current user''s inventory.
view_portlet_help_tagCloud = This portlet displays the relative tag counts for the current user''s inventory.
@@ -1831,6 +1850,7 @@ view_upload_tooltip_1b = Select a file to upload, then click Next
view_upload_tooltip_2 = File upload had previously failed~
view_upload_upload = Upload~
view_upload_uploadFile = UploadFile~
+
widget_colorPicker_tooltip = Clique para selecionar uma nova cor
widget_durationItem_inputUnitLessThanTargetUnit = A unidade de entrada \u00E9 menor que a unidade final.
widget_durationItem_unitTypeNotSupported = Tipo de unidade [{0}] n\u00E3o suportada por este Item de Dura\u00E7\u00E3o.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
index 2de927f..2eff633 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
@@ -6,6 +6,7 @@
# http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
+
common_alert_high = High
common_alert_low = Low
common_alert_medium = Medium
@@ -121,6 +122,7 @@ common_title_component_errors = \u7EC4\u4EF6\u9519\u8BEF
common_title_config_update_status = \u66F4\u65B0\u72B6\u6001
common_title_configuration = \u914D\u7F6E
common_title_count = \u6570
+common_title_createTime = \u4EA7\u751F\u65F6\u95F4
common_title_custom = \u81EA\u5B9A\u4E49
common_title_dashboard_name = \u7EDF\u8BA1\u8868\u76D8\u540D
common_title_dateCreated = \u521B\u5EFA\u65E5\u671F
@@ -176,6 +178,7 @@ common_title_providers = \u63D0\u4F9B\u8005
common_title_recent_alerts = \u6700\u8FD1\u544A\u8B66
common_title_recent_bundle_deployments = \u6700\u8FD1\u53D1\u5E03Bundles
common_title_recent_configuration_updates = \u6700\u8FD1\u914D\u7F6E\u66F4\u65B0
+##common_title_recent_drifts = Recent Drifts
common_title_recent_event_counts = \u6700\u8FD1\u4E8B\u4EF6\u6570
common_title_recent_measurements = Recent Measurements
common_title_recent_oob_metrics = Recent Out of Bound metrics
@@ -247,6 +250,7 @@ common_val_none = None
common_val_nth = {0}th
common_val_yes = Yes
common_val_yes_lower = yes
+
dataSource_ContentRepoTree_error_load = \u52A0\u8F7D\u5E93\u9519\u8BEF
dataSource_ContentRepoTree_field_parentId = \u7236ID
dataSource_bundle_loadFailed = \u52A0\u8F7Dbundle\u6570\u636E\u5931\u8D25
@@ -354,6 +358,7 @@ dataSource_users_field_passwordVerify = \u786E\u8BA4\u5BC6\u7801
dataSource_users_field_phoneNumber = \u7535\u8BDD\u53F7\u7801
dataSource_users_invalidEmailAddress = \u90AE\u7BB1\u5730\u5740\u65E0\u6548.
dataSource_users_passwordsDoNotMatch = \u5BC6\u7801\u4E0D\u5339\u914D.
+
datasource_roles_field_ldapGroups = LDAP\u7EC4
datasource_roles_field_permissions = \u6743\u9650
datasource_roles_field_resourceGroups = \u8D44\u6E90\u7EC4
@@ -367,11 +372,15 @@ datasource_templateSchedules_enabled_failed = Failed to enable collection of met
datasource_templateSchedules_updated = Updated collection intervals of selected metric [{0}].
datasource_templateSchedules_updated_detail = Collection interval for metric [{0}] [{1}] by default for ResourceType with id [{2}] set to [{3}] seconds.
datasource_templateSchedules_updated_failed = Failed to set collection interval to [{0}] seconds for metric [{1}] [{2}] by default for ResourceType with id [{3}].
+
favorites = \u6536\u85CF\u5939
+
favorites_groups = \u7EC4\u6536\u85CF\u5939
favorites_recentlyViewed = \u6700\u8FD1\u67E5\u770B
favorites_resources = \u8D44\u6E90\u6536\u85CF\u5939
+
group_tree_partialClusterTooltip = \u9664\u53BB {1},{0}\u7684\u7EC4\u6210\u5458\u62E5\u6709 \u4E00\u4E2A''{2}''\u8D44\u6E90
+
util_ancestry_parentAncestry = Parent Ancestry for:
util_errorHandler_nullException = exception was null
util_monitoringRequestCallback_error_checkServerStatusFailure = \u65E0\u6CD5\u786E\u5B9A\u767B\u5F55\u72B6\u6001- \u68C0\u67E5\u670D\u52A1\u5668\u72B6\u6001.
@@ -382,6 +391,7 @@ util_userPerm_loadFailResource = \u65E0\u6CD5\u8BBF\u95EE\u8D44\u6E90[{0}] - \u6
util_userSession_loadFailSubject = UserSessionManager: \u52A0\u8F7D\u7528\u6237\u4E3B\u9898\u5931\u8D25
util_userSession_logoutFail = \u6CE8\u9500\u5931\u8D25.
util_widgetsField_unlimited = \u65E0\u9650\u5236
+
view_aboutBox_allRightsReserved = All Rights Reserved.
view_aboutBox_buildNumber = \u4EA7\u54C1\u7F16\u8BD1\u53F7:
view_aboutBox_failedToLoad = \u52A0\u8F7D\u4EA7\u54C1\u4FE1\u606F\u5931\u8D25.
@@ -817,10 +827,8 @@ view_alerts_field_condition_text = Condition Text
view_alerts_field_condition_text_many = Multiple Conditions
view_alerts_field_condition_text_none = No Conditions
view_alerts_field_condition_value = Condition Value
-view_alerts_field_created_time = \u4EA7\u751F\u65F6\u95F4
view_alerts_field_enabled = \u542F\u7528
view_alerts_field_modified_time = \u4FEE\u6539\u65F6\u95F4
-view_alerts_field_name = Name
view_alerts_field_parent = \u7236
view_alerts_field_priority = \u4F18\u5148\u7EA7
view_alerts_field_protected = Protected
@@ -1101,6 +1109,15 @@ view_dashboards_portlets_refresh_one_min = 1 \u5206\u652F
view_dashboards_portlets_refresh_success1 = \u6210\u529F\u4FEE\u6539portlets\u81EA\u52A8\u5237\u65B0\u7684\u95F4\u9694\u65F6\u95F4
view_dashboards_portlets_refresh_success2 = \u6210\u529F\u505C\u7528portlets\u81EA\u52A8\u5237\u65B0\u7684\u91CD\u8F7D
view_dashboards_title = \u7EDF\u8BA1\u8868\u76D8
+##view_drift_category_fileAdded = File Added
+##view_drift_category_fileChanged = File Changed
+##view_drift_category_fileRemoved = File Removed
+##view_drift_delete_confirm = Delete the selected drift(s)?
+##view_drift_delete_confirmAll = Delete all drifts from this source?
+##view_drift_failure_delete = Failed to delete drifts with id''s: {0}
+##view_drift_failure_deleteAll = Failed to delete all drifts from this source
+##view_drift_failure_load = Failed to fetch drift data
+##view_drift_success_delete = Successfully deleted {0} drifts
view_dynagroup_children = \u5B50\u52A8\u6001\u7EC4
view_dynagroup_compatible = \u517C\u5BB9\u6027
view_dynagroup_definitionAlreadyExists = \u5DF2\u7ECF\u5B58\u5728\u4EE5\u8BE5\u540D\u79F0\u547D\u540D\u7684\u7EC4\u5B9A\u4E49
@@ -1428,6 +1445,7 @@ view_portlet_defaultName_operations = \u8FD1\u671F\u64CD\u4F5C
view_portlet_defaultName_platformSummary = \u5E73\u53F0\u5229\u7528\u7387
view_portlet_defaultName_problemResources = \u544A\u8B66\u6216\u8005\u4E0D\u53EF\u7528\u7684\u8D44\u6E90
view_portlet_defaultName_recentAlerts = \u65B0\u544A\u8B66
+##view_portlet_defaultName_recentDrifts = Recent Drifts
view_portlet_defaultName_recentlyAddedResources = \u65B0\u6DFB\u52A0\u8D44\u6E90
view_portlet_defaultName_resourceMetric = \u516C\u7528\u8D44\u6E90\u56FE\u6807
view_portlet_defaultName_resource_alerts = \u8D44\u6E90: \u544A\u8B66
@@ -1459,7 +1477,8 @@ view_portlet_help_operations_criteria = This portlet displays Operations consist
view_portlet_help_pkg_history = This portlet shows relevant package history based on display criteria configured.
view_portlet_help_platformSummary = This portlet displays utilization data (such as current CPU and memory usage) for platform resources that are accessible by the current user.
view_portlet_help_problemResources = This portlet displays the current user''s alerted or unavailable resources.
-view_portlet_help_recentAlerts = This portlet displays alerts recently fired on the current user''s viewable inventory.
+##view_portlet_help_recentAlerts = This portlet displays alerts recently fired on the current user''s viewable inventory.
+##view_portlet_help_recentDrifts = This portlet displays recent file drift on the current user''s viewable inventory.
view_portlet_help_recentlyAdded = This portlet displays resources that have recently been imported into inventory.
view_portlet_help_scheduledOperations = This portlet displays the next scheduled operations for the current user''s inventory.
view_portlet_help_tagCloud = This portlet displays the relative tag counts for the current user''s inventory.
@@ -1713,6 +1732,7 @@ view_upload_tooltip_1b = \u9009\u62E9\u4E00\u4E2A\u6587\u4EF6\u4E0A\u4F20, \u713
view_upload_tooltip_2 = \u6587\u4EF6\u4E0A\u4F20 \u524D\u53D1\u751F\u9519\u8BEF
view_upload_upload = \u4E0A\u4F20
view_upload_uploadFile = \u4E0A\u4F20\u6587\u4EF6
+
widget_colorPicker_tooltip = \u9009\u62E9\u989C\u8272
widget_durationItem_inputUnitLessThanTargetUnit = \u8F93\u5165\u5355\u4F4D\u662F\u5C0F\u4E8E\u76EE\u6807\u5355\u4F4D.
widget_durationItem_unitTypeNotSupported = \u5355\u4F4D\u7C7B\u578B[{0}]\u4E0D\u88ABDurationItem\u652F\u6301.
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
index 9a86f83..c4943ed 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
+++ b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
@@ -157,6 +157,10 @@
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI PluginGWTService</servlet-name>
<servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.PluginGWTServiceImpl</servlet-class>
</servlet>
+ <servlet>
+ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI DriftGWTService</servlet-name>
+ <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.DriftGWTServiceImpl</servlet-class>
+ </servlet>
<servlet-mapping>
@@ -303,6 +307,10 @@
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI PluginGWTService</servlet-name>
<url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/PluginGWTService</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI DriftGWTService</servlet-name>
+ <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/DriftGWTService</url-pattern>
+ </servlet-mapping>
<welcome-file-list>
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
index ff7d2d8..3e8b33d 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
@@ -56,10 +56,13 @@ import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.criteria.DriftChangeSetCriteria;
+import org.rhq.core.domain.criteria.DriftCriteria;
import org.rhq.core.domain.drift.Drift;
import org.rhq.core.domain.drift.DriftChangeSet;
+import org.rhq.core.domain.drift.DriftChangeSetCategory;
import org.rhq.core.domain.drift.DriftConfiguration;
import org.rhq.core.domain.drift.DriftFile;
+import org.rhq.core.domain.drift.DriftFileContent;
import org.rhq.core.domain.drift.DriftFileStatus;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.util.PageList;
@@ -130,12 +133,13 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
DriftChangeSetCriteria c = new DriftChangeSetCriteria();
c.addFilterResourceId(resourceId);
List<DriftChangeSet> changeSets = findDriftChangeSetsByCriteria(subjectManager.getOverlord(), c);
- final boolean isInitialChangeSet = changeSets.isEmpty();
final int version = changeSets.size();
+ // TODO: set caetgory based on changeset parsing
+ final DriftChangeSetCategory category = (0 == version) ? DriftChangeSetCategory.COVERAGE
+ : DriftChangeSetCategory.DRIFT;
// store the new change set info (not the actual blob)
- final DriftChangeSet driftChangeSet = new DriftChangeSet(resource, version);
- //driftChangeSet.setData(Hibernate.createBlob(new BufferedInputStream(new FileInputStream(changeSetZip))));
+ final DriftChangeSet driftChangeSet = new DriftChangeSet(resource, version, category);
entityManager.persist(driftChangeSet);
ZipUtil.walkZipFile(changeSetZip, new ChangeSetFileVisitor() {
@@ -156,10 +160,10 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
DriftFile oldDriftFile = getDriftFile(entry.getOldSHA(), emptyDriftFiles);
DriftFile newDriftFile = getDriftFile(entry.getNewSHA(), emptyDriftFiles);
- // We don't generate Drift occurrences off of the initial change set. It is used only
+ // We don't generate Drift occurrences off of a coverage changeset. It is used only
// to give us a starting point and to tell us what files we need to pull down.
- if (!isInitialChangeSet) {
- // use a canonical path with only forward slashing to ensure consistent paths across reports
+ if (DriftChangeSetCategory.DRIFT.equals(category)) {
+ // use a path with only forward slashing to ensure consistent paths across reports
String path = new File(dir.getDirectory(), entry.getFile()).getPath();
path = FileUtil.useForwardSlash(path);
Drift drift = new Drift(driftChangeSet, path, entry.getType(), oldDriftFile,
@@ -238,9 +242,9 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void persistDriftFileData(DriftFile driftFile, InputStream data) throws Exception {
- DriftFile df = entityManager.find(DriftFile.class, driftFile.getSha256());
+ DriftFileContent df = entityManager.find(DriftFileContent.class, driftFile.getHashId());
if (null == df) {
- throw new IllegalArgumentException("DriftFile not found: " + driftFile.getSha256());
+ throw new IllegalArgumentException("DriftFile not found: " + driftFile.getHashId());
}
df.setData(Hibernate.createBlob(new BufferedInputStream(data)));
df.setStatus(DriftFileStatus.LOADED);
@@ -350,6 +354,15 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
}
@Override
+ public PageList<Drift> findDriftsByCriteria(Subject subject, DriftCriteria criteria) {
+
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria);
+ CriteriaQueryRunner<Drift> queryRunner = new CriteriaQueryRunner<Drift>(criteria, generator, entityManager);
+ PageList<Drift> result = queryRunner.execute();
+ return result;
+ }
+
+ @Override
public DriftFile getDriftFile(Subject subject, String sha256) {
DriftFile result = entityManager.find(DriftFile.class, sha256);
return result;
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java
index f2421dc..708ef3b 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java
@@ -27,6 +27,8 @@ import javax.ejb.Local;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.criteria.DriftChangeSetCriteria;
+import org.rhq.core.domain.criteria.DriftCriteria;
+import org.rhq.core.domain.drift.Drift;
import org.rhq.core.domain.drift.DriftChangeSet;
import org.rhq.core.domain.drift.DriftConfiguration;
import org.rhq.core.domain.drift.DriftFile;
@@ -84,6 +86,14 @@ public interface DriftManagerLocal extends DriftManagerRemote {
PageList<DriftChangeSet> findDriftChangeSetsByCriteria(Subject subject, DriftChangeSetCriteria criteria);
/**
+ * Standard criteria based fetch method
+ * @param subject
+ * @param criteria
+ * @return The Drifts matching the criteria
+ */
+ PageList<Drift> findDriftsByCriteria(Subject subject, DriftCriteria criteria);
+
+ /**
* This method stores the provided change-set file for the resource. The version will be incremented based
* on the max version of existing change-sets for the resource. The change-set will be processed generating
* requests for drift file content and/or drift instances as required.
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftManagerBeanTest.java
index 6494d94..d75e1dc 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftManagerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftManagerBeanTest.java
@@ -143,8 +143,8 @@ public class DriftManagerBeanTest extends AbstractEJB3Test {
assertEquals(1, changeSet.getDrifts().size());
Drift drift = changeSet.getDrifts().iterator().next();
assertEquals("test/dir/filename.ext", drift.getPath());
- assertEquals("aaaaa", drift.getOldDriftFile().getSha256());
- assertEquals("bbbbb", drift.getNewDriftFile().getSha256());
+ assertEquals("aaaaa", drift.getOldDriftFile().getHashId());
+ assertEquals("bbbbb", drift.getNewDriftFile().getHashId());
assertEquals(DriftCategory.FILE_CHANGED, drift.getCategory());
driftFile = driftManager.getDriftFile(overlord, "bbbbb");
12 years, 11 months