public class RemoveAndGetFileMessage extends ArchiveMessage
replyOfId
Constructor and Description |
---|
RemoveAndGetFileMessage(ChannelID to,
ChannelID replyTo,
String fileName,
String replicaId,
String checksum,
String credentials)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(ArchiveMessageVisitor v)
Should be implemented as a part of the visitor pattern.
|
void |
clearBuffer()
Clear content buffer.
|
String |
getCheckSum()
Get the checksum of the file to remove.
|
String |
getCredentials()
Get the credentials for the remove operation.
|
File |
getData()
Writes the the content of the retrieved file into a local file.
|
String |
getFileName()
Get name of the file to retrieve.
|
RemoteFile |
getRemoteFile()
Returns the remote file.
|
String |
getReplicaId()
Retrieve the replica id.
|
void |
setFile(File data)
Set the file this message should remove and return.
|
String |
toString()
Retrieval of a string representation of this instance.
|
getErrMsg, getID, getReplyOfId, getReplyTo, getTo, hasBeenSent, isOk, setNotOk, setNotOk
public RemoveAndGetFileMessage(ChannelID to, ChannelID replyTo, String fileName, String replicaId, String checksum, String credentials)
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.public void setFile(File data) throws ArgumentNotValid
data
- Content of the file to retrieveArgumentNotValid
- If the data file is null.public File getData() throws IOFailure
IOFailure
- on error reading the filepublic RemoteFile getRemoteFile()
public String getReplicaId()
public String getFileName()
public String getCheckSum()
public String getCredentials()
public void clearBuffer()
public void accept(ArchiveMessageVisitor v)
accept
in class ArchiveMessage
v
- A message visitorArchiveMessageVisitor
public String toString()
toString
in class NetarkivetMessage
NetarkivetMessage.toString()
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.