|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.archive.arcrepository.bitpreservation.DatabaseBasedActiveBitPreservation
public final class DatabaseBasedActiveBitPreservation
The database based active bit preservation. This is the alternative to the FileBasedActiveBitPreservation. A database is used to handle the bitpreservation.
Method Summary | |
---|---|
void |
addMissingFilesToAdminData(java.lang.String... filenames)
Old method, which refers to the checksum replica part of admin data. |
void |
changeStateForAdminData(java.lang.String filename)
This should reestablish the state for the file. |
void |
cleanup()
Method for cleaning up this instance. |
void |
close()
Method for closing the running instance of this class. |
void |
findChangedFiles(Replica replica)
The method is used to update the checksum for all the files in a replica. |
void |
findMissingFiles(Replica replica)
This method retrieves the filelist for the replica, and then it updates the database with this list of filenames. |
java.lang.Iterable<java.lang.String> |
getChangedFiles(Replica replica)
This method retrieves the name of all the files which has a wrong checksum for the replica. |
java.lang.Iterable<java.lang.String> |
getChangedFilesForAdminData()
Old method, which refers to the checksum replica part of admin data. |
java.sql.Date |
getDateForChangedFiles(Replica replica)
This method retrieves the date for the latest checksum update was performed for the replica. |
java.sql.Date |
getDateForMissingFiles(Replica replica)
This method retrieves the date for the latest filelist update was performed for the replica. |
static DatabaseBasedActiveBitPreservation |
getInstance()
Method for retrieving the current instance of this class. |
java.lang.Iterable<java.lang.String> |
getMissingFiles(Replica replica)
This method retrieves the name of all the files which are missing for the given replica. |
java.lang.Iterable<java.lang.String> |
getMissingFilesForAdminData()
Old method, which refers to the checksum replica part of admin data. |
long |
getNumberOfChangedFiles(Replica replica)
The method calculates the number of files which has a wrong checksum for the replica. |
long |
getNumberOfFiles(Replica replica)
This method finds the number of files which are known to be in the archive of a specific replica. |
long |
getNumberOfMissingFiles(Replica replica)
This method calculates the number of files which are not found in the given replica. |
PreservationState |
getPreservationState(java.lang.String filename)
Method for retrieving the FilePreservationState for a specific file. |
java.util.Map<java.lang.String,PreservationState> |
getPreservationStateMap(java.lang.String... filenames)
Method for retrieving the FilePreservationState for a list of files. |
void |
replaceChangedFile(Replica replica,
java.lang.String filename,
java.lang.String credentials,
java.lang.String checksum)
Check that the checksum of the file is indeed different to the value in admin data and reference replica. |
void |
uploadMissingFiles(Replica replica,
java.lang.String... filenames)
This method is used to upload missing files to a replica. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static DatabaseBasedActiveBitPreservation getInstance()
public long getNumberOfChangedFiles(Replica replica) throws ArgumentNotValid
getNumberOfChangedFiles
in interface ActiveBitPreservation
replica
- The replica for which to count the number of changed
files.
ArgumentNotValid
- If the replica is null.public java.lang.Iterable<java.lang.String> getChangedFiles(Replica replica) throws ArgumentNotValid
getChangedFiles
in interface ActiveBitPreservation
replica
- The replica for which the changed files should be found.
ArgumentNotValid
- If the replica is null.public long getNumberOfMissingFiles(Replica replica) throws ArgumentNotValid
getNumberOfMissingFiles
in interface ActiveBitPreservation
replica
- The replica for which to count the number of missing
files.
ArgumentNotValid
- If the replica is null.public java.lang.Iterable<java.lang.String> getMissingFiles(Replica replica) throws ArgumentNotValid
getMissingFiles
in interface ActiveBitPreservation
replica
- The replica for which the missing files should be found.
ArgumentNotValid
- If the replica is null.public java.sql.Date getDateForChangedFiles(Replica replica) throws ArgumentNotValid
getDateForChangedFiles
in interface ActiveBitPreservation
replica
- The replica for which the date for last checksum update
should be retrieved.
ArgumentNotValid
- If the replica is null.public java.sql.Date getDateForMissingFiles(Replica replica) throws ArgumentNotValid
getDateForMissingFiles
in interface ActiveBitPreservation
replica
- The replica for which the date for last filelist update
should be retrieved.
ArgumentNotValid
- If the replica is null.public void findChangedFiles(Replica replica) throws ArgumentNotValid
findChangedFiles
in interface ActiveBitPreservation
replica
- The replica to find the changed files for.
ArgumentNotValid
- If the replica is null.public void findMissingFiles(Replica replica) throws ArgumentNotValid
findMissingFiles
in interface ActiveBitPreservation
replica
- The replica to find the missing files for.
ArgumentNotValid
- If the replica is null.public PreservationState getPreservationState(java.lang.String filename) throws ArgumentNotValid
getPreservationState
in interface ActiveBitPreservation
filename
- The name of the file for whom the FilePreservationState
should be retrieved.
ArgumentNotValid
- If the filename is null or the empty string.public java.util.Map<java.lang.String,PreservationState> getPreservationStateMap(java.lang.String... filenames) throws ArgumentNotValid
getPreservationStateMap
in interface ActiveBitPreservation
filenames
- The list of filenames whose FilePreservationState should
be retrieved.
ArgumentNotValid
- If the list of filenames are null.public long getNumberOfFiles(Replica replica) throws ArgumentNotValid
getNumberOfFiles
in interface ActiveBitPreservation
replica
- The replica for which the number of files should be
counted.
ArgumentNotValid
- If the replica is null.public void replaceChangedFile(Replica replica, java.lang.String filename, java.lang.String credentials, java.lang.String checksum) throws ArgumentNotValid
replaceChangedFile
in interface ActiveBitPreservation
replica
- The replica to restore file tofilename
- The name of the filecredentials
- The credentials used to perform this replace operationchecksum
- The known bad checksum. Only a file with this bad
checksum is attempted repaired.
ArgumentNotValid
- If any of the arguments are not valid.public void uploadMissingFiles(Replica replica, java.lang.String... filenames) throws ArgumentNotValid, IOFailure
uploadMissingFiles
in interface ActiveBitPreservation
replica
- The replica where the files are missing.filenames
- The names of the files which are missing in the given
replica.
ArgumentNotValid
- If the replica or list of filenames is null,
or if the list of filenames is empty.
IOFailure
- If some files could not be established.public void changeStateForAdminData(java.lang.String filename) throws ArgumentNotValid, NotImplementedException
changeStateForAdminData
in interface ActiveBitPreservation
filename
- The name of the file to change the state for.
ArgumentNotValid
- If the filename is invalid.
NotImplementedException
- This will not be implemented.public java.lang.Iterable<java.lang.String> getMissingFilesForAdminData() throws NotImplementedException
getMissingFilesForAdminData
in interface ActiveBitPreservation
NotImplementedException
- This method will not be implemented.public java.lang.Iterable<java.lang.String> getChangedFilesForAdminData() throws NotImplementedException
getChangedFilesForAdminData
in interface ActiveBitPreservation
NotImplementedException
- This method will not be implemented.public void addMissingFilesToAdminData(java.lang.String... filenames) throws ArgumentNotValid, NotImplementedException
addMissingFilesToAdminData
in interface ActiveBitPreservation
filenames
- The list of filenames which should be added to admin
data.
NotImplementedException
- This method will not be implemented.
ArgumentNotValid
- If filenames invalid.public void close()
public void cleanup()
cleanup
in interface CleanupIF
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |