public class IndexRequestClient extends MultiFileBasedCache<Long> implements JobIndexCache
Allows to request an index of some type over a list of jobs. Factory method will return the index request client of the type wished.
Modifier and Type | Field and Description |
---|---|
static String |
INDEXREQUEST_TIMEOUT
settings.common.indexClient.indexRequestTimeout:
Setting for the amount of time, in milliseconds, we should wait for replies when issuing a call to generate an index over some jobs. |
static String |
INDEXREQUEST_USE_LOCAL_FTPSERVER
settings.common.indexClient.useLocalFtpServer:
Setting for using the ftpserver assigned to the client instead of the one assigned to the indexserver. |
cacheDir
Modifier and Type | Method and Description |
---|---|
protected Set<Long> |
cacheData(Set<Long> jobSet)
This method makes sure the actual caching of underlying data is done using the index server.
|
protected long |
getIndexTimeout()
How long should we wait for index replies?
|
static IndexRequestClient |
getInstance(RequestType type)
Factory method returning an IndexRequestClient for the given type of index cache.
|
void |
requestIndex(Set<Long> jobSet,
Long harvestId)
Method to request an Index without having the result sent right away.
|
protected boolean |
useLocalFtpserver()
Check if we should use local ftpserver or not, provided you are using FTPRemoteFile as the
CommonSettings.REMOTE_FILE_CLASS . |
getCacheFile
cache, get, getCacheDir, getIndex
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getIndex
public static final String INDEXREQUEST_TIMEOUT
public static final String INDEXREQUEST_USE_LOCAL_FTPSERVER
public static IndexRequestClient getInstance(RequestType type) throws ArgumentNotValid
type
- The type of this cache.ArgumentNotValid
- if type is null.protected Set<Long> cacheData(Set<Long> jobSet) throws IOFailure, IllegalState, ArgumentNotValid
This method should not be called directly! Instead call cache() or getIndex().
cacheData
in class FileBasedCache<Set<Long>>
jobSet
- The set of job IDs.ArgumentNotValid
- on null argument; or on wrong parameters in replied message.IOFailure
- on trouble in communication or invalid reply types.IllegalState
- if message is not OK.FileBasedCache.cache(T)
,
FileBasedCache.getIndex(T)
protected long getIndexTimeout()
protected boolean useLocalFtpserver()
CommonSettings.REMOTE_FILE_CLASS
. This always returns false, when
CommonSettings.REMOTE_FILE_CLASS
is not FTPRemoteFile
.public void requestIndex(Set<Long> jobSet, Long harvestId) throws IOFailure, IllegalState, ArgumentNotValid
requestIndex
in interface JobIndexCache
jobSet
- The set of job IDs.harvestId
- The ID of the harvest requesting this index.IOFailure
- On trouble in communication or invalid reply types.IllegalState
- if message is not OK.ArgumentNotValid
- if the jobSet is null.Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.