mirror of https://github.com/micromata/borgbackup-butler.git

Kai Reinhard
04.58.2019 6ff74e6e78e27fbcb751dcf20c9e61dafb78caed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package de.micromata.borgbutler.json.borg;
 
import lombok.Getter;
import lombok.Setter;
 
/**
 * Output of borg option <tt>--progress</tt>.
 * See https://borgbackup.readthedocs.io/en/stable/internals/frontends.html,
 */
public class ProgressMessage {
    // {"message": "Calculating statistics...   0%", "current": 1, "total": 2497, "info": null, "operation": 1, "msgid": null, "type": "progress_percent", "finished": false, "time": 1546640510.116256}
    /**
     * e. g. Calculating statistics...   5%
     */
    @Getter
    @Setter
    private String message;
    /**
     * Current counter of total.
     */
    @Getter
    @Setter
    private long current;
    @Getter
    private long total;
    /**
     * Array that describes the current item, may be null, contents depend on msgid.
     */
    @Getter
    private String[] info;
    /**
     * unique, opaque integer ID of the operation.
     */
    @Getter
    private int operation;
    @Getter
    private int msgid;
    /**
     * e. g. progress_percent
     */
    @Getter
    private String type;
    @Getter
    private boolean finished;
    /**
     * Unix timestamp (float).
     */
    @Getter
    private double time;
 
    public ProgressMessage incrementCurrent() {
        ++current;
        return this;
    }
}