dk.netarkivet.archive.checksum.distribute
Class GetChecksumMessage

java.lang.Object
  extended by dk.netarkivet.common.distribute.NetarkivetMessage
      extended by dk.netarkivet.archive.distribute.ArchiveMessage
          extended by dk.netarkivet.archive.checksum.distribute.GetChecksumMessage
All Implemented Interfaces:
java.io.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
GetChecksumMessage(ChannelID to, ChannelID replyTo, java.lang.String filename, java.lang.String repId)
          Constructor.
 
Method Summary
 void accept(ArchiveMessageVisitor v)
          Accept this message.
 java.lang.String getArcfileName()
          Retrieve name of the uploaded file.
 java.lang.String getChecksum()
          Retrieves the checksum.
 boolean getIsReply()
          Retrieves the variable for telling whether this it currently is a reply to this message or not.
 java.lang.String getReplicaId()
          Retrieves the replica id.
 void setChecksum(java.lang.String cs)
          Method for returning the result of the checksum.
 void setIsReply()
          Set that this is a reply.
 java.lang.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GetChecksumMessage

public GetChecksumMessage(ChannelID to,
                          ChannelID replyTo,
                          java.lang.String filename,
                          java.lang.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 java.lang.String getArcfileName()
Retrieve name of the uploaded file.

Returns:
current value of arcfileName

getReplicaId

public java.lang.String getReplicaId()
Retrieves the replica id.

Returns:
The replica id.

getChecksum

public java.lang.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(java.lang.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 class ArchiveMessage
Parameters:
v - The message visitor accepting this message.
See Also:
ArchiveMessageVisitor

toString

public java.lang.String toString()
Generate String representation of this object.

Overrides:
toString in class NetarkivetMessage
Returns:
String representation of this object