public class AcePlugin extends AbstractPlugin
If the number of hits in the original search falls below a certain threshold for each and every target, then the ACE processing will be omitted and the original record forwarded instead. This requires the bytarget results to be available though, specifically that a client has requested bytarget and that the relay plug-in has pushed the results. If bytarget information is not available, this plug-in will go along with ACE processing.
The record document will be amended through the following process:Modifier and Type | Field and Description |
---|---|
static String |
ACE_RECORD_RESPONSE_KEY |
PluginConfiguration |
cfg |
Constructor and Description |
---|
AcePlugin() |
Modifier and Type | Method and Description |
---|---|
void |
doRecordOffsetRequest(StrategyContext ctx)
Runs record offset request on ACE session if present, otherwise on main Pazpar2 session.
|
Pz2AceRecordSession |
getClientWithAceRecords(ServiceRequest request,
Document recordDoc,
int sleepTime,
int clientExpirationTime)
Based on author and title on the provided Document recordDoc, this method
will create and execute an ACE query - on a separate pazpar2 session - and
return the resulting HTTP client to the main program.
|
String |
getPz2SessionId(ServiceRequest request) |
void |
serve(ServiceRequest request,
ServiceResponse response,
ChainControl chain)
Populates record with holdings data from an ACE search
|
void |
setErrorInfoOnRecord(Document responseDoc,
String errorText) |
getChainName, getConfig, getName, getNodeList, getXmlString, setChainName, setConfig, setName
public static final String ACE_RECORD_RESPONSE_KEY
public PluginConfiguration cfg
public void serve(ServiceRequest request, ServiceResponse response, ChainControl chain) throws IOException
serve
in interface Plugin
serve
in class AbstractPlugin
request
- HttpServlet requestresponse
- Response as received from and pushed back to the plugin chainchain
- Plug-in chain controlling the flowIOException
- of any kindpublic Pz2AceRecordSession getClientWithAceRecords(ServiceRequest request, Document recordDoc, int sleepTime, int clientExpirationTime) throws ServiceException
request
- Used for creating the pz2 proxy clientrecordDoc
- Used for creating the ACE querysleepTime
- Number of milliseconds to wait after ACE query (to improve chances
that subsequent record command will succeed)clientExpirationTime
- Number of milliseconds to wait after last client access before
retiring the client.StandardServiceException
InterruptedException
ServiceException
public String getPz2SessionId(ServiceRequest request)
public void doRecordOffsetRequest(StrategyContext ctx) throws IOException, com.indexdata.masterkey.pazpar2.client.exceptions.Pazpar2ErrorException, StandardServiceException
ctx
- IOException
com.indexdata.masterkey.pazpar2.client.exceptions.Pazpar2ErrorException
StandardServiceException
Copyright © 2008-2015 Index Data. All Rights Reserved.