Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package org.zstack.header.image;

import org.zstack.header.log.NoLogging;
import org.zstack.header.message.NeedReplyMessage;
import org.zstack.header.storage.backup.BackupStorageMessage;

public class UploadFileToBackupStorageHostMsg extends NeedReplyMessage implements BackupStorageMessage {
private String backupStorageUuid;
private String taskUuid;
@NoLogging(type = NoLogging.Type.Uri)
private String url;
private String installPath;

@Override
public String getBackupStorageUuid() {
return backupStorageUuid;
}

public void setBackupStorageUuid(String backupStorageUuid) {
this.backupStorageUuid = backupStorageUuid;
}

public String getTaskUuid() {
return taskUuid;
}

public void setTaskUuid(String taskUuid) {
this.taskUuid = taskUuid;
}

public String getUrl() {
return url;
}

public void setUrl(String url) {
this.url = url;
}

public String getInstallPath() {
return installPath;
}

public void setInstallPath(String installPath) {
this.installPath = installPath;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package org.zstack.header.image;

import org.zstack.header.log.NoLogging;
import org.zstack.header.message.MessageReply;

public class UploadFileToBackupStorageHostReply extends MessageReply {
private String md5sum;
private long size;
@NoLogging(type = NoLogging.Type.Uri)
private String directUploadUrl;

public String getMd5sum() {
return md5sum;
}

public void setMd5sum(String md5sum) {
this.md5sum = md5sum;
}

public long getSize() {
return size;
}

public void setSize(long size) {
this.size = size;
}

public String getDirectUploadUrl() {
return directUploadUrl;
}

public void setDirectUploadUrl(String directUploadUrl) {
this.directUploadUrl = directUploadUrl;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package org.zstack.header.storage.backup;

import org.zstack.header.message.NeedReplyMessage;

public class GetFileDownloadProgressMsg extends NeedReplyMessage implements BackupStorageMessage {
private String backupStorageUuid;
private String taskUuid;
private String hostname;

@Override
public String getBackupStorageUuid() {
return backupStorageUuid;
}

public void setBackupStorageUuid(String backupStorageUuid) {
this.backupStorageUuid = backupStorageUuid;
}

public String getTaskUuid() {
return taskUuid;
}

public void setTaskUuid(String taskUuid) {
this.taskUuid = taskUuid;
}

public String getHostname() {
return hostname;
}

public void setHostname(String hostname) {
this.hostname = hostname;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
package org.zstack.header.storage.backup;

import org.zstack.header.message.MessageReply;

public class GetFileDownloadProgressReply extends MessageReply {
private boolean completed;
private int progress;

private long size;
private long actualSize;
private long downloadSize;
private String installPath;
private String format;
private long lastOpTime;
private boolean supportSuspend;
Comment on lines +5 to +15
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

缺少 md5sum 字段。

CephBackupStorageBase.java 第 2171 行调用了 reply.setMd5sum(rsp.md5sum),但此类未定义 md5sum 字段,会导致编译错误。

🔎 建议添加 md5sum 字段
 public class GetFileDownloadProgressReply extends MessageReply {
     private boolean completed;
     private int progress;
 
     private long size;
     private long actualSize;
     private long downloadSize;
     private String installPath;
     private String format;
     private long lastOpTime;
     private boolean supportSuspend;
+    private String md5sum;
+
+    public String getMd5sum() {
+        return md5sum;
+    }
+
+    public void setMd5sum(String md5sum) {
+        this.md5sum = md5sum;
+    }
🤖 Prompt for AI Agents
In
header/src/main/java/org/zstack/header/storage/backup/GetFileDownloadProgressReply.java
around lines 5 to 15, the class is missing the md5sum field referenced by
CephBackupStorageBase at line 2171; add a private String md5sum field and
provide its public getter and setter (getMd5sum and setMd5sum) so the
reply.setMd5sum(...) call compiles correctly and follows existing Java bean
style used in this class.


public boolean isCompleted() {
return completed;
}

public void setCompleted(boolean completed) {
this.completed = completed;
}

public int getProgress() {
return progress;
}

public void setProgress(int progress) {
this.progress = progress;
}

public long getSize() {
return size;
}

public void setSize(long size) {
this.size = size;
}

public long getActualSize() {
return actualSize;
}

public void setActualSize(long actualSize) {
this.actualSize = actualSize;
}

public boolean isDownloadComplete() {
return actualSize > 0 && actualSize == downloadSize;
}

public String getInstallPath() {
return installPath;
}

public void setInstallPath(String installPath) {
this.installPath = installPath;
}

public String getFormat() {
return format;
}

public void setFormat(String format) {
this.format = format;
}

public long getLastOpTime() {
return lastOpTime;
}

public void setLastOpTime(long lastOpTime) {
this.lastOpTime = lastOpTime;
}

public long getDownloadSize() {
return downloadSize;
}

public void setDownloadSize(long downloadSize) {
this.downloadSize = downloadSize;
}

public boolean isSupportSuspend() {
return supportSuspend;
}

public void setSupportSuspend(boolean supportSuspend) {
this.supportSuspend = supportSuspend;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.zstack.header.volume;


import org.springframework.http.HttpMethod;
import org.zstack.header.configuration.DiskOfferingVO;
import org.zstack.header.message.*;
Expand Down
Loading