summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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" );
}
}