Class GetMessage
- java.lang.Object
-
- dk.netarkivet.common.distribute.NetarkivetMessage
-
- dk.netarkivet.archive.distribute.ArchiveMessage
-
- dk.netarkivet.archive.bitarchive.distribute.GetMessage
-
- All Implemented Interfaces:
Serializable
public class GetMessage extends ArchiveMessage
Container for get requests.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class dk.netarkivet.common.distribute.NetarkivetMessage
replyOfId
-
-
Constructor Summary
Constructors Constructor Description GetMessage(ChannelID to, ChannelID replyTo, String arcfile, long index)
Constructor.
-
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
getArcFile()
Get name of the arc file.long
getIndex()
Index of the record to retrieve.BitarchiveRecord
getRecord()
Get the data retrieved from the arcfile.void
setRecord(BitarchiveRecord rec)
Register retrieved record.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
-
GetMessage
public GetMessage(ChannelID to, ChannelID replyTo, String arcfile, long index)
Constructor.- Parameters:
to
- Where the message should be sent.replyTo
- where the reply of this message should be sent.arcfile
- The name of the file to retrieve a arc-record from.index
- The offset of the arc-file.
-
-
Method Detail
-
getArcFile
public String getArcFile()
Get name of the arc file.- Returns:
- file name
-
getIndex
public long getIndex()
Index of the record to retrieve.- Returns:
- offset
-
setRecord
public void setRecord(BitarchiveRecord rec)
Register retrieved record.- Parameters:
rec
- Record retrieved from arcfile at offset index
-
getRecord
public BitarchiveRecord getRecord()
Get the data retrieved from the arcfile.- Returns:
- Record from arcfile
-
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 representation of this instance.- Overrides:
toString
in classNetarkivetMessage
- Returns:
- The string representation of this instance.
-
-