public class ChecksumClient extends Object implements ReplicaClient
Can be used in combination with any type of ChecksumServerAPI.
Modifier and Type | Method and Description |
---|---|
void |
close()
Method for closing this instance.
|
static ChecksumClient |
getInstance(ChannelID theCRin)
The method for invoking an instance of this class.
|
ReplicaType |
getType()
Method for retrieving the type of replica.
|
BatchMessage |
sendBatchJob(BatchMessage msg)
Method for sending batch job messages to the replica.
|
BatchMessage |
sendBatchJob(ChannelID replyChannel,
FileBatchJob job)
Method for sending batch job messages to the replica.
|
void |
sendCorrectMessage(CorrectMessage msg)
Method for sending correct messages to the replica.
|
void |
sendGetAllChecksumsMessage(GetAllChecksumsMessage msg)
Method for sending the GetAllChecksumMessage to the ChecksumReplica.
|
void |
sendGetAllFilenamesMessage(GetAllFilenamesMessage msg)
Method for sending a GetAllFilenamesMessage to a checksum archive.
|
GetChecksumMessage |
sendGetChecksumMessage(ChannelID replyChannel,
String filename)
Method for retrieving the checksum of a specific arcfile within the archive.
|
void |
sendGetChecksumMessage(GetChecksumMessage msg)
Method for retrieving the checksum of a specific arcfile within the archive.
|
void |
sendGetFileMessage(GetFileMessage gfm)
This method is intended to retrieve an arc-file from the archive.
|
void |
sendGetMessage(GetMessage msg)
This method is intended to retrieve a record from an arc-file within the archive.
|
void |
sendRemoveAndGetFileMessage(RemoveAndGetFileMessage msg)
This method is intended to retrieve an arc-file from the archive.
|
void |
sendUploadMessage(RemoteFile rf,
String precomputedChecksum)
Method for uploading a file to the archive.
|
public static ChecksumClient getInstance(ChannelID theCRin) throws IOFailure, ArgumentNotValid
theCRin
- The channel for contacting the checksum archive.IOFailure
- If there is a problem with the connection.ArgumentNotValid
- If the checksum replica channel is null.public void sendCorrectMessage(CorrectMessage msg) throws ArgumentNotValid
sendCorrectMessage
in interface ReplicaClient
msg
- The CorrectMessage to send to the replica.ArgumentNotValid
- If the CorrectMessage is null.public void sendGetAllFilenamesMessage(GetAllFilenamesMessage msg) throws ArgumentNotValid
sendGetAllFilenamesMessage
in interface ReplicaClient
msg
- The GetAllFilenamesMessage, which will be send through the jms connection to the checksum archive.ArgumentNotValid
- If the GetAllFilenamesMessage is null.public void sendGetAllChecksumsMessage(GetAllChecksumsMessage msg) throws ArgumentNotValid
sendGetAllChecksumsMessage
in interface ReplicaClient
msg
- The GetAllChecksumMessage, which will be sent through the jms connection to the checksum archive.ArgumentNotValid
- If the GetAllChecksumsMessage is null.public void sendGetChecksumMessage(GetChecksumMessage msg)
sendGetChecksumMessage
in interface ReplicaClient
msg
- The GetChecksumMessage which will be sent to the checksum archive though the jms connection.public GetChecksumMessage sendGetChecksumMessage(ChannelID replyChannel, String filename) throws ArgumentNotValid
sendGetChecksumMessage
in interface ReplicaClient
replyChannel
- The channel where the reply should be sent.filename
- The GetChecksumMessage which has been sent to the checksum archive though the jms connection.ArgumentNotValid
- If the reply channel is null or if the filename is either null or the empty string.public ReplicaType getType()
getType
in interface ReplicaClient
public void sendUploadMessage(RemoteFile rf, String precomputedChecksum) throws ArgumentNotValid
sendUploadMessage
in interface ReplicaClient
rf
- The file to upload to the archive.precomputedChecksum
- A precomputed checksumArgumentNotValid
- If the remote file is null.public BatchMessage sendBatchJob(ChannelID replyChannel, FileBatchJob job) throws IllegalState, ArgumentNotValid
sendBatchJob
in interface ReplicaClient
replyChannel
- The channel where the reply should be sent.job
- The batchjob to execute.IllegalState
- Always. Since it is not legal to send a batchjob to a checksum replica.ArgumentNotValid
- If the channel or the batchjob is null.public BatchMessage sendBatchJob(BatchMessage msg) throws IllegalState, ArgumentNotValid
sendBatchJob
in interface ReplicaClient
msg
- The batch message.IllegalState
- Always. Since it is not legal to send a batchjob to a checksum replica.ArgumentNotValid
- If the message is null.public void sendGetMessage(GetMessage msg) throws IllegalState, ArgumentNotValid
sendGetMessage
in interface ReplicaClient
msg
- The GetMessage for retrieving the arc-record from the archive.IllegalState
- Always. Since checksum replicas cannot handle this kind of messages.ArgumentNotValid
- If the message is null.public void sendGetFileMessage(GetFileMessage gfm) throws IllegalState, ArgumentNotValid
sendGetFileMessage
in interface ReplicaClient
gfm
- The GetFileMessage for retrieving the arc-file from the archive.IllegalState
- Always. Since checksum replicas cannot handle this kind of messages.ArgumentNotValid
- If the message is null.public void sendRemoveAndGetFileMessage(RemoveAndGetFileMessage msg) throws IllegalState, ArgumentNotValid
sendRemoveAndGetFileMessage
in interface ReplicaClient
msg
- The RemoveAndGetFileMessage for removing and retrieving an arc-file from the archive.IllegalState
- Always. Since checksum replicas cannot handle this kind of messages.ArgumentNotValid
- If the message is null.public void close()
close
in interface ReplicaClient
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.