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 UploadingImageInfos { /** * Token for the satellite. */ private String token; /** * The missing blocks that need to be uploaded by the satellite. */ private List missingBlocks; /** * The list of blocks that the satellite received last. * (This could be used to tell the CRCChecker to check these blocks. */ private List lastSentBlocks = new LinkedList<>(); private String serverSessionId; private Timestamp ts; // when did the server something for the last time protected UploadingImageInfos(String token, List 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 list ) { this.missingBlocks.removeAll( list ); } protected void setLastSentBlocks(List list) { this.lastSentBlocks = list; } protected List getLastSentBlocks() { return this.lastSentBlocks; } protected String getToken() { return this.token; } protected List getMissingBlocks() { return this.missingBlocks; } protected String getServerSessionId() { return this.serverSessionId; } protected Timestamp getTimestamp() { return this.ts; } }