diff options
| author | Nils Schwabe | 2014-07-10 17:00:52 +0200 |
|---|---|---|
| committer | Nils Schwabe | 2014-07-10 17:00:52 +0200 |
| commit | 43bbdb3808f8c78f76e17a7ecc0dea9c9cad6541 (patch) | |
| tree | c70d72697df5e952b2951c545deb9d6dfaec9bdb /src/main/java/org/openslx/imagemaster/serverconnection/DownloadingClient.java | |
| parent | Add refreshing of server session (diff) | |
| download | masterserver-43bbdb3808f8c78f76e17a7ecc0dea9c9cad6541.tar.gz masterserver-43bbdb3808f8c78f76e17a7ecc0dea9c9cad6541.tar.xz masterserver-43bbdb3808f8c78f76e17a7ecc0dea9c9cad6541.zip | |
Start to implement download functionallity
Diffstat (limited to 'src/main/java/org/openslx/imagemaster/serverconnection/DownloadingClient.java')
| -rw-r--r-- | src/main/java/org/openslx/imagemaster/serverconnection/DownloadingClient.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/org/openslx/imagemaster/serverconnection/DownloadingClient.java b/src/main/java/org/openslx/imagemaster/serverconnection/DownloadingClient.java index 0acfa42..5754a6b 100644 --- a/src/main/java/org/openslx/imagemaster/serverconnection/DownloadingClient.java +++ b/src/main/java/org/openslx/imagemaster/serverconnection/DownloadingClient.java @@ -2,6 +2,7 @@ package org.openslx.imagemaster.serverconnection; import java.util.HashMap; import java.util.List; +import java.util.Map; /** * Helper class for the ImageProcessor to know some things about the downloading client @@ -10,7 +11,7 @@ import java.util.List; public class DownloadingClient { - public final HashMap<String, ImageInfos> downloadingImages = new HashMap<>(); + private final HashMap<String, ImageInfos> downloadingImages = new HashMap<>(); DownloadingClient() { @@ -36,11 +37,12 @@ public class DownloadingClient return (downloadingImages.size() > 0); } - public List<Integer> getLastRequestedBlocks( String uuid ) + public List<Integer> getLastRequestedBlocks( String token ) { - if ( !downloadingImages.containsKey( uuid ) ) - return null; - return downloadingImages.get( uuid ).lastRequestedBlocks; + for (Map.Entry<String, ImageInfos> entry : downloadingImages.entrySet() ) { + if (entry.getValue().token.equals( token )) return entry.getValue().lastRequestedBlocks; + } + return null; } public void requestBlocks( String uuid, List<Integer> list ) @@ -59,7 +61,6 @@ public class DownloadingClient class ImageInfos { - public final String uuid; public final String token; private List<Integer> lastRequestedBlocks; |
