dk.netarkivet.archive.bitarchive.distribute
Class BatchMessage

java.lang.Object
  extended by dk.netarkivet.common.distribute.NetarkivetMessage
      extended by dk.netarkivet.archive.distribute.ArchiveMessage
          extended by dk.netarkivet.archive.bitarchive.distribute.BatchMessage
All Implemented Interfaces:
java.io.Serializable

public class BatchMessage
extends ArchiveMessage

Container for batch jobs. Messages of this class should be sent to a BAMON queue from where they are collected by a BitarchiveMonitorServer. The BitarchiveMonitorServer also creates instances of this class and sends them to the individual bitarchive machines. The response to this message comes in the form of a BatchReplyMessage placed on the senders queue.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class dk.netarkivet.common.distribute.NetarkivetMessage
replyOfId
 
Constructor Summary
BatchMessage(ChannelID to, ChannelID replyTo, FileBatchJob job, java.lang.String replicaId)
          Creates a BatchMessage object which can be used to initiate a batch job.
BatchMessage(ChannelID to, FileBatchJob job, java.lang.String replicaId)
          Creates a BatchMessage object which can be used to initiate a batch job.
 
Method Summary
 void accept(ArchiveMessageVisitor v)
          Should be implemented as a part of the visitor pattern.
 FileBatchJob getJob()
          Retrieves batch job.
 java.lang.String getReplicaId()
          Returns the replica id.
 java.lang.String toString()
          Retrieval of a 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

BatchMessage

public BatchMessage(ChannelID to,
                    FileBatchJob job,
                    java.lang.String replicaId)
Creates a BatchMessage object which can be used to initiate a batch job. This is used by BitarchiveMonitorServer to create the message sent to the bitarchive machines.

Parameters:
to - The channel to which the batch message is to be sent
job - The batch job to be executed
replicaId - id of this replica.

BatchMessage

public BatchMessage(ChannelID to,
                    ChannelID replyTo,
                    FileBatchJob job,
                    java.lang.String replicaId)
Creates a BatchMessage object which can be used to initiate a batch job.

Parameters:
to - The channel to which the batch message is to be sent
replyTo - The channel whereto the reply to this message is sent.
job - The batch job to be executed
replicaId - id of this replica.
Method Detail

getJob

public FileBatchJob getJob()
Retrieves batch job.

Returns:
Batch job

getReplicaId

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

Returns:
the replica id

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 representation of this object.

Overrides:
toString in class NetarkivetMessage
Returns:
A string representation of the instance of class.
See Also:
NetarkivetMessage.toString()