summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2014-05-08 18:18:41 +0200
committerSimon Rettberg2014-05-08 18:18:41 +0200
commit394b515f039e7f9c768fc6e5e394496b8c614d50 (patch)
treeeef94e7b39d23aa56f9d4467a1a52f8b46329f34
parentsome ToDos for me (diff)
downloadsatellite-daemon-394b515f039e7f9c768fc6e5e394496b8c614d50.tar.gz
satellite-daemon-394b515f039e7f9c768fc6e5e394496b8c614d50.tar.xz
satellite-daemon-394b515f039e7f9c768fc6e5e394496b8c614d50.zip
Implement getAllMarkedForUpload in DbImage class
-rw-r--r--src/main/java/org/openslx/satellitedaemon/db/DbImage.java22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/main/java/org/openslx/satellitedaemon/db/DbImage.java b/src/main/java/org/openslx/satellitedaemon/db/DbImage.java
index 9004d6a..9298a54 100644
--- a/src/main/java/org/openslx/satellitedaemon/db/DbImage.java
+++ b/src/main/java/org/openslx/satellitedaemon/db/DbImage.java
@@ -1,6 +1,5 @@
package org.openslx.satellitedaemon.db;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -9,6 +8,19 @@ import java.util.List;
*/
public class DbImage
{
+
+ public final String guid;
+ public final int rid;
+ public final String path;
+ public final String creator;
+
+ public DbImage(String guid, int rid, String path, String creator)
+ {
+ this.guid = guid;
+ this.rid = rid;
+ this.path = path;
+ this.creator = creator;
+ }
/**
* Returns a list of all images on this satellite that should be
@@ -19,8 +31,12 @@ public class DbImage
*/
public static List<DbImage> getAllMarkedForUpload()
{
- // TODO: Implement
- return new ArrayList<>();
+ return MySQL.findAll( DbImage.class, "SELECT image.GUID_imageID, image.imageVersion, image.image_path," +
+ " Concat(user.loginName, '@', institution.name, '.de') AS userID" + // HACK: .de required for now
+ " FROM m_VLData_imageInfo image" +
+ " INNER JOIN m_user user ON (image.image_owner = user.userID)" +
+ " INNER JOIN m_institution institution ON (institution.institutionID = user.institution)" +
+ " WHERE status_isReady <> 0" );
}
}