dk.netarkivet.archive.distribute
Interface ReplicaClient

All Known Implementing Classes:
BitarchiveClient, ChecksumClient

public interface ReplicaClient

Interface for the replica clients. To be used by the BitarchiveClient and the ChecksumClient.


Method Summary
 BatchMessage batch(BatchMessage msg)
          Method for sending a batch message and retrieving the results.
 BatchMessage batch(ChannelID replyChannel, FileBatchJob job)
          Method for sending batch message and retrieving the results.
 void close()
          Close the replica client.
 void correct(RemoteFile arcfile, java.lang.String checksum)
          For correcting a erroneous file in the archive.
 void get(GetMessage msg)
          The message for retrieving a record from a arc-file in the replica.
 void getAllChecksums(GetAllChecksumsMessage msg)
          Retrieves the checksum for all the arc files in the replica archive.
 void getAllFilenames(GetAllFilenamesMessage msg)
          Retrieves the names of all the arc file in the replica archive.
 GetChecksumMessage getChecksum(ChannelID replyChannel, java.lang.String filename)
          Retrieves the checksum for a specific file.
 void getChecksum(GetChecksumMessage msg)
          Retrieves the checksum for a specific arc file.
 void getFile(GetFileMessage msg)
          The message for retrieving an entire file from the replica.
 ReplicaType getType()
          For retrieving the type of archive.
 void removeAndGetFile(RemoveAndGetFileMessage msg)
          Message for deleting and retrieving a file from a archive.
 void upload(RemoteFile rf)
          Uploads a file to the replica archive.
 

Method Detail

batch

BatchMessage batch(BatchMessage msg)
Method for sending a batch message and retrieving the results. This is only used by the bitarchive replicas.

Parameters:
msg - The batch message to sent to the replica.
Returns:
The batch message which has been sent.

batch

BatchMessage batch(ChannelID replyChannel,
                   FileBatchJob job)
Method for sending batch message and retrieving the results. This will only work for Bitarchive replicas.

Parameters:
replyChannel - The channel where the reply should be sent.
job - The batchjob to execute on the replica.
Returns:
The message which has been sent.

get

void get(GetMessage msg)
The message for retrieving a record from a arc-file in the replica. This is only used by the bitarchive replicas.

Parameters:
msg - The message for retrieving the record in a arc-file.

getFile

void getFile(GetFileMessage msg)
The message for retrieving an entire file from the replica. This is only used by the bitarchive replicas.

Parameters:
msg - The message for retrieving the file.

removeAndGetFile

void removeAndGetFile(RemoveAndGetFileMessage msg)
Message for deleting and retrieving a file from a archive.

Parameters:
msg - The message for retrieving the file.

upload

void upload(RemoteFile rf)
Uploads a file to the replica archive. This should create the UploadMessage and send it.

Parameters:
rf - The remote file

getChecksum

void getChecksum(GetChecksumMessage msg)
Retrieves the checksum for a specific arc file. The GetChecksumMessage is sent along to the archive.

Parameters:
arcName - The name of the arcfile.

getChecksum

GetChecksumMessage getChecksum(ChannelID replyChannel,
                               java.lang.String filename)
Retrieves the checksum for a specific file. The method creates and sends the GetChecksumMessage to the archive.

Parameters:
replyChannel - The channel where the reply should be sent.
filename - The name of the file to retrieve the checksum from.
Returns:
The message, after it has been sent.

getAllFilenames

void getAllFilenames(GetAllFilenamesMessage msg)
Retrieves the names of all the arc file in the replica archive.


getAllChecksums

void getAllChecksums(GetAllChecksumsMessage msg)
Retrieves the checksum for all the arc files in the replica archive. This method is the ChecksumReplica equivalent to running a ChecksumJob. The message is sent from this method.


getType

ReplicaType getType()
For retrieving the type of archive. This will either be 'bitArchive' or 'checksumArchive'.

Returns:
The type of archive.

correct

void correct(RemoteFile arcfile,
             java.lang.String checksum)
For correcting a erroneous file in the archive. This creates and sends the message for correcting the wrong file.

Parameters:
arcfile - The file which is to replace the wrong file within the archive.

close

void close()
Close the replica client.