Class BatchReplyMessage
- java.lang.Object
-
- dk.netarkivet.common.distribute.NetarkivetMessage
-
- dk.netarkivet.archive.distribute.ArchiveMessage
-
- dk.netarkivet.archive.bitarchive.distribute.BatchReplyMessage
-
- All Implemented Interfaces:
Serializable
public class BatchReplyMessage extends ArchiveMessage
Message class used by the bit archive monitor to notify the ArcRepository of a completed batch job.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class dk.netarkivet.common.distribute.NetarkivetMessage
replyOfId
-
-
Constructor Summary
Constructors Constructor Description BatchReplyMessage(ChannelID to, ChannelID replyTo, String originatingBatchMsgId, int filesProcessed, Collection<File> failedFiles, RemoteFile resultFile)
Message to signal from BitarchiveMonitorServer that the batch job identified by originatingBatchMsgId is completed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(ArchiveMessageVisitor v)
Should be implemented as a part of the visitor pattern.Collection<File>
getFilesFailed()
Retrieves the collection of files, where this batchjob has failed.int
getNoOfFilesProcessed()
Returns the total number of files processed by this batch job.RemoteFile
getResultFile()
Returns the RemoteFile that contains the output of this batchjob.String
toString()
Retrieval of a string representing the instance.-
Methods inherited from class dk.netarkivet.common.distribute.NetarkivetMessage
getErrMsg, getID, getReplyOfId, getReplyTo, getTo, hasBeenSent, isOk, setNotOk, setNotOk
-
-
-
-
Constructor Detail
-
BatchReplyMessage
public BatchReplyMessage(ChannelID to, ChannelID replyTo, String originatingBatchMsgId, int filesProcessed, Collection<File> failedFiles, RemoteFile resultFile) throws ArgumentNotValid
Message to signal from BitarchiveMonitorServer that the batch job identified by originatingBatchMsgId is completed. Holds status information: list of files processed and a list of files on which the batch job failed- Parameters:
to
- The queue to which this message is to be sent. This will normally be the ARCREPOS queuereplyTo
- The queue that should receive replies.originatingBatchMsgId
- The Id of the BathMessage which gave rise to this replyfilesProcessed
- The total number of file processed in this batch jobfailedFiles
- A Collection of strings with the names of files on which this batch job failed. May be null or empty for no errors.resultFile
- The RemoteFile containing the output from the batch job, or null if an error occurred that prevented the creation of the file.- Throws:
ArgumentNotValid
- if the input parameters are not meaningful
-
-
Method Detail
-
getNoOfFilesProcessed
public int getNoOfFilesProcessed()
Returns the total number of files processed by this batch job.- Returns:
- the number of files
-
getFilesFailed
public Collection<File> getFilesFailed()
Retrieves the collection of files, where this batchjob has failed. (may be null)- Returns:
- The collection of failed files
-
getResultFile
public RemoteFile getResultFile()
Returns the RemoteFile that contains the output of this batchjob. May be null if the message is not ok.- Returns:
- the RemoteFile mentioned above. May be null, if the message is not ok.
-
accept
public void accept(ArchiveMessageVisitor v)
Should be implemented as a part of the visitor pattern. fx.: public void accept(ArchiveMessageVisitor v) { v.visit(this); }- Specified by:
accept
in classArchiveMessage
- Parameters:
v
- A message visitor- See Also:
ArchiveMessageVisitor
-
toString
public String toString()
Retrieval of a string representing the instance.- Overrides:
toString
in classNetarkivetMessage
- Returns:
- A string representing this instance.
-
-