Class GetChecksumMessage
- java.lang.Object
-
- dk.netarkivet.common.distribute.NetarkivetMessage
-
- dk.netarkivet.archive.distribute.ArchiveMessage
-
- dk.netarkivet.archive.checksum.distribute.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
-
-
Field Summary
-
Fields inherited from class dk.netarkivet.common.distribute.NetarkivetMessage
replyOfId
-
-
Constructor Summary
Constructors Constructor Description GetChecksumMessage(ChannelID to, ChannelID replyTo, String filename, String repId)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(ArchiveMessageVisitor v)
Accept this message.String
getArcfileName()
Retrieve name of the uploaded file.String
getChecksum()
Retrieves the checksum.boolean
getIsReply()
Retrieves the variable for telling whether this it currently is a reply to this message or not.String
getReplicaId()
Retrieves the replica id.void
setChecksum(String cs)
Method for returning the result of the checksum.void
setIsReply()
Set that this is a reply.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
-
-
-
-
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.
-
accept
public void accept(ArchiveMessageVisitor v)
Accept this message.- Specified by:
accept
in classArchiveMessage
- Parameters:
v
- The message visitor accepting this message.- See Also:
ArchiveMessageVisitor
-
toString
public String toString()
Generate String representation of this object.- Overrides:
toString
in classNetarkivetMessage
- Returns:
- String representation of this object
-
-