Class ArcRepositoryEntry
- java.lang.Object
-
- dk.netarkivet.archive.arcrepositoryadmin.ArcRepositoryEntry
-
public class ArcRepositoryEntry extends Object
This class contains the information that we keep about each file in the arcrepository: Checksum and the store states for all bitarchives.TODO Maybe don't have the store state info for fully completed stores, or else use a slimmer map for it.
-
-
Constructor Summary
Constructors Constructor Description ArcRepositoryEntry(String filename, String md5sum, StoreMessage replyInfo)
Create a new entry with given checksum and replyinfo.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getChecksum()
Get the checksum for this entry.ArchiveStoreState
getGeneralStoreState()
Get the ArchiveStoreState for the entry in general.ReplicaStoreState
getStoreState(String baId)
Get the StoreState for this entry for a given bitarchive or null if none.
-
-
-
Constructor Detail
-
ArcRepositoryEntry
public ArcRepositoryEntry(String filename, String md5sum, StoreMessage replyInfo)
Create a new entry with given checksum and replyinfo.- Parameters:
filename
- The filename for this entrymd5sum
- The checksum for this entryreplyInfo
- The one-use-only reply info chunk
-
-
Method Detail
-
getGeneralStoreState
public ArchiveStoreState getGeneralStoreState()
Get the ArchiveStoreState for the entry in general. This is computed from the ArchiveStoreStates for the bitarchives.
1. If no information about the bitarchives are available, the state UPLOAD_FAILED with timestamp=NOW is returned
2. If there are information about one bitarchive, the state of this bitarchive is returned.
3. If there are information from more than one bitarchive, A. if the state of one of the bitarchives equals UPLOAD_FAILED, the state UPLOAD_FAILED with the latest timestamp is returned B. else, find the lowest state of the N bitarchives: return this state together with the the latest timestampNote that the storestate and the timestamp might not come from the same bitarchive.
- Returns:
- the current ArchiveStoreState for the entry in general
-
getStoreState
public ReplicaStoreState getStoreState(String baId)
Get the StoreState for this entry for a given bitarchive or null if none.- Parameters:
baId
- a bitarchive id- Returns:
- the StoreState for a given bitarchive.
-
getChecksum
public String getChecksum()
Get the checksum for this entry.- Returns:
- the stored checksum for this entry
-
-