Class AdminData
- java.lang.Object
-
- dk.netarkivet.archive.arcrepositoryadmin.AdminData
-
- Direct Known Subclasses:
ReadOnlyAdminData
,UpdateableAdminData
@Deprecated public abstract class AdminData extends Object
Deprecated.Use the DatabaseAdmin instead.Class for accessing and manipulating the administrative data for the ArcRepository. In the current implementation, it consists of a file with a number of lines of the form:[, ]* This abstract class is overridden to give either a read/write or a readonly version of this class.
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
ADMIN_FILE_NAME
Deprecated.The name of the admin file.protected File
adminDataFile
Deprecated.The File object for the admin data file.protected File
adminDir
Deprecated.The directory where the admin data resides, currently the directory: Settings.DIRS_ARCREPOSITORY_ADMIN.protected List<String>
knownBitArchives
Deprecated.List containing the names of all knownBitArchives.protected Map<String,ArcRepositoryEntry>
storeEntries
Deprecated.Map containing a mapping from arcfilename to ArcRepositoryEntry.static String
VERSION_NUMBER
Deprecated.Admindata version.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AdminData()
Deprecated.Common constructor for admin data.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Set<String>
getAllFileNames()
Deprecated.Returns a set of the all arcfile names in the repository.Set<String>
getAllFileNames(Replica replica, ReplicaStoreState state)
Deprecated.Returns a set of the arcfile names that are in a given state for a specific bitarchive in the repository.String
getCheckSum(String arcfileName)
Deprecated.Get Checksum for a given arcfile.ArcRepositoryEntry
getEntry(String arcfileName)
Deprecated.Return the ArcRepositoryEntry for a certain arcfileName.static ReadOnlyAdminData
getReadOnlyInstance()
Deprecated.Returns a read-only AdminData instance.ReplicaStoreState
getState(String arcfileName, String replicaChannelName)
Deprecated.Retrieves the storage state of a file for a specific replica.static UpdateableAdminData
getUpdateableInstance()
Deprecated.Returns the one and only AdminData instance.boolean
hasEntry(String arcfileName)
Deprecated.Check, if there is an entry for a certain arcfile?boolean
hasReplyInfo(String arcfileName)
Deprecated.Tells whether there is a replyInfo associated with the given arcfile.boolean
hasState(String arcfileName, String replicaChannelName)
Deprecated.Returns whether or not a BitArchiveStoreState is registered for the given ARC file at the given bit archive.protected void
read()
Deprecated.Reads the admin data from a file.String
toString()
Deprecated.Return info about current object as String.
-
-
-
Field Detail
-
VERSION_NUMBER
public static final String VERSION_NUMBER
Deprecated.Admindata version. VersionNumber is the current version.- See Also:
- Constant Field Values
-
storeEntries
protected Map<String,ArcRepositoryEntry> storeEntries
Deprecated.Map containing a mapping from arcfilename to ArcRepositoryEntry.
-
adminDir
protected File adminDir
Deprecated.The directory where the admin data resides, currently the directory: Settings.DIRS_ARCREPOSITORY_ADMIN.
-
ADMIN_FILE_NAME
protected static final String ADMIN_FILE_NAME
Deprecated.The name of the admin file.- See Also:
- Constant Field Values
-
knownBitArchives
protected List<String> knownBitArchives
Deprecated.List containing the names of all knownBitArchives. This list is updated in the setState() method But only used in the toString() method.
-
adminDataFile
protected final File adminDataFile
Deprecated.The File object for the admin data file.
-
-
Method Detail
-
getUpdateableInstance
public static UpdateableAdminData getUpdateableInstance()
Deprecated.Returns the one and only AdminData instance.- Returns:
- the one and only AdminData instance.
-
getReadOnlyInstance
public static ReadOnlyAdminData getReadOnlyInstance()
Deprecated.Returns a read-only AdminData instance.- Returns:
- a read-only AdminData instance.
-
hasEntry
public boolean hasEntry(String arcfileName)
Deprecated.Check, if there is an entry for a certain arcfile?- Parameters:
arcfileName
- A given arcfile- Returns:
- true, if there is an entry for the given arcfile
-
getEntry
public ArcRepositoryEntry getEntry(String arcfileName)
Deprecated.Return the ArcRepositoryEntry for a certain arcfileName. Returns null, if not found.- Parameters:
arcfileName
- a certain filename- Returns:
- the ArcRepositoryEntry for a certain arcfileName
-
hasReplyInfo
public boolean hasReplyInfo(String arcfileName)
Deprecated.Tells whether there is a replyInfo associated with the given arcfile. If the file is not registered, a warning is logged and false is returned.- Parameters:
arcfileName
- The arc file we want to reply a store request for.- Returns:
- Whether setReplyInfo() has been called (and the replyInfo hasn't been removed since).
-
hasState
public boolean hasState(String arcfileName, String replicaChannelName)
Deprecated.Returns whether or not a BitArchiveStoreState is registered for the given ARC file at the given bit archive.- Parameters:
arcfileName
- The file to retrieve the state forreplicaChannelName
- The name of the identification channel for the replica the state should be retrieved for.- Returns:
- true if BitArchiveStoreState is registered, false otherwise.
-
getState
public ReplicaStoreState getState(String arcfileName, String replicaChannelName) throws UnknownID
Deprecated.Retrieves the storage state of a file for a specific replica.- Parameters:
arcfileName
- The file to retrieve the state for.replicaChannelName
- The name of the identification channel for the replica the state should be retrieved for.- Returns:
- The storage state.
- Throws:
UnknownID
- When no record exists.
-
getCheckSum
public String getCheckSum(String arcfileName) throws ArgumentNotValid, UnknownID
Deprecated.Get Checksum for a given arcfile.- Parameters:
arcfileName
- Unique reference to file for which to retrieve checksum- Returns:
- checksum the latest registered reference checksum or null, if no reference checksum is available
- Throws:
UnknownID
- if the file is not registeredArgumentNotValid
- If the arcFileName is either null or the empty string.
-
read
protected void read() throws IOFailure
Deprecated.Reads the admin data from a file. If the data read is a valid old version the it is converted to the new version and written to disk.- Throws:
IOFailure
- on trouble reading from file
-
getAllFileNames
public Set<String> getAllFileNames()
Deprecated.Returns a set of the all arcfile names in the repository.- Returns:
- the set of files in the repository
-
getAllFileNames
public Set<String> getAllFileNames(Replica replica, ReplicaStoreState state)
Deprecated.Returns a set of the arcfile names that are in a given state for a specific bitarchive in the repository.- Parameters:
replica
- the object representing the BAstate
- the state to look for, e.g. ReplicaStoreState.STATE_COMPLETED- Returns:
- the set of files in the repository with the given state
-
-