|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.archive.arcrepository.bitpreservation.DatabasePreservationState
public class DatabasePreservationState
This class contains the preservation data based on the database data of a given filename. Contains the ReplicaFileInfos corresponding to the file.
Constructor Summary | |
---|---|
DatabasePreservationState(java.lang.String fileName,
java.util.List<ReplicaFileInfo> rfis)
Constructor. |
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 replica that contains a version of the file with the correct checksum. |
java.lang.String |
getReferenceCheckSum()
THIS IS VOTING! Retrieve checksum that the majority of checksum references replicas 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 replica)
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()
INHERITED DUMMY FUNCTION! |
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 |
---|
public DatabasePreservationState(java.lang.String fileName, java.util.List<ReplicaFileInfo> rfis) throws ArgumentNotValid
fileName
- The name of the file.rfis
- A list of the ReplicaFileInfo entries in the database for
the given file.
ArgumentNotValid
- If the filename is null or the empty string, or
if the list of ReplicaFileInfos are null or empty.Method Detail |
---|
public java.util.List<java.lang.String> getReplicaChecksum(Replica replica) throws ArgumentNotValid
getReplicaChecksum
in interface PreservationState
replica
- The replica to get the checksum from.
ArgumentNotValid
- If the replica is null.public java.lang.String getAdminChecksum()
getAdminChecksum
in interface PreservationState
public java.lang.String getAdminReplicaState(Replica replica) throws ArgumentNotValid
getAdminReplicaState
in interface PreservationState
replica
- The replica to get status for
ArgumentNotValid
- If the replica is null.public boolean isAdminDataOk()
isAdminDataOk
in interface PreservationState
public Replica getReferenceBitarchive()
getReferenceBitarchive
in interface PreservationState
public java.lang.String getUniqueChecksum(Replica replica) throws ArgumentNotValid
getUniqueChecksum
in interface PreservationState
replica
- A replica to get checksum for this file from
ArgumentNotValid
- If the replica is null.public boolean fileIsMissing(Replica replica) throws ArgumentNotValid
fileIsMissing
in interface PreservationState
replica
- the replica to check
ArgumentNotValid
- If the replica is null.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 |