Class GetAllChecksumsMessage

  • All Implemented Interfaces:
    Serializable

    public class GetAllChecksumsMessage
    extends ArchiveMessage
    The GetChecksumMessage has the purpose to retrieve the checksum of all the files. The output is in the form of a file corresponding to the reply file of a ChecksumJob.

    This is checksum replica alternative to sending a ChecksumBatchJob.

    See Also:
    Serialized Form
    • Constructor Detail

      • GetAllChecksumsMessage

        public GetAllChecksumsMessage​(ChannelID to,
                                      ChannelID replyTo,
                                      String repId)
        Constructor.
        Parameters:
        to - Where this message is headed.
        replyTo - Where the reply on this message is sent.
        repId - The replica where the job involved in this message is to be performed.
    • Method Detail

      • setFile

        public void setFile​(File file)
                     throws ArgumentNotValid
        Method for setting the resulting file. This file will be retrieved from the caller of this message. This should be a movable instance since the temporary file should be removed after is has been retrieved.

        TODO cleanup if remoteFile already has been set.

        Parameters:
        file - The file with the checksum message.
        Throws:
        ArgumentNotValid - If file is null.
      • getData

        public void getData​(File toFile)
                     throws IOFailure,
                            ArgumentNotValid
        Method for retrieving the resulting file. This method can only be called once, since the remoteFile is cleaned up and set to null.
        Parameters:
        toFile - The file for the remotely retrieved content.
        Throws:
        IOFailure - If the data in the remoteFile already has be retrieved.
        ArgumentNotValid - If toFile is null.
      • getReplicaId

        public String getReplicaId()
        Method for retrieving the id for the replica where this message should be sent.
        Returns:
        The id for the replica.
      • toString

        public String toString()
        Generate String representation of this object.
        Overrides:
        toString in class NetarkivetMessage
        Returns:
        String representation of this object