Class HeartBeatMessage
- java.lang.Object
-
- dk.netarkivet.common.distribute.NetarkivetMessage
-
- dk.netarkivet.archive.distribute.ArchiveMessage
-
- dk.netarkivet.archive.bitarchive.distribute.HeartBeatMessage
-
- All Implemented Interfaces:
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
Constructors Constructor Description HeartBeatMessage(ChannelID inReceiver, String applicationId)
Creates a heartbeat message.
-
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.String
getBitarchiveID()
long
getTimestamp()
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
-
-
-
-
Constructor Detail
-
HeartBeatMessage
public HeartBeatMessage(ChannelID inReceiver, 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 String getBitarchiveID()
- Returns:
- id of the application that generated the heartbeat.
-
toString
public String toString()
Retrieval of a string representation of this instance.- Overrides:
toString
in classNetarkivetMessage
- 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 classArchiveMessage
- Parameters:
v
- A message visitor- See Also:
ArchiveMessageVisitor
-
-