modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml | 3
modules/core/domain/src/main/java/org/rhq/core/domain/drift/AbstractDriftFile.java | 91 +++++++++
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftFile.java | 53 -----
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftFileBits.java | 94 ++++++++++
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftFileContent.java | 72 -------
modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftFileTest.java | 26 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddConfigWizardInfoStep.java | 15 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java | 19 --
modules/pom.xml | 1
9 files changed, 224 insertions(+), 150 deletions(-)
New commits:
commit 78c19d59d26f9ff72a79d8ca8569cbfc35af2243
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Jun 30 16:05:29 2011 -0400
user changeset headers to set DriftChangeSet category
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 f7faf09..ae13557 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
@@ -135,7 +135,7 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
@Override
@TransactionAttribute(REQUIRES_NEW)
public void storeChangeSet(final int resourceId, File changeSetZip) throws Exception {
- Resource resource = entityManager.find(Resource.class, resourceId);
+ final Resource resource = entityManager.find(Resource.class, resourceId);
if (null == resource) {
throw new IllegalArgumentException("Resource not found [" + resourceId + "]");
}
@@ -145,24 +145,23 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
c.addFilterResourceId(resourceId);
List<DriftChangeSet> changeSets = findDriftChangeSetsByCriteria(subjectManager.getOverlord(), c);
final int version = changeSets.size();
- // TODO: set category 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, category);
- entityManager.persist(driftChangeSet);
ZipUtil.walkZipFile(changeSetZip, new ChangeSetFileVisitor() {
@Override
public boolean visit(ZipEntry zipEntry, ZipInputStream stream) throws Exception {
List<DriftFile> emptyDriftFiles = new ArrayList<DriftFile>();
+ DriftChangeSet driftChangeSet = null;
try {
ChangeSetReader reader = new ChangeSetReaderImpl(new BufferedReader(new InputStreamReader(
stream)));
+ // store the new change set info (not the actual blob)
+ DriftChangeSetCategory category = reader.getHeaders().getType();
+ driftChangeSet = new DriftChangeSet(resource, version, category);
+ entityManager.persist(driftChangeSet);
+
for (DirectoryEntry dir = reader.readDirectoryEntry(); null != dir; dir = reader
.readDirectoryEntry()) {
commit c3c2edad7b64e194115f75305efd03430287821e
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Jun 30 15:25:05 2011 -0400
add common/drift to 'agent' maven profile
diff --git a/modules/pom.xml b/modules/pom.xml
index ef5b009..dbd77a3 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -57,6 +57,7 @@
</activation>
<modules>
<module>core</module>
+ <module>common/drift</module>
<module>enterprise/comm</module>
<module>enterprise/agent</module>
<module>enterprise/agentupdate</module>
commit 37b5bca2cb2c86e2d709eb85b36b2c96def52e1a
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Jun 30 14:34:01 2011 -0400
Make DriftConfiguration.BaseDirectory abstract
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddConfigWizardInfoStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddConfigWizardInfoStep.java
index 8f5b750..d1cda75 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddConfigWizardInfoStep.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddConfigWizardInfoStep.java
@@ -34,9 +34,11 @@ import com.smartgwt.client.widgets.form.fields.events.ChangedEvent;
import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.configuration.definition.ConfigurationTemplate;
+import org.rhq.core.domain.drift.DriftConfiguration;
import org.rhq.core.domain.drift.DriftConfigurationDefinition;
+import org.rhq.core.domain.drift.DriftConfiguration.BaseDirectory;
+import org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext;
import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
import org.rhq.enterprise.gui.coregui.client.util.FormUtility;
import org.rhq.enterprise.gui.coregui.client.util.selenium.Locatable;
@@ -103,10 +105,13 @@ public class DriftAddConfigWizardInfoStep extends AbstractWizardStep {
// throw new IllegalStateException( "At least one drift configuration template should exist for the resource type" );
ConfigurationTemplate test = new ConfigurationTemplate("Test", "Test");
Configuration config = new Configuration();
- config.put(new PropertySimple("name", "Test"));
- config.put(new PropertySimple("basedir", "C:/workspace/rhq/dev-container/jbossas/server/default/conf"));
- config.put(new PropertySimple("interval", "6000"));
- test.setConfiguration(config);
+ DriftConfiguration driftConfig = new DriftConfiguration(config);
+ driftConfig
+ .setBasedir(new BaseDirectory(BaseDirValueContext.fileSystem,
+ "C:/workspace/rhq/dev-container/jbossas/server/default/deploy/rhq.ear/coregui.war/images/subsystems/content"));
+ driftConfig.setName("Test");
+ driftConfig.setInterval(6000L);
+ test.setConfiguration(driftConfig.getConfiguration());
test.setConfigurationDefinition(DriftConfigurationDefinition.getInstance());
templatesMap.put("TestOnly", test);
}
commit 6db86f01a579952b813725a0eaef09ac7bb21798
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Jun 30 14:33:05 2011 -0400
Refact DriftFile and DriftFileContent to use abstract mapped pojo
superclass.
- rename DriftFileContent to DriftFileBits for clarity and consistency
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 10369f7..96e86f2 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml
@@ -651,8 +651,7 @@
<!-- Content of a file being managed for drift. Used for diff and/or remediation -->
<table name="RHQ_DRIFT_FILE">
- <column name="HASH_ID" type="VARCHAR2" size="64" primarykey="true" required="true"/>
- <column name="DTYPE" type="VARCHAR2" required="true" size="10"/>
+ <column name="HASH_ID" type="VARCHAR2" size="64" primarykey="true" required="true"/>
<column name="CTIME" type="LONG" required="true"/>
<column name="DATA" type="LARGEOBJECT" required="false"/>
<column name="DATA_SIZE" type="LONG" required="false"/>
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/AbstractDriftFile.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/AbstractDriftFile.java
new file mode 100644
index 0000000..ad9584d
--- /dev/null
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/AbstractDriftFile.java
@@ -0,0 +1,91 @@
+/*
+ * 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.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.MappedSuperclass;
+import javax.persistence.PrePersist;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+
+/**
+ * A DriftFile represents one unique piece of content used for drift tracking. Because the bits are supported
+ * by java.sql.Blob and java.io streaming, we must hide the bits from entities used on the gwt client. This base
+ * class is used as the superclass for both DriftFile (no blob) and DriftFileBits (blob).
+ *
+ * @author Jay Shaughnessy
+ * @author John Mazzitelli
+ * @author John Sanda
+ */
+@MappedSuperclass
+(a)XmlAccessorType(XmlAccessType.FIELD)
+public class AbstractDriftFile implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @Column(name = "CTIME", nullable = false)
+ protected Long ctime = -1L;
+
+ @Column(name = "DATA_SIZE", nullable = true)
+ protected Long dataSize;
+
+ @Column(name = "STATUS", nullable = false)
+ @Enumerated(EnumType.STRING)
+ protected DriftFileStatus status = DriftFileStatus.EMPTY;
+
+ protected AbstractDriftFile() {
+ }
+
+ public Long getCtime() {
+ return ctime;
+ }
+
+ @PrePersist
+ void onPersist() {
+ this.ctime = System.currentTimeMillis();
+ }
+
+ public void setDataSize(Long dataSize) {
+ this.dataSize = dataSize;
+ }
+
+ public long getDataSize() {
+ return dataSize;
+ }
+
+ public void setDataSize(long size) {
+ dataSize = size;
+ }
+
+ public DriftFileStatus getStatus() {
+ return status;
+ }
+
+ public void setStatus(DriftFileStatus status) {
+ this.status = status;
+ }
+
+}
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 a52d957..148b2b5 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
@@ -25,28 +25,22 @@ package org.rhq.core.domain.drift;
import java.io.Serializable;
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.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.
+ * DriftFileBits class, which is like this one but adds the Blob field.
*
* @author Jay Shaughnessy
+ * @author John Mazzitelli
* @author John Sanda
*/
-@DiscriminatorColumn(name = "DTYPE")
-@DiscriminatorValue("no-content")
@Entity
@Table(name = "RHQ_DRIFT_FILE")
-public class DriftFile implements Serializable {
+public class DriftFile extends AbstractDriftFile implements Serializable {
private static final long serialVersionUID = 1L;
// this is a hash/digest that should uniquely identify the content
@@ -54,20 +48,12 @@ public class DriftFile implements Serializable {
@Column(name = "HASH_ID", nullable = false)
private String hashId;
- @Column(name = "CTIME", nullable = false)
- private Long ctime = -1L;
-
- @Column(name = "DATA_SIZE", nullable = true)
- private Long dataSize;
-
- @Column(name = "STATUS", nullable = false)
- @Enumerated(EnumType.STRING)
- private DriftFileStatus status = DriftFileStatus.EMPTY;
-
protected DriftFile() {
+ super();
}
public DriftFile(String hashId) {
+ super();
this.hashId = hashId;
}
@@ -79,35 +65,6 @@ public class DriftFile implements Serializable {
this.hashId = hashId;
}
- public Long getCtime() {
- return ctime;
- }
-
- @PrePersist
- void onPersist() {
- this.ctime = System.currentTimeMillis();
- }
-
- public void setDataSize(Long dataSize) {
- this.dataSize = dataSize;
- }
-
- public long getDataSize() {
- return dataSize;
- }
-
- public void setDataSize(long size) {
- dataSize = size;
- }
-
- public DriftFileStatus getStatus() {
- return status;
- }
-
- public void setStatus(DriftFileStatus status) {
- 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/DriftFileBits.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftFileBits.java
new file mode 100644
index 0000000..cb1e77c
--- /dev/null
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftFileBits.java
@@ -0,0 +1,94 @@
+/*
+ * 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.Entity;
+import javax.persistence.Id;
+import javax.persistence.Lob;
+import javax.persistence.Table;
+
+/**
+ * A DriftFile represents one unique piece of content used for drift tracking. Note that DriftFileBits provides
+ * access to the bits through java.sql.Blob. This entity can not be used client-side (gwt) whereas its sister class,
+ * DriftFile, can. Both enities share the same table and abstract superclass. See RHQDomain.gwt.xml for how to
+ * exclude unwanted domain classes from the gwt compile.
+ *
+ * @author Jay Shaughnessy
+ * @author John Mazzitelli
+ * @author John Sanda
+ */
+@Entity
+@Table(name = "RHQ_DRIFT_FILE")
+public class DriftFileBits extends AbstractDriftFile implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ // this is a hash/digest that should uniquely identify the content
+ @Id
+ @Column(name = "HASH_ID", nullable = false)
+ private String hashId;
+
+ protected DriftFileBits() {
+ super();
+ }
+
+ public DriftFileBits(String hashId) {
+ super();
+ this.hashId = hashId;
+ }
+
+ public String getHashId() {
+ return hashId;
+ }
+
+ public void setHashId(String hashId) {
+ this.hashId = hashId;
+ }
+
+ @Lob
+ @Column(name = "DATA", nullable = true)
+ private Blob data;
+
+ 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 "DriftFileContent [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
deleted file mode 100644
index f2c23d1..0000000
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftFileContent.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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/test/java/org/rhq/core/domain/drift/DriftFileTest.java b/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftFileTest.java
index 532da59..dad1a6d 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
@@ -49,7 +49,7 @@ public class DriftFileTest extends AbstractEJB3Test {
String hashId = digestGen.calcDigestString(content);
// Create the initial driftFile
- final DriftFileContent df1 = new DriftFileContent();
+ final DriftFileBits df1 = new DriftFileBits();
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() {
- DriftFileContent df2 = getEntityManager().find(DriftFileContent.class, df1.getHashId());
+ DriftFileBits df2 = getEntityManager().find(DriftFileBits.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 {
- DriftFileContent df3 = getEntityManager().find(DriftFileContent.class, df1.getHashId());
+ DriftFileBits df3 = getEntityManager().find(DriftFileBits.class, df1.getHashId());
String expected = newContent;
String actual = IOUtils.toString(df3.getData());
@@ -101,7 +101,7 @@ public class DriftFileTest extends AbstractEJB3Test {
for (int i = 0; i < numDriftFiles; ++i) {
File dataFile = createDataFile("test_data.txt", 10, (char) ('a' + i));
- final DriftFileContent driftFile = new DriftFileContent();
+ final DriftFileBits driftFile = new DriftFileBits();
driftFile.setDataSize(dataFile.length());
driftFile.setHashId(digestGen.calcDigestString(dataFile));
driftFile.setData(Hibernate.createBlob(new BufferedInputStream(new FileInputStream(dataFile))));
@@ -117,14 +117,14 @@ public class DriftFileTest extends AbstractEJB3Test {
}
final List<Blob> blobs = new ArrayList<Blob>();
- final List<DriftFile> driftFiles = new ArrayList<DriftFile>();
+ final List<DriftFileBits> driftFiles = new ArrayList<DriftFileBits>();
for (final String hashId : driftFileHashIds) {
executeInTransaction(new TransactionCallback() {
@Override
public void execute() {
- DriftFileContent driftFile = getEntityManager().find(DriftFileContent.class, hashId);
- blobs.add(driftFile.getBlob());
- driftFiles.add(driftFile);
+ DriftFileBits driftFileBits = getEntityManager().find(DriftFileBits.class, hashId);
+ blobs.add(driftFileBits.getBlob());
+ driftFiles.add(driftFileBits);
}
});
}
@@ -141,7 +141,7 @@ public class DriftFileTest extends AbstractEJB3Test {
for (int i = 0; i < numDriftFiles; ++i) {
File dataFile = createDataFile("test_data.txt", 10, 'X');
- final DriftFileContent driftFile = new DriftFileContent();
+ final DriftFileBits driftFile = new DriftFileBits();
final int driftFileNum = i;
driftFile.setDataSize(dataFile.length());
driftFile.setHashId(digestGen.calcDigestString(dataFile));
@@ -165,14 +165,14 @@ public class DriftFileTest extends AbstractEJB3Test {
}
final List<Blob> blobs = new ArrayList<Blob>();
- final List<DriftFile> driftFiles = new ArrayList<DriftFile>();
+ final List<DriftFileBits> driftFiles = new ArrayList<DriftFileBits>();
for (final String hashId : driftFileHashIds) {
executeInTransaction(new TransactionCallback() {
@Override
public void execute() {
- DriftFileContent driftFile = getEntityManager().find(DriftFileContent.class, hashId);
- blobs.add(driftFile.getBlob());
- driftFiles.add(driftFile);
+ DriftFileBits driftFileBits = getEntityManager().find(DriftFileBits.class, hashId);
+ blobs.add(driftFileBits.getBlob());
+ driftFiles.add(driftFileBits);
}
});
}
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 5725d89..f7faf09 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
@@ -66,7 +66,7 @@ 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.DriftFileBits;
import org.rhq.core.domain.drift.DriftFileStatus;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.util.PageList;
@@ -253,7 +253,7 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
@TransactionAttribute(REQUIRES_NEW)
public void persistDriftFileData(DriftFile driftFile, InputStream data) throws Exception {
- DriftFileContent df = entityManager.find(DriftFileContent.class, driftFile.getHashId());
+ DriftFileBits df = entityManager.find(DriftFileBits.class, driftFile.getHashId());
if (null == df) {
throw new IllegalArgumentException("DriftFile not found [" + driftFile.getHashId() + "]");
}