|
||||||||||
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 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 teh 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. |
FilePreservationState |
getFilePreservationState(java.lang.String filename)
Method for retrieving the FilePreservationState for a specific file. |
java.util.Map<java.lang.String,FilePreservationState> |
getFilePreservationStateMap(java.lang.String... filenames)
Method for retrieving the FilePreservationState for a list of files. |
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. |
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 |
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) 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 FilePreservationState getFilePreservationState(java.lang.String filename) throws NotImplementedException, ArgumentNotValid
getFilePreservationState
in interface ActiveBitPreservation
filename
- The name of the file for whom the FilePreservationState
should be retrieved.
NotImplementedException
- This method has not yet been implemented.
ArgumentNotValid
- If the filename does not have a valid name.public java.util.Map<java.lang.String,FilePreservationState> getFilePreservationStateMap(java.lang.String... filenames) throws ArgumentNotValid, NotImplementedException
getFilePreservationStateMap
in interface ActiveBitPreservation
filenames
- The list of filenames whos FilePreservationState should
be retrieved.
NotImplementedException
- Since it has not yet been implemented.
ArgumentNotValid
- If the filenames are invalid.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) throws UnknownID, IOFailure, 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.
IOFailure
- if the file cannot be reestablished.
UnknownID
- 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) 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
- Since it has not yet been 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 |