dk.netarkivet.archive.bitarchive.distribute
Class HeartBeatMessage

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

public class HeartBeatMessage
extends ArchiveMessage

Simple class representing a HeartBeat message from a bit archive application. A heartbeat has an applicationId, that identifies the application that generated the heartbeat. TODO This class should probably contain more status data from bit archive application later.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class dk.netarkivet.common.distribute.NetarkivetMessage
replyOfId
 
Constructor Summary
HeartBeatMessage(ChannelID inReceiver, java.lang.String applicationId)
          Creates a heartbeat message.
 
Method Summary
 void accept(ArchiveMessageVisitor v)
          Should be implemented as a part of the visitor pattern.
 java.lang.String getBitarchiveID()
           
 long getTimestamp()
           
 java.lang.String toString()
          Retrieval of a string representation of this 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

HeartBeatMessage

public HeartBeatMessage(ChannelID inReceiver,
                        java.lang.String applicationId)
Creates a heartbeat message. The time of the heartbeat is set to the creation of this object.

Parameters:
inReceiver - ChannelID for the recipient of this message.
applicationId - - id of the application that sent the heartbeat
Method Detail

getTimestamp

public long getTimestamp()
Returns:
time of heartbeat occurrence.

getBitarchiveID

public java.lang.String getBitarchiveID()
Returns:
id of the application that generated the heartbeat.

toString

public java.lang.String toString()
Retrieval of a string representation of this instance.

Overrides:
toString in class NetarkivetMessage
Returns:
The string representation of this instance.

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