|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.netarkivet.archive.arcrepository.bitpreservation.DatabaseBasedActiveBitPreservation
public class DatabaseBasedActiveBitPreservation
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
log
The log. |
Method Summary | |
---|---|
void |
addMissingFilesToAdminData(java.lang.String... filenames)
Add files unknown in admin.data to admin.data. |
void |
changeStateForAdminData(java.lang.String filename)
Reestablish admin data to match bitarchive states for file. |
void |
cleanup()
Used to clean up a class from within a shutdown hook. |
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()
Return a list of files with wrong checksum or state in 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. |
FilePreservationState |
getFilePreservationState(java.lang.String filename)
Get the details of the state of the given file in the bitarchives and admin data. |
java.util.Map<java.lang.String,FilePreservationState> |
getFilePreservationStateMap(java.lang.String... filenames)
Get details of the state of one or more files in the bitarchives and admin data. |
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()
Return a list of files represented in replica but missing in AdminData. |
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. |
void |
rebuildDatabase()
This is a method to recreate the database, if it somehow has been lost. |
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 |
Field Detail |
---|
protected static final org.apache.commons.logging.Log log
Method Detail |
---|
public static DatabaseBasedActiveBitPreservation getInstance()
public void rebuildDatabase()
public long getNumberOfChangedFiles(Replica replica)
getNumberOfChangedFiles
in interface ActiveBitPreservation
replica
- The replica for which to count the number of changed
files.
public java.lang.Iterable<java.lang.String> getChangedFiles(Replica replica)
getChangedFiles
in interface ActiveBitPreservation
replica
- The replica for which the changed files should be found.
public long getNumberOfMissingFiles(Replica replica)
getNumberOfMissingFiles
in interface ActiveBitPreservation
replica
- The replica for which to count the number of missing
files.
public java.lang.Iterable<java.lang.String> getMissingFiles(Replica replica)
getMissingFiles
in interface ActiveBitPreservation
replica
- The replica for which the missing files should be found.
public java.sql.Date getDateForChangedFiles(Replica replica)
getDateForChangedFiles
in interface ActiveBitPreservation
replica
- The replica for which the date for last checksum update
should be retrieved.
public java.sql.Date getDateForMissingFiles(Replica replica)
getDateForMissingFiles
in interface ActiveBitPreservation
replica
- The replica for which the date for last filelist update
should be retrieved.
public void findChangedFiles(Replica replica)
findChangedFiles
in interface ActiveBitPreservation
replica
- The replica to find the changed files for.public void findMissingFiles(Replica replica)
findMissingFiles
in interface ActiveBitPreservation
replica
- The replica to find the missing files for.public FilePreservationState getFilePreservationState(java.lang.String filename)
ActiveBitPreservation
getFilePreservationState
in interface ActiveBitPreservation
filename
- A given file
public java.util.Map<java.lang.String,FilePreservationState> getFilePreservationStateMap(java.lang.String... filenames)
ActiveBitPreservation
getFilePreservationStateMap
in interface ActiveBitPreservation
filenames
- the list of filenames to investigate
public long getNumberOfFiles(Replica replica)
getNumberOfFiles
in interface ActiveBitPreservation
replica
- The replica for which the number of files should be
counted.
public void replaceChangedFile(Replica replica, java.lang.String filename, java.lang.String credentials, java.lang.String checksum)
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.
IOFailure
- if the file cannot be reestablished.
PermissionDenied
- if the file is not in correct state.
ArgumentNotValid
- if any of the arguments are not valid.public void uploadMissingFiles(Replica replica, java.lang.String... filenames)
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.public void changeStateForAdminData(java.lang.String filename)
ActiveBitPreservation
changeStateForAdminData
in interface ActiveBitPreservation
filename
- The file to reestablish state for.public java.lang.Iterable<java.lang.String> getMissingFilesForAdminData()
ActiveBitPreservation
getMissingFilesForAdminData
in interface ActiveBitPreservation
public java.lang.Iterable<java.lang.String> getChangedFilesForAdminData()
ActiveBitPreservation
getChangedFilesForAdminData
in interface ActiveBitPreservation
public void addMissingFilesToAdminData(java.lang.String... filenames)
ActiveBitPreservation
addMissingFilesToAdminData
in interface ActiveBitPreservation
filenames
- The files to add.public void close()
public void cleanup()
CleanupIF
cleanup
in interface CleanupIF
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |