public class CorrectMessage extends ArchiveMessage
replyOfId
Constructor and Description |
---|
CorrectMessage(ChannelID to,
ChannelID replyTo,
String badChecksum,
RemoteFile rf,
String repId,
String cred)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(ArchiveMessageVisitor v)
Accept this message.
|
String |
getArcfileName()
Retrieve name of the uploaded file.
|
RemoteFile |
getCorrectFile()
Method for retrieving the correct file.
|
String |
getCredentials()
The credentials to allow correction of an entry in the archive.
|
void |
getData(File toFile)
Retrieves the content of the remoteFile and writes it into the local file.
|
String |
getIncorrectChecksum()
Method for retrieving the 'bad' checksum which should correspond to the checksum of the current entry on this
file in the archive.
|
RemoteFile |
getRemovedFile()
Returns the removed file.
|
String |
getReplicaId()
Method for retrieving the replica, where this message should be sent.
|
void |
setRemovedFile(RemoteFile rf)
Sets the removed file.
|
String |
toString()
Generate String representation of this object.
|
getErrMsg, getID, getReplyOfId, getReplyTo, getTo, hasBeenSent, isOk, setNotOk, setNotOk
public CorrectMessage(ChannelID to, ChannelID replyTo, String badChecksum, RemoteFile rf, String repId, String cred) throws ArgumentNotValid
to
- Where the message should be sent.replyTo
- Who is sending this message.badChecksum
- The checksum of the 'bad' entry.rf
- The remote file to replace the 'bad' entry.repId
- The identification of the replica, where this message should be sent.cred
- The credentials to allow the correction of an entry.ArgumentNotValid
- If any of the arguments are null, or any of the strings are empty.public String getArcfileName()
public void getData(File toFile) throws IOFailure, ArgumentNotValid
toFile
- where to write the contentIOFailure
- on error reading the remote file or writing the local fileArgumentNotValid
- If toFile is null.public RemoteFile getCorrectFile()
public String getIncorrectChecksum()
public String getReplicaId()
public String getCredentials()
public RemoteFile getRemovedFile() throws IOFailure
IOFailure
- If the removed file is null.public void setRemovedFile(RemoteFile rf) throws ArgumentNotValid
rf
- The removed file which is part of the reply of this message.ArgumentNotValid
- If the remote file is null.public void accept(ArchiveMessageVisitor v)
accept
in class ArchiveMessage
v
- The message visitor accepting this message.ArchiveMessageVisitor
public String toString()
toString
in class NetarkivetMessage
Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.