@Deprecated public class UpdateableAdminData extends AdminData implements Admin
If a line in the admin data file is corrupt, the entry is removed from admindata.
Notes: If the admindata file does not exist on start-up, the file is created in the constructor. If the admindata file on start-up is the oldversion, the admindata file is migrated to the new version.
ADMIN_FILE_NAME, adminDataFile, adminDir, knownBitArchives, storeEntries, VERSION_NUMBER
Modifier and Type | Method and Description |
---|---|
void |
addEntry(String filename,
StoreMessage replyInfo,
String checksum)
Deprecated.
Add new entry to the admin data, and persist it to disk.
|
void |
addEntry(String filename,
StoreMessage replyInfo,
String checksum,
boolean persistNow)
Deprecated.
Add new entry to the admin data, and persist it to disk, if persistNow set to true.
|
void |
close()
Deprecated.
Makes sure all data is written to disk.
|
static UpdateableAdminData |
getInstance()
Deprecated.
Get the singleton instance.
|
StoreMessage |
removeReplyInfo(String fileName)
Deprecated.
Removes the replyInfo associated with arcfileName.
|
void |
setCheckSum(String fileName,
String checkSum)
Deprecated.
Set/update the checksum for a given arcfileName in the admindata.
|
void |
setReplyInfo(String fileName,
StoreMessage replyInfo)
Deprecated.
Records the replyInfo (StoreMessage object) so that it can be retrieved using the given file name.
|
void |
setState(String fileName,
String replicaID,
ReplicaStoreState state)
Deprecated.
Sets the store state for the given file on the given bitarchive.
|
getAllFileNames, getAllFileNames, getCheckSum, getEntry, getReadOnlyInstance, getState, getUpdateableInstance, hasEntry, hasReplyInfo, hasState, read, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAllFileNames, getAllFileNames, getCheckSum, getState, hasEntry, hasReplyInfo, hasState
public static UpdateableAdminData getInstance()
public void addEntry(String filename, StoreMessage replyInfo, String checksum)
public void addEntry(String filename, StoreMessage replyInfo, String checksum, boolean persistNow)
filename
- A filenamereplyInfo
- A replyInfo for this entry (may be null)checksum
- The Checksum for this filepersistNow
- Shall we persist this entry now?public void setReplyInfo(String fileName, StoreMessage replyInfo) throws UnknownID
setReplyInfo
in interface Admin
fileName
- An arc file that someone is trying to store.replyInfo
- A StoreMessage object related to this filename.UnknownID
- if no info has been registered for the filename.public StoreMessage removeReplyInfo(String fileName) throws UnknownID
removeReplyInfo
in interface Admin
fileName
- A file that we are trying to store.UnknownID
- If the filename is not known. or no replyInfo is associated with arcfileName.public void setState(String fileName, String replicaID, ReplicaStoreState state) throws UnknownID, ArgumentNotValid
setState
in interface Admin
fileName
- A file that is being stored.replicaID
- A bitarchive.state
- The state of upload of arcfileName on bitarchiveID.UnknownID
- If the file does not have a store entry.ArgumentNotValid
- If the arguments are null or emptypublic void setCheckSum(String fileName, String checkSum) throws ArgumentNotValid, UnknownID
setCheckSum
in interface Admin
fileName
- Unique name of file for which to store checksumcheckSum
- The generated (MD5) checksum to be stored in reference tableUnknownID
- if the file is not already registered.ArgumentNotValid
- If the arcfileName or the checksum is either null or the empty string.Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.