|
| 1 | +package org.zstack.header.core.progress; |
| 2 | + |
| 3 | +import java.util.Map; |
| 4 | + |
| 5 | +/** |
| 6 | + * Standardized LongJob progress detail, parsed from TaskProgressVO.opaque. |
| 7 | + * |
| 8 | + * All fields are optional (nullable). Callers should null-check before use. |
| 9 | + * This is a pure read-only view — the database schema (TaskProgressVO) is unchanged. |
| 10 | + */ |
| 11 | +public class LongJobProgressDetail { |
| 12 | + /** Progress percentage 0-100, if known. */ |
| 13 | + private Integer percent; |
| 14 | + |
| 15 | + /** Human-readable stage label, e.g. "downloading", "extracting". */ |
| 16 | + private String stage; |
| 17 | + |
| 18 | + /** State identifier, e.g. "running", "paused". */ |
| 19 | + private String state; |
| 20 | + |
| 21 | + /** Human-readable reason for current state. */ |
| 22 | + private String stateReason; |
| 23 | + |
| 24 | + /** Bytes already processed. */ |
| 25 | + private Long processedBytes; |
| 26 | + |
| 27 | + /** Total bytes to process. */ |
| 28 | + private Long totalBytes; |
| 29 | + |
| 30 | + /** Items already processed (e.g. files, chunks). */ |
| 31 | + private Long processedItems; |
| 32 | + |
| 33 | + /** Total items to process. */ |
| 34 | + private Long totalItems; |
| 35 | + |
| 36 | + /** Transfer speed in bytes/s. */ |
| 37 | + private Long speedBytesPerSecond; |
| 38 | + |
| 39 | + /** Estimated remaining time in seconds. */ |
| 40 | + private Long estimatedRemainingSeconds; |
| 41 | + |
| 42 | + /** |
| 43 | + * Catch-all for any opaque fields that don't map to the standard schema. |
| 44 | + * Preserves unknown keys so no data is silently dropped. |
| 45 | + */ |
| 46 | + private Map<String, Object> extra; |
| 47 | + |
| 48 | + public Integer getPercent() { |
| 49 | + return percent; |
| 50 | + } |
| 51 | + |
| 52 | + public void setPercent(Integer percent) { |
| 53 | + this.percent = percent; |
| 54 | + } |
| 55 | + |
| 56 | + public String getStage() { |
| 57 | + return stage; |
| 58 | + } |
| 59 | + |
| 60 | + public void setStage(String stage) { |
| 61 | + this.stage = stage; |
| 62 | + } |
| 63 | + |
| 64 | + public String getState() { |
| 65 | + return state; |
| 66 | + } |
| 67 | + |
| 68 | + public void setState(String state) { |
| 69 | + this.state = state; |
| 70 | + } |
| 71 | + |
| 72 | + public String getStateReason() { |
| 73 | + return stateReason; |
| 74 | + } |
| 75 | + |
| 76 | + public void setStateReason(String stateReason) { |
| 77 | + this.stateReason = stateReason; |
| 78 | + } |
| 79 | + |
| 80 | + public Long getProcessedBytes() { |
| 81 | + return processedBytes; |
| 82 | + } |
| 83 | + |
| 84 | + public void setProcessedBytes(Long processedBytes) { |
| 85 | + this.processedBytes = processedBytes; |
| 86 | + } |
| 87 | + |
| 88 | + public Long getTotalBytes() { |
| 89 | + return totalBytes; |
| 90 | + } |
| 91 | + |
| 92 | + public void setTotalBytes(Long totalBytes) { |
| 93 | + this.totalBytes = totalBytes; |
| 94 | + } |
| 95 | + |
| 96 | + public Long getProcessedItems() { |
| 97 | + return processedItems; |
| 98 | + } |
| 99 | + |
| 100 | + public void setProcessedItems(Long processedItems) { |
| 101 | + this.processedItems = processedItems; |
| 102 | + } |
| 103 | + |
| 104 | + public Long getTotalItems() { |
| 105 | + return totalItems; |
| 106 | + } |
| 107 | + |
| 108 | + public void setTotalItems(Long totalItems) { |
| 109 | + this.totalItems = totalItems; |
| 110 | + } |
| 111 | + |
| 112 | + public Long getSpeedBytesPerSecond() { |
| 113 | + return speedBytesPerSecond; |
| 114 | + } |
| 115 | + |
| 116 | + public void setSpeedBytesPerSecond(Long speedBytesPerSecond) { |
| 117 | + this.speedBytesPerSecond = speedBytesPerSecond; |
| 118 | + } |
| 119 | + |
| 120 | + public Long getEstimatedRemainingSeconds() { |
| 121 | + return estimatedRemainingSeconds; |
| 122 | + } |
| 123 | + |
| 124 | + public void setEstimatedRemainingSeconds(Long estimatedRemainingSeconds) { |
| 125 | + this.estimatedRemainingSeconds = estimatedRemainingSeconds; |
| 126 | + } |
| 127 | + |
| 128 | + public Map<String, Object> getExtra() { |
| 129 | + return extra; |
| 130 | + } |
| 131 | + |
| 132 | + public void setExtra(Map<String, Object> extra) { |
| 133 | + this.extra = extra; |
| 134 | + } |
| 135 | +} |
0 commit comments