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 Detail

      • sendBatchJob

        BatchMessage sendBatchJob​(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.
      • sendBatchJob

        BatchMessage sendBatchJob​(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.
      • sendGetMessage

        void sendGetMessage​(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.
      • sendGetFileMessage

        void sendGetFileMessage​(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.
      • sendRemoveAndGetFileMessage

        void sendRemoveAndGetFileMessage​(RemoveAndGetFileMessage msg)
        Message for deleting and retrieving a file from a archive.
        Parameters:
        msg - The message for retrieving the file.
      • sendUploadMessage

        void sendUploadMessage​(RemoteFile rf,
                               String precomputedChecksum)
        Uploads a file to the replica archive. This should create the UploadMessage and send it.
        Parameters:
        rf - The remote file
        precomputedChecksum - A precomputed checksum
      • sendGetChecksumMessage

        void sendGetChecksumMessage​(GetChecksumMessage msg)
        Retrieves the checksum for a specific arc file. The GetChecksumMessage is sent along to the archive.
        Parameters:
        msg - The GetChecksumMessage to be send to the replica.
      • sendGetChecksumMessage

        GetChecksumMessage sendGetChecksumMessage​(ChannelID replyChannel,
                                                  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.
      • sendGetAllFilenamesMessage

        void sendGetAllFilenamesMessage​(GetAllFilenamesMessage msg)
        Retrieves the names of all the arc file in the replica archive.
        Parameters:
        msg - The GetAllFilenamesMessage to sent to the replica.
      • sendGetAllChecksumsMessage

        void sendGetAllChecksumsMessage​(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.

        Parameters:
        msg - The message for retrieving all the checksums.
      • sendCorrectMessage

        void sendCorrectMessage​(CorrectMessage msg)
        For correcting an erroneous entry in the archive. The message is sent the replica for correcting the 'bad' entry.
        Parameters:
        msg - The correct message to correct the bad entry in the archive.
      • getType

        ReplicaType getType()
        For retrieving the type of archive. This will either be 'bitArchive' or 'checksumArchive'.
        Returns:
        The type of archive.
      • close

        void close()
        Close the replica client.