summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/imagemaster/serverconnection/ImageInfos.java
diff options
context:
space:
mode:
authorNils Schwabe2014-06-30 17:11:03 +0200
committerNils Schwabe2014-06-30 17:11:03 +0200
commit1a3dbab6ca7118f4ca9f61043f416f074ede13bc (patch)
treefad14555be544c3ba2afdf31b8f315364a67e7a6 /src/main/java/org/openslx/imagemaster/serverconnection/ImageInfos.java
parent[Webinterface] Add "images" tab (diff)
downloadmasterserver-1a3dbab6ca7118f4ca9f61043f416f074ede13bc.tar.gz
masterserver-1a3dbab6ca7118f4ca9f61043f416f074ede13bc.tar.xz
masterserver-1a3dbab6ca7118f4ca9f61043f416f074ede13bc.zip
Add implementation for the new up- and download protocoll
Remove some old stuff that is not needed anymore Fix some small bugs
Diffstat (limited to 'src/main/java/org/openslx/imagemaster/serverconnection/ImageInfos.java')
-rw-r--r--src/main/java/org/openslx/imagemaster/serverconnection/ImageInfos.java73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/main/java/org/openslx/imagemaster/serverconnection/ImageInfos.java b/src/main/java/org/openslx/imagemaster/serverconnection/ImageInfos.java
new file mode 100644
index 0000000..1e84978
--- /dev/null
+++ b/src/main/java/org/openslx/imagemaster/serverconnection/ImageInfos.java
@@ -0,0 +1,73 @@
+package org.openslx.imagemaster.serverconnection;
+
+import java.sql.Timestamp;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Helper class for ImageProcessor to save some infos about the images in the process list.
+ */
+public class ImageInfos
+{
+ /**
+ * Token for the satellite.
+ */
+ private String token;
+ /**
+ * The missing blocks that need to be uploaded by the satellite.
+ */
+ private List<Integer> missingBlocks;
+ /**
+ * The list of blocks that the satellite received last.
+ * (This could be used to tell the CRCChecker to check these blocks.
+ */
+ private List<Integer> lastSentBlocks = new LinkedList<>();
+ private String serverSessionId;
+ private Timestamp ts; // when did the server something for the last time
+
+ protected ImageInfos(String token, List<Integer> missingBlocks, String serverSessionId, Timestamp ts)
+ {
+ this.token = token;
+ this.missingBlocks = missingBlocks;
+ this.serverSessionId = serverSessionId;
+ this.ts = ts;
+ }
+
+ protected void removeBlock( int number )
+ {
+ this.missingBlocks.remove( number );
+ }
+
+ protected void removeBlocks( Collection<Integer> list )
+ {
+ this.missingBlocks.removeAll( list );
+ }
+
+ protected void setLastSentBlocks(List<Integer> list) {
+ this.lastSentBlocks = list;
+ }
+
+ protected List<Integer> getLastSentBlocks() {
+ return this.lastSentBlocks;
+ }
+
+ protected String getToken()
+ {
+ return this.token;
+ }
+
+ protected List<Integer> getMissingBlocks()
+ {
+ return this.missingBlocks;
+ }
+
+ protected String getServerSessionId()
+ {
+ return this.serverSessionId;
+ }
+
+ protected Timestamp getTimestamp() {
+ return this.ts;
+ }
+}