dk.netarkivet.archive.bitarchive.distribute
Class BatchReplyMessage

java.lang.Object
  extended by dk.netarkivet.common.distribute.NetarkivetMessage
      extended by dk.netarkivet.archive.distribute.ArchiveMessage
          extended by dk.netarkivet.archive.bitarchive.distribute.BatchReplyMessage
All Implemented Interfaces:
java.io.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
BatchReplyMessage(ChannelID to, ChannelID replyTo, java.lang.String originatingBatchMsgId, int filesProcessed, java.util.Collection<java.io.File> failedFiles, RemoteFile resultFile)
          Message to signal from BitarchiveMonitorServer that the batch job identified by originatingBatchMsgId is completed.
 
Method Summary
 void accept(ArchiveMessageVisitor v)
          Should be implemented as a part of the visitor pattern.
 java.util.Collection<java.io.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.
 java.lang.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BatchReplyMessage

public BatchReplyMessage(ChannelID to,
                         ChannelID replyTo,
                         java.lang.String originatingBatchMsgId,
                         int filesProcessed,
                         java.util.Collection<java.io.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 queue
replyTo - The queue that should receive replies.
originatingBatchMsgId - The Id of the BathMessage which gave rise to this reply
filesProcessed - The total number of file processed in this batch job
failedFiles - 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 java.util.Collection<java.io.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 class ArchiveMessage
Parameters:
v - A message visitor
See Also:
ArchiveMessageVisitor

toString

public java.lang.String toString()
Retrieval of a string representing the instance.

Overrides:
toString in class NetarkivetMessage
Returns:
A string representing this instance.