Class RemoveAndGetFileMessage

  • All Implemented Interfaces:
    java.io.Serializable

    public class RemoveAndGetFileMessage
    extends ArchiveMessage
    Message requesting a file to be removed and returned from a bitarchive. Messages is forwarded through arcrepository, but reponds directly to sender.
    See Also:
    Serialized Form
    • Constructor Detail

      • RemoveAndGetFileMessage

        public RemoveAndGetFileMessage​(ChannelID to,
                                       ChannelID replyTo,
                                       java.lang.String fileName,
                                       java.lang.String replicaId,
                                       java.lang.String checksum,
                                       java.lang.String credentials)
        Constructor.
        Parameters:
        to - Where to send the message.
        replyTo - Where the reply of the message should be sent.
        fileName - The name of the file to remove and retrieve.
        replicaId - The id of the replica to sent it to.
        checksum - The checksum of the bad file to remove and retrieve.
        credentials - The right credentials for the operation.
    • Method Detail

      • setFile

        public void setFile​(java.io.File data)
                     throws ArgumentNotValid
        Set the file this message should remove and return. Note: This will make a remote file handle for the file.
        Parameters:
        data - Content of the file to retrieve
        Throws:
        ArgumentNotValid - If the data file is null.
      • getData

        public java.io.File getData()
                             throws IOFailure
        Writes the the content of the retrieved file into a local file. Note: This is transferred through a remote file handle, and then the handle is invalidated. This method may only be called once.
        Returns:
        file content
        Throws:
        IOFailure - on error reading the file
      • getReplicaId

        public java.lang.String getReplicaId()
        Retrieve the replica id.
        Returns:
        replica id
      • getFileName

        public java.lang.String getFileName()
        Get name of the file to retrieve.
        Returns:
        file name
      • getCheckSum

        public java.lang.String getCheckSum()
        Get the checksum of the file to remove.
        Returns:
        the checksum of the file to remove
      • getCredentials

        public java.lang.String getCredentials()
        Get the credentials for the remove operation.
        Returns:
        the credentials for the remove operation
      • clearBuffer

        public void clearBuffer()
        Clear content buffer.