public class IndexRequestMessage extends HarvesterMessage
replyOfId
Constructor and Description |
---|
IndexRequestMessage(RequestType requestType,
Set<Long> jobSet,
ChannelID replyTo,
boolean returnIndex,
Long harvestId)
Generate an IndexRequestMessage that can send its reply to a specific channel.
|
IndexRequestMessage(RequestType requestType,
Set<Long> jobSet,
RemoteFileSettings ftpconnectionInfo)
Generate an index request message.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(HarvesterMessageVisitor v)
Calls visit on the visitor.
|
Set<Long> |
getFoundJobs()
Get the set of jobs for which the index is found.
|
Long |
getHarvestId() |
RemoteFileSettings |
getRemoteFileSettings() |
Set<Long> |
getRequestedJobs()
Get list of requested jobs.
|
RequestType |
getRequestType()
Get the request type.
|
RemoteFile |
getResultFile()
The index over the requested jobs.
|
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(Set<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(List<RemoteFile> resultFiles)
Set several result files making up an index of requested jobs.
|
getErrMsg, getID, getReplyOfId, getReplyTo, getTo, hasBeenSent, isOk, setNotOk, setNotOk, toString
public IndexRequestMessage(RequestType requestType, Set<Long> jobSet, RemoteFileSettings ftpconnectionInfo) throws ArgumentNotValid
requestType
- Type of index requested.jobSet
- Type of index requested.ftpconnectionInfo
- FTP connection parameters to be used (if null, we use the local settings)ArgumentNotValid
- if any argument is null.public IndexRequestMessage(RequestType requestType, Set<Long> jobSet, ChannelID replyTo, boolean returnIndex, 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 jobspublic RemoteFileSettings getRemoteFileSettings()
public Long getHarvestId()
public boolean mustReturnIndex()
public void accept(HarvesterMessageVisitor v)
accept
in class HarvesterMessage
v
- The visitor of this message.HarvesterMessageVisitor
public Set<Long> getRequestedJobs()
public RequestType getRequestType()
public Set<Long> getFoundJobs()
public void setFoundJobs(Set<Long> foundJobs) throws ArgumentNotValid
foundJobs
- The set of jobs for which the index is foundArgumentNotValid
- on null argumentpublic RemoteFile getResultFile() throws IllegalState
IllegalState
- if this message is a multiFile message.public 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(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()
Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.