com.indexdata.masterkey.pazpar2.client
public abstract class AbstractPazpar2Client extends Object implements Pazpar2Client, Serializable
Modifier and Type | Class and Description |
---|---|
class |
AbstractPazpar2Client.HttpResponse |
Modifier and Type | Field and Description |
---|---|
protected Pazpar2ClientConfiguration |
cfg |
protected Pazpar2Session |
pazpar2Session |
protected Pazpar2ServiceDefinition |
serviceDefinition |
String |
XML_CT |
Modifier | Constructor and Description |
---|---|
protected |
AbstractPazpar2Client(Pazpar2ClientConfiguration proxyCfg) |
Modifier and Type | Method and Description |
---|---|
Pazpar2HttpResponse |
executeCommand(ClientCommand command,
OutputStream os)
Forwards any Pazpar2 command and stores the results in the OutputStream
|
protected AbstractPazpar2Client.HttpResponse |
executeSearch(OutputStream os)
Performs a Pazpar2 search command process
|
Pazpar2ClientConfiguration |
getConfiguration() |
Document |
getHit(String recid)
Returns a 'hit' by recid from the latest 'show' document.
|
Document |
getResults(String command)
Returns the results of the latest command of the kind processed by this proxy client
|
ClientCommand |
getSearchCommand()
Returns the latest search command executed through this proxy client
|
int |
getSearchCount()
Returns the number of searches so far on this pazpar2 client object
|
String |
getSessionId()
Returns current Pazpar2 session ID
|
long |
getTimeStamp(String command,
int searchNumber)
Returns the number of times this command has be executed with a result
since the current search was initiated.
|
protected void |
pipeStream(InputStream is,
OutputStream os)
Pipes the last response input stream to a specified output stream.
|
protected AbstractPazpar2Client.HttpResponse |
post(String queryString,
Document entity) |
Document |
recordRequest(String recid)
Makes a non-managed/transient pazpar2 record request.
|
Document |
recordRequest(String recid,
int offset)
Makes a non-managed/transient pazpar2 record offset request.
|
protected AbstractPazpar2Client.HttpResponse |
request(String queryString)
Send pazpar2 protocol request.
|
protected abstract boolean |
requiresForcedInit() |
Document |
searchRequest(String queryString)
Makes a non-managed pazpar2 search request on a cloned pazpar2 client
This is for 'embedded' pazpar2 requests by other plug-ins than Relay and
independently of the main pazpar2 session.
|
protected void |
sendInit(boolean clear)
Initializes a Pazpar2 session and stores the Pazpar2 session ID with the
proxy client
|
protected void |
sendInit(Document service) |
protected AbstractPazpar2Client.HttpResponse |
sendRequest(String encodedParams)
Sends a Pazpar2 request off to the configured Pazpar2 URL and with the
provided parameters
|
protected boolean |
sessionIsAlive()
Sends a Pazpar2 ping command for the current Pazpar2 session ID (if any
exists) Returns true if the Pazpar2 session ID exists and Pazpar2 says the
session is alive
|
void |
setSearchCommand(ClientCommand command)
Stores the current search command on the proxy client
|
void |
setTimeStamp(String command,
int searchCount)
Time stamps most recent request of this command per executed search
|
Document |
showRequest()
Makes a non-managed/transient pazpar2 show request.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cloneMe, getSettings, init
protected Pazpar2ClientConfiguration cfg
protected Pazpar2ServiceDefinition serviceDefinition
protected Pazpar2Session pazpar2Session
public final String XML_CT
protected AbstractPazpar2Client(Pazpar2ClientConfiguration proxyCfg) throws ProxyErrorException
ProxyErrorException
protected abstract boolean requiresForcedInit()
public String getSessionId()
getSessionId
in interface Pazpar2Client
public Pazpar2ClientConfiguration getConfiguration()
getConfiguration
in interface Pazpar2Client
public void setSearchCommand(ClientCommand command)
setSearchCommand
in interface Pazpar2Client
public int getSearchCount()
Pazpar2Client
getSearchCount
in interface Pazpar2Client
public ClientCommand getSearchCommand()
getSearchCommand
in interface Pazpar2Client
protected AbstractPazpar2Client.HttpResponse executeSearch(OutputStream os) throws IOException, Pazpar2ErrorException
os
- OutputStream to pipe results toIOException
Pazpar2ErrorException
public final Pazpar2HttpResponse executeCommand(ClientCommand command, OutputStream os) throws IOException, Pazpar2ErrorException
Pazpar2Client
executeCommand
in interface Pazpar2Client
IOException
Pazpar2ErrorException
public void setTimeStamp(String command, int searchCount)
setTimeStamp
in interface Pazpar2Client
command
- public long getTimeStamp(String command, int searchNumber)
getTimeStamp
in interface Pazpar2Client
public Document getResults(String command)
Pazpar2Client
getResults
in interface Pazpar2Client
protected AbstractPazpar2Client.HttpResponse request(String queryString) throws Pazpar2IOException, Pazpar2ErrorException
queryString
- url encoded query stringcom.indexdata.masterkey.pazpar2.exceptions.Pazpar2IOException
com.indexdata.masterkey.pazpar2.exceptions.Pazpar2ErrorException
com.indexdata.masterkey.pazpar2.exceptions.Pazpar2MalformedOutputException
Pazpar2IOException
Pazpar2ErrorException
protected void pipeStream(InputStream is, OutputStream os) throws IOException
os
- output stream to pipe toIOException
protected void sendInit(boolean clear) throws Pazpar2IOException, Pazpar2ErrorException
clear
- Pazpar2IOException
Pazpar2ErrorException
protected void sendInit(Document service) throws Pazpar2IOException, Pazpar2ErrorException
protected boolean sessionIsAlive()
protected AbstractPazpar2Client.HttpResponse sendRequest(String encodedParams) throws Pazpar2IOException, Pazpar2ErrorException
encodedParams
- Pazpar2IOException
Pazpar2ErrorException
protected AbstractPazpar2Client.HttpResponse post(String queryString, Document entity) throws Pazpar2IOException, Pazpar2ErrorException
public Document getHit(String recid)
getHit
in interface Pazpar2Client
public Document recordRequest(String recid, int offset) throws Pazpar2ErrorException, Pazpar2IOException
Pazpar2Client
recordRequest
in interface Pazpar2Client
Pazpar2ErrorException
Pazpar2IOException
public Document recordRequest(String recid) throws Pazpar2ErrorException, Pazpar2IOException
Pazpar2Client
recordRequest
in interface Pazpar2Client
Pazpar2ErrorException
Pazpar2IOException
public Document showRequest() throws Pazpar2ErrorException, Pazpar2IOException
Pazpar2Client
showRequest
in interface Pazpar2Client
Pazpar2ErrorException
Pazpar2IOException
public Document searchRequest(String queryString) throws Pazpar2ErrorException, Pazpar2IOException
Pazpar2Client
searchRequest
in interface Pazpar2Client
Pazpar2ErrorException
Pazpar2IOException
Copyright © 2014. All rights reserved.