|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.common.distribute.NetarkivetMessage dk.netarkivet.archive.distribute.ArchiveMessage dk.netarkivet.archive.indexserver.distribute.IndexRequestMessage
public class IndexRequestMessage
Message for requesting and index from the index server, and for giving back the reply.
Field Summary |
---|
Fields inherited from class dk.netarkivet.common.distribute.NetarkivetMessage |
---|
replyOfId |
Constructor Summary | |
---|---|
IndexRequestMessage(RequestType requestType,
java.util.Set<java.lang.Long> jobSet)
Generate an index request message. |
|
IndexRequestMessage(RequestType requestType,
java.util.Set<java.lang.Long> jobSet,
ChannelID replyTo,
boolean returnIndex,
java.lang.Long harvestId)
Generate an IndexRequestMessage that can send its reply to a specific channel. |
Method Summary | |
---|---|
void |
accept(ArchiveMessageVisitor v)
Calls visit on the visitor. |
java.util.Set<java.lang.Long> |
getFoundJobs()
Get the set of jobs for which the index is found. |
java.lang.Long |
getHarvestId()
|
java.util.Set<java.lang.Long> |
getRequestedJobs()
Get list of requested jobs. |
RequestType |
getRequestType()
Get the request type. |
RemoteFile |
getResultFile()
The index over the requested jobs. |
java.util.List<RemoteFile> |
getResultFiles()
Returns the list of result files for the requested jobs. |
boolean |
isIndexIsStoredInDirectory()
If true, this message may carry multiple files that should be stored in a directory. |
boolean |
mustReturnIndex()
|
void |
setFoundJobs(java.util.Set<java.lang.Long> foundJobs)
On reply, set the set of jobs for which an index is found. |
void |
setResultFile(RemoteFile resultFile)
On reply, set remote file containing index of requested jobs. |
void |
setResultFiles(java.util.List<RemoteFile> resultFiles)
Set several result files making up an index of requested jobs. |
Methods inherited from class dk.netarkivet.common.distribute.NetarkivetMessage |
---|
getErrMsg, getID, getReplyOfId, getReplyTo, getTo, hasBeenSent, isOk, setNotOk, setNotOk, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IndexRequestMessage(RequestType requestType, java.util.Set<java.lang.Long> jobSet) throws ArgumentNotValid
requestType
- Type of index requested.jobSet
- Type of index requested.
ArgumentNotValid
- if any argument is null.public IndexRequestMessage(RequestType requestType, java.util.Set<java.lang.Long> jobSet, ChannelID replyTo, boolean returnIndex, java.lang.Long harvestId)
requestType
- Type of index requested.jobSet
- Type of index requested.replyTo
- The channel to send the reply to.returnIndex
- If true, include the index in the reply.harvestId
- The harvestId needing this index for its jobsMethod Detail |
---|
public java.lang.Long getHarvestId()
public boolean mustReturnIndex()
public void accept(ArchiveMessageVisitor v)
accept
in class ArchiveMessage
v
- The visitor of this message.ArchiveMessageVisitor
public java.util.Set<java.lang.Long> getRequestedJobs()
public RequestType getRequestType()
public java.util.Set<java.lang.Long> getFoundJobs()
public void setFoundJobs(java.util.Set<java.lang.Long> foundJobs) throws ArgumentNotValid
foundJobs
- The set of jobs for which the index is found
ArgumentNotValid
- on null argumentpublic RemoteFile getResultFile() throws IllegalState
IllegalState
- if this message is a multiFile message.public java.util.List<RemoteFile> getResultFiles() throws IllegalState
IllegalState
- if this message is not a multiFile message.public void setResultFile(RemoteFile resultFile) throws IllegalState, ArgumentNotValid
resultFile
- RemoteFile containing index over requested jobs.
ArgumentNotValid
- on null argument.
IllegalState
- if the result file has already been set.public void setResultFiles(java.util.List<RemoteFile> resultFiles) throws IllegalState, ArgumentNotValid
resultFiles
- RemoteFiles containing index over requested jobs.
ArgumentNotValid
- on null argument or null element in list.
IllegalState
- if the result files have already been set.public boolean isIndexIsStoredInDirectory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |