|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.netarkivet.archive.arcrepository.bitpreservation.ReplicaCacheDatabase
public class ReplicaCacheDatabase
Method for storing the bitpreservation cache in a database. This method uses the 'admin.data' file for retrieving the upload status.
Field Summary | |
---|---|
(package private) java.sql.Connection |
dbConnection
The connection to the database. |
protected static org.apache.commons.logging.Log |
log
The log. |
Method Summary | |
---|---|
void |
addChecksumInformation(java.util.List<ChecksumEntry> checksumOutput,
Replica replica)
Given the output of a checksum job, add the results to the database. |
void |
addFileListInformation(java.util.List<java.lang.String> filelist,
Replica replica)
Method for adding the results from a list of filenames on a replica. |
void |
cleanup()
Method for cleaning up when done. |
Replica |
getBitarchiveWithGoodFile(java.lang.String filename)
Method for finding a replica with a valid version of a file. |
Replica |
getBitarchiveWithGoodFile(java.lang.String filename,
Replica badReplica)
Method for finding a replica with a valid version of a file. |
java.sql.Date |
getDateOfLastMissingFilesUpdate(Replica replica)
Get the date for the last file list job. |
java.sql.Date |
getDateOfLastWrongFilesUpdate(Replica replica)
Method for retrieving the date for the last update for corrupted files. |
static ReplicaCacheDatabase |
getInstance()
Method for retrieving the current instance of this class. |
java.lang.Iterable<java.lang.String> |
getMissingFilesInLastUpdate(Replica replica)
Method for retrieving the list of the names of the files which was missing for the replica in the last filelist update. |
long |
getNumberOfFiles(Replica replica)
Method for retrieving the number of files within a replica. |
long |
getNumberOfMissingFilesInLastUpdate(Replica replica)
Method for retrieving the number of files missing from a specific replica. |
long |
getNumberOfWrongFilesInLastUpdate(Replica replica)
Method for retrieving the amount of files with a incorrect checksum within a replica. |
java.lang.Iterable<java.lang.String> |
getWrongFilesInLastUpdate(Replica replica)
Method for retrieving the list of the files in the replica which have a incorrect checksum. |
protected void |
initialiseDB()
Method for initialising the database. |
void |
print()
Method to print all the tables in the database. |
FileListStatus |
retrieveFileListStatus(java.lang.String filename,
Replica replica)
Method for retrieving the filelist_status for a replicafileinfo entry. |
void |
updateChecksumStatus()
This method is used to update the status for the checksums for all replicafileinfo entries. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log log
java.sql.Connection dbConnection
Method Detail |
---|
public static ReplicaCacheDatabase getInstance()
protected void initialiseDB()
public FileListStatus retrieveFileListStatus(java.lang.String filename, Replica replica)
filename
- The name of the file.replica
- The replica where the file should be.
public void updateChecksumStatus()
updateChecksumStatus
in interface BitPreservationDAO
public void addChecksumInformation(java.util.List<ChecksumEntry> checksumOutput, Replica replica)
addChecksumInformation
in interface BitPreservationDAO
checksumOutput
- The output of a checksum job.replica
- The replica this checksum job is for.public void addFileListInformation(java.util.List<java.lang.String> filelist, Replica replica)
addFileListInformation
in interface BitPreservationDAO
filelist
- The list of filenames either parsed from a FilelistJob
or the result from a GetAllFilenamesMessage.replica
- The replica, which the FilelistBatchjob has run upon.public java.sql.Date getDateOfLastMissingFilesUpdate(Replica replica)
BitPreservationDAO
getDateOfLastMissingFilesUpdate
in interface BitPreservationDAO
replica
- The replica to get the date for.public java.sql.Date getDateOfLastWrongFilesUpdate(Replica replica)
getDateOfLastWrongFilesUpdate
in interface BitPreservationDAO
replica
- The replica to find the date for the latest update for
corruption of files.
public long getNumberOfMissingFilesInLastUpdate(Replica replica)
getNumberOfMissingFilesInLastUpdate
in interface BitPreservationDAO
replica
- The replica to find the number of missing files for.
public java.lang.Iterable<java.lang.String> getMissingFilesInLastUpdate(Replica replica)
getMissingFilesInLastUpdate
in interface BitPreservationDAO
replica
- The replica to find the list of missing files for.
public long getNumberOfWrongFilesInLastUpdate(Replica replica)
getNumberOfWrongFilesInLastUpdate
in interface BitPreservationDAO
replica
- The replica to find the number of corrupted files for.
public java.lang.Iterable<java.lang.String> getWrongFilesInLastUpdate(Replica replica)
getWrongFilesInLastUpdate
in interface BitPreservationDAO
replica
- The replica to find the list of corrupted files for.
public long getNumberOfFiles(Replica replica)
getNumberOfFiles
in interface BitPreservationDAO
replica
- The replica to count the number of files for.
public Replica getBitarchiveWithGoodFile(java.lang.String filename)
getBitarchiveWithGoodFile
in interface BitPreservationDAO
filename
- The name of the file which needs to have a valid version
in a bitarchive.
public Replica getBitarchiveWithGoodFile(java.lang.String filename, Replica badReplica)
getBitarchiveWithGoodFile
in interface BitPreservationDAO
filename
- The name of the file which needs to have a valid version
in a bitarchive.badReplica
- A replica which is known to contain a corrupt instance
of this file.
public void print()
public void cleanup()
BitPreservationDAO
cleanup
in interface BitPreservationDAO
cleanup
in interface CleanupIF
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |