summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/satellitedaemon/db/DbImage.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/openslx/satellitedaemon/db/DbImage.java')
-rw-r--r--src/main/java/org/openslx/satellitedaemon/db/DbImage.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main/java/org/openslx/satellitedaemon/db/DbImage.java b/src/main/java/org/openslx/satellitedaemon/db/DbImage.java
index 10438f8..a7dcbc3 100644
--- a/src/main/java/org/openslx/satellitedaemon/db/DbImage.java
+++ b/src/main/java/org/openslx/satellitedaemon/db/DbImage.java
@@ -52,6 +52,14 @@ public class DbImage
" WHERE image_syncMode = 'to_be_published'" );
}
+ /**
+ * Returns a list of all images on this satellite that should be
+ * downloaded from the central server.
+ *
+ * @return list of images that are marked for download, where the download
+ * was either not started yet, or is incomplete
+ */
+
public static List<DbImage> getAllMarkedForDownload()
{
return MySQL.findAll( DbImage.class, "SELECT image.GUID_imageID, image.image_name, image.imageVersion, image.image_path," +
@@ -62,11 +70,22 @@ public class DbImage
" WHERE image_syncMode = 'to_be_decentralized'" );
}
+ /**
+ * Method for updating the status of an Image in the db. For example after a succesfull upload.
+ *
+ * @param status : possible statuses are : "only_local, to_be_published, being_published,
+ * successfully_published, to_be_decentralized, being_decentralized, successfully_decentralized"
+ */
public void updateStatus( Status status )
{
MySQL.update( "UPDATE m_VLData_imageInfo SET image_syncMode=? WHERE GUID_imageID=?", status.toString(), this.guid);
}
+ /**
+ * Method for updating the size of an Image in the db.
+ *
+ * @param filesize is the size of the file
+ */
public void updateFilesize( long filesize )
{
MySQL.update( "UPDATE m_VLData_imageInfo SET image_filesize=? WHERE GUID_imageID=?", filesize, this.guid );