summaryrefslogtreecommitdiffstats
path: root/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/OutgoingDataTransfer.java
diff options
context:
space:
mode:
authorSimon Rettberg2019-10-21 16:59:32 +0200
committerSimon Rettberg2019-10-21 17:08:16 +0200
commit535fc19e824abfe170b6fe03792519cb6e1105eb (patch)
treed6a5e7801eba3421f5f1bc40dcb17eabdb732ab3 /dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/OutgoingDataTransfer.java
parent[client] Update virtualizer download link (diff)
downloadtutor-module-535fc19e824abfe170b6fe03792519cb6e1105eb.tar.gz
tutor-module-535fc19e824abfe170b6fe03792519cb6e1105eb.tar.xz
tutor-module-535fc19e824abfe170b6fe03792519cb6e1105eb.zip
[server] Disallow deleting busy images, fix multiple clones from master
Deleting images that are currently being up- or downloaded would create some confusion server-side, so disallow this. We accidentally didn't use the image version id as the transfer id for downloads from the master server; fix that so that triggering the download of the same image multiple times won't actually download the same image multiple times. Closes #3651
Diffstat (limited to 'dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/OutgoingDataTransfer.java')
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/OutgoingDataTransfer.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/OutgoingDataTransfer.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/OutgoingDataTransfer.java
index 6ef4d4a6..37510270 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/OutgoingDataTransfer.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/OutgoingDataTransfer.java
@@ -20,6 +20,8 @@ public class OutgoingDataTransfer extends OutgoingTransferBase {
private static final Logger LOGGER = Logger.getLogger(OutgoingDataTransfer.class);
private final TransferInformation masterTransferInfo;
+
+ private final String versionId;
/**
* For downloads by clients.
@@ -27,9 +29,10 @@ public class OutgoingDataTransfer extends OutgoingTransferBase {
* @param uuid UUID of this transfer
* @param file file to send to client
*/
- public OutgoingDataTransfer(String uuid, File file, int plainPort, int sslPort) {
+ public OutgoingDataTransfer(String uuid, File file, int plainPort, int sslPort, String versionId) {
super(uuid, file, plainPort, sslPort);
this.masterTransferInfo = null;
+ this.versionId = versionId;
}
/**
@@ -39,9 +42,10 @@ public class OutgoingDataTransfer extends OutgoingTransferBase {
* upload
* @param absFile file to send to master server
*/
- public OutgoingDataTransfer(TransferInformation transferInfo, File absFile) {
+ public OutgoingDataTransfer(TransferInformation transferInfo, File absFile, String versionId) {
super(transferInfo.token, absFile, 0, 0);
this.masterTransferInfo = transferInfo;
+ this.versionId = versionId;
}
/**
@@ -99,4 +103,8 @@ public class OutgoingDataTransfer extends OutgoingTransferBase {
throw new RuntimeException("Not implemented");
}
+ public Object getVersionId() {
+ return versionId;
+ }
+
}