public class ArcRepository extends Object implements CleanupIF
Modifier | Constructor and Description |
---|---|
protected |
ArcRepository()
Constructor for the ArcRepository.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Closes all connections and nulls the instance.
|
void |
close()
Close all replicas connections, open loggers, and the ArcRepository handler.
|
static ArcRepository |
getInstance()
Returns the unique ArcRepository instance.
|
ReplicaClient |
getReplicaClientFromReplicaId(String replicaId)
Returns a replica client based on a replica id.
|
void |
onBatchReply(BatchReplyMessage msg)
Called when we receive replies on our checksum batch jobs.
|
void |
onChecksumReply(GetChecksumMessage msg)
The message for handling the results of the GetChecksumMessage.
|
void |
onUpload(UploadMessage msg)
Event handler for upload messages reporting the upload result.
|
void |
removeAndGetFile(RemoveAndGetFileMessage msg)
Forwards a RemoveAndGetFileMessage to the designated bitarchive.
|
void |
store(RemoteFile rf,
StoreMessage replyInfo)
Stores a file in all known replicas.
|
void |
updateAdminData(AdminDataMessage msg)
Change admin data entry for a given file.
|
protected ArcRepository() throws IOFailure, IllegalState
IOFailure
- if admin data cannot be read/initialised or we cannot' connect to some bitarchive.IllegalState
- if inconsistent channel info is given in settings.public static ArcRepository getInstance() throws IllegalState, IOFailure
IOFailure
- if admin data cannot be read/initialised or we cannot' connect to some bitarchive.IllegalState
- if inconsistent channel info is given in settings.public void store(RemoteFile rf, StoreMessage replyInfo) throws IOFailure, ArgumentNotValid
rf
- The remotefile to be stored.replyInfo
- A StoreMessage used to reply with success or failure.IOFailure
- If file couldn't be stored.ArgumentNotValid
- If a input parameter is null.public ReplicaClient getReplicaClientFromReplicaId(String replicaId) throws ArgumentNotValid
replicaId
- the replica idArgumentNotValid
- if replicaId parameter is nullpublic void onUpload(UploadMessage msg)
msg
- an UploadMessage.public void onBatchReply(BatchReplyMessage msg)
This does not handle checksum replicas.
msg
- a BatchReplyMessage.public void onChecksumReply(GetChecksumMessage msg)
msg
- The message containing the checksum of a specific file.public void updateAdminData(AdminDataMessage msg)
The following information is contained in the given AdminDataMessage: 1) The name of the given file to change the entry for, 2) the name of the bitarchive to modify the entry for, 3) a boolean that says whether or not to replace the checksum for the entry for the given file in AdminData, 4) a replacement for the case where the former value is true.
msg
- an AdminDataMessage objectpublic void removeAndGetFile(RemoveAndGetFileMessage msg)
msg
- the message to forward to a bitarchivepublic void close()
Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.