|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.archive.arcrepository.ArcRepository
public class ArcRepository
The Arcrepository handles the communication with the different replicas. This class ensures that arc files are stored in all available replica and verifies that the storage process succeeded. Retrieval of data from a replica goes through the JMSArcRepositoryClient that contacts the appropriate (typically nearest) replica and retrieves data from this archive. Batch execution is sent to the bitarchive replica(s), since batch cannot be executed on checksum replicas. Correction operations are typically only allowed on one replica.
Constructor Summary | |
---|---|
protected |
ArcRepository()
Constructor for the ArcRepository. |
Method Summary | |
---|---|
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(java.lang.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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.Method Detail |
---|
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(java.lang.String replicaId) throws ArgumentNotValid
replicaId
- the replica id
ArgumentNotValid
- if replicaId parameter is nullpublic void onUpload(UploadMessage msg)
msg
- an UploadMessage.public void onBatchReply(BatchReplyMessage msg)
msg
- a BatchReplyMessage.public void onChecksumReply(GetChecksumMessage msg)
msg
- The message containing the checksum of a specific file.public void updateAdminData(AdminDataMessage msg)
msg
- an AdminDataMessage objectpublic void removeAndGetFile(RemoveAndGetFileMessage msg)
msg
- the message to forward to a bitarchivepublic 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 |