|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.archive.arcrepository.bitpreservation.FilePreservationState
public class FilePreservationState
This class collects the available bit preservation information for a file.
This information is the following:
1) admin information for the file for each replica and
2) the actual upload status
Constructor Summary | |
---|---|
FilePreservationState(java.lang.String filename,
ArcRepositoryEntry admindata,
java.util.Map<Replica,java.util.List<java.lang.String>> checksumMap)
Create new instance of the preservation status for a file. |
Method Summary | |
---|---|
boolean |
fileIsMissing(Replica replica)
Check if the file is missing from a replica. |
java.lang.String |
getAdminChecksum()
Get the MD5 checksum stored in the admin data. |
java.lang.String |
getAdminReplicaState(Replica replica)
Get the status of the file in a replica, according to the admin data. |
java.lang.String |
getFilename()
Get the filename, this FilePreservationState is about. |
Replica |
getReferenceBitarchive()
Returns a reference to a bitarchive replica that contains a version of the file with the correct checksum. |
java.lang.String |
getReferenceCheckSum()
Retrieve checksum that the majority of checksum references (replicas+admin) agree upon. |
java.util.List<java.lang.String> |
getReplicaChecksum(Replica replica)
Get the checksum of this file in a specific replica. |
java.lang.String |
getUniqueChecksum(Replica r)
Get a checksum that the whole replica agrees upon, or else "". |
boolean |
isAdminCheckSumOk()
Returns true if the checksum reported by admin data is equal to the majority checksum. |
boolean |
isAdminDataOk()
Check if the admin data reflect the actual status of the archive. |
java.lang.String |
toString()
Returns a human-readable representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
FilePreservationState(java.lang.String filename, ArcRepositoryEntry admindata, java.util.Map<Replica,java.util.List<java.lang.String>> checksumMap) throws ArgumentNotValid
filename
- The filename to get status foradmindata
- The admin data for the filechecksumMap
- The map with the checksums for this file in
all replicas
ArgumentNotValid
- if filename is null or empty string,
or if admindata is null.Method Detail |
---|
public java.util.List<java.lang.String> getReplicaChecksum(Replica replica)
getReplicaChecksum
in interface PreservationState
replica
- The replica to get the checksum from.
public java.lang.String getAdminChecksum()
getAdminChecksum
in interface PreservationState
public java.lang.String getAdminReplicaState(Replica replica)
getAdminReplicaState
in interface PreservationState
replica
- The replica to get status for
public boolean isAdminDataOk()
isAdminDataOk
in interface PreservationState
public boolean fileIsMissing(Replica replica)
fileIsMissing
in interface PreservationState
replica
- the replica to check.
public Replica getReferenceBitarchive()
getReferenceBitarchive
in interface PreservationState
public java.lang.String getUniqueChecksum(Replica r)
getUniqueChecksum
in interface PreservationState
r
- A replica to get checksum for this file from
public java.lang.String getReferenceCheckSum()
getReferenceCheckSum
in interface PreservationState
public boolean isAdminCheckSumOk()
isAdminCheckSumOk
in interface PreservationState
public java.lang.String toString()
toString
in interface PreservationState
toString
in class java.lang.Object
public java.lang.String getFilename()
getFilename
in interface PreservationState
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |