Class GetAllChecksumsMessage
- java.lang.Object
-
- dk.netarkivet.common.distribute.NetarkivetMessage
-
- dk.netarkivet.archive.distribute.ArchiveMessage
-
- dk.netarkivet.archive.checksum.distribute.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
-
-
Field Summary
-
Fields inherited from class dk.netarkivet.common.distribute.NetarkivetMessage
replyOfId
-
-
Constructor Summary
Constructors Constructor Description GetAllChecksumsMessage(ChannelID to, ChannelID replyTo, String repId)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(ArchiveMessageVisitor v)
Accept visitation.void
getData(File toFile)
Method for retrieving the resulting file.String
getReplicaId()
Method for retrieving the id for the replica where this message should be sent.void
setFile(File file)
Method for setting the resulting file.String
toString()
Generate String representation of this object.-
Methods inherited from class dk.netarkivet.common.distribute.NetarkivetMessage
getErrMsg, getID, getReplyOfId, getReplyTo, getTo, hasBeenSent, isOk, setNotOk, setNotOk
-
-
-
-
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 classNetarkivetMessage
- Returns:
- String representation of this object
-
accept
public void accept(ArchiveMessageVisitor v)
Accept visitation.- Specified by:
accept
in classArchiveMessage
- Parameters:
v
- The ArchiveMessageVisitor which accepts this message.- See Also:
ArchiveMessageVisitor
-
-