blob: 1e8497859e8b52357dd56cdd786afebf6ecf0097 (
plain) (
blame)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
package org.openslx.imagemaster.serverconnection;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
/**
* Helper class for ImageProcessor to save some infos about the images in the process list.
*/
public class ImageInfos
{
/**
* Token for the satellite.
*/
private String token;
/**
* The missing blocks that need to be uploaded by the satellite.
*/
private List<Integer> missingBlocks;
/**
* The list of blocks that the satellite received last.
* (This could be used to tell the CRCChecker to check these blocks.
*/
private List<Integer> lastSentBlocks = new LinkedList<>();
private String serverSessionId;
private Timestamp ts; // when did the server something for the last time
protected ImageInfos(String token, List<Integer> missingBlocks, String serverSessionId, Timestamp ts)
{
this.token = token;
this.missingBlocks = missingBlocks;
this.serverSessionId = serverSessionId;
this.ts = ts;
}
protected void removeBlock( int number )
{
this.missingBlocks.remove( number );
}
protected void removeBlocks( Collection<Integer> list )
{
this.missingBlocks.removeAll( list );
}
protected void setLastSentBlocks(List<Integer> list) {
this.lastSentBlocks = list;
}
protected List<Integer> getLastSentBlocks() {
return this.lastSentBlocks;
}
protected String getToken()
{
return this.token;
}
protected List<Integer> getMissingBlocks()
{
return this.missingBlocks;
}
protected String getServerSessionId()
{
return this.serverSessionId;
}
protected Timestamp getTimestamp() {
return this.ts;
}
}
|