From dabd31a107bb8818596002b4edf12477ac241d61 Mon Sep 17 00:00:00 2001 From: Michael Petretti Date: Wed, 27 Aug 2014 16:10:08 +0200 Subject: Added comments for better documentation. --- .../java/org/openslx/satellitedaemon/db/DbImage.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/main/java/org/openslx/satellitedaemon/db/DbImage.java') 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 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 ); -- cgit v1.2.3-55-g7522