dk.netarkivet.archive.bitarchive.distribute
Class GetMessage

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

public class GetMessage
extends ArchiveMessage

Container for get requests.

See Also:
Serialized Form

Field Summary
(package private)  BitarchiveRecord record
          the retrieved record.
 
Fields inherited from class dk.netarkivet.common.distribute.NetarkivetMessage
replyOfId
 
Constructor Summary
GetMessage(ChannelID to, ChannelID replyTo, java.lang.String arcfile, long index)
           
 
Method Summary
 void accept(ArchiveMessageVisitor v)
          Should be implemented as a part of the visitor pattern.
 java.lang.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.
 java.lang.String toString()
          Returns a string containing: : To ReplyTo [:error message].
 
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
 

Field Detail

record

BitarchiveRecord record
the retrieved record.

Constructor Detail

GetMessage

public GetMessage(ChannelID to,
                  ChannelID replyTo,
                  java.lang.String arcfile,
                  long index)
Method Detail

getArcFile

public java.lang.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 class ArchiveMessage
Parameters:
v - A message visitor
See Also:
ArchiveMessageVisitor

toString

public java.lang.String toString()
Description copied from class: NetarkivetMessage
Returns a string containing: : To ReplyTo [:error message].

Overrides:
toString in class NetarkivetMessage
Returns:
String representation of Message.