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
 
Fields inherited from class dk.netarkivet.common.distribute.NetarkivetMessage
replyOfId
 
Constructor Summary
GetMessage(ChannelID to, ChannelID replyTo, java.lang.String arcfile, long index)
          Constructor.
 
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()
          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

GetMessage

public GetMessage(ChannelID to,
                  ChannelID replyTo,
                  java.lang.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 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()
Retrieval of a string representation of this instance.

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