Class GetChecksumMessage

  • All Implemented Interfaces:
    Serializable

    public class GetChecksumMessage
    extends ArchiveMessage
    The GetChecksumMessage has the purpose to retrieve the checksum of a specific file.

    This is checksum replica alternative to sending a ChecksumBatchJob, with a filename limitation.

    See Also:
    Serialized Form
    • Constructor Detail

      • GetChecksumMessage

        public GetChecksumMessage​(ChannelID to,
                                  ChannelID replyTo,
                                  String filename,
                                  String repId)
        Constructor.
        Parameters:
        to - Where this message should be sent.
        replyTo - Where the reply for this message should be sent.
        filename - The name of the file.
        repId - The id of the replica where the message is to be sent.
    • Method Detail

      • getArcfileName

        public String getArcfileName()
        Retrieve name of the uploaded file.
        Returns:
        current value of arcfileName
      • getReplicaId

        public String getReplicaId()
        Retrieves the replica id.
        Returns:
        The replica id.
      • getChecksum

        public String getChecksum()
        Retrieves the checksum. This method is intended for the reply. If this checksum has not been sent, then the value is null.
        Returns:
        The retrieved checksum, or null if the entry was not found in the archive.
      • getIsReply

        public boolean getIsReply()
        Retrieves the variable for telling whether this it currently is a reply to this message or not.
        Returns:
        Whether this is a reply or not.
      • setIsReply

        public void setIsReply()
        Set that this is a reply. This should be set when there is replied to this message. isReply = true.
      • setChecksum

        public void setChecksum​(String cs)
                         throws ArgumentNotValid
        Method for returning the result of the checksum.
        Parameters:
        cs - The checksum.
        Throws:
        ArgumentNotValid - If the checksum which is attempted to be set is either null or an empty string.
      • toString

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