Package eu.clarin.sru.client
Class SRUExplainRequest
- java.lang.Object
-
- eu.clarin.sru.client.SRUExplainRequest
-
public class SRUExplainRequest extends Object
An object for performing a explain operation.- See Also:
SRUExplainHandler
, SRU Explain Operation
-
-
Field Summary
Fields Modifier and Type Field Description protected URI
baseURI
The baseURI of the SRU server.protected Map<String,String>
extraRequestData
A map of extra request data parameters.static String
MALFORMED_OMIT
for end-point conformance testing only.protected static String
OP_EXPLAIN
protected static String
OP_SCAN
protected static String
OP_SEARCH_RETRIEVE
protected static String
PARAM_EXTENSION_PREFIX
protected static String
PARAM_HTTP_ACCEPT
protected static String
PARAM_MAXIMUM_RECORDS
protected static String
PARAM_MAXIMUM_TERMS
protected static String
PARAM_OPERATION
protected static String
PARAM_QUERY
protected static String
PARAM_QUERY_TYPE
protected static String
PARAM_RECORD_PACKING
protected static String
PARAM_RECORD_SCHEMA
protected static String
PARAM_RECORD_X_PATH
protected static String
PARAM_RECORD_XML_ESCAPING
protected static String
PARAM_RENDER_BY
protected static String
PARAM_RESPONSE_POSITION
protected static String
PARAM_RESPONSE_TYPE
protected static String
PARAM_RESULT_SET_TTL
protected static String
PARAM_SCAN_CLAUSE
protected static String
PARAM_SORT_KEYS
protected static String
PARAM_START_RECORD
protected static String
PARAM_STYLESHEET
protected static String
PARAM_VERSION
protected static String
RECORD_PACKING_PACKED
protected static String
RECORD_PACKING_UNPACKED
protected static String
RECORD_XML_ESCAPING_XML
protected static String
RECORD_XML_ESCPAING_STRING
protected static String
RENDER_BY_CLIENT
protected static String
RENDER_BY_SERVER
protected SRUVersion
version
The version to be used for this request.protected static String
VERSION_1_1
protected static String
VERSION_1_2
static String
X_MALFORMED_OPERATION
for end-point conformance testing only.static String
X_MALFORMED_VERSION
for end-point conformance testing only.
-
Constructor Summary
Constructors Constructor Description SRUExplainRequest(String baseURI)
Constructor.SRUExplainRequest(URI baseURI)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URI
getBaseURI()
Get the baseURI of the SRU server.String
getExtraRequestData(String name)
Set the value of extra request parameter for this request.SRUOperation
getOperation()
Note: this method is not a part of public API.SRURecordXmlEscaping
getRecordXmlEscaping()
Get the recordXmlEscpaing (SRU 2.0) or recordPacking (SRU 1.1 and SRU 1.2) parameter of this request.URI
getRequestedURI()
Get the URI that was used to perform the request.SRUVersion
getRequestedVersion()
Get the version that was used to carry out this request.SRUVersion
getVersion()
Get the version for this request.boolean
isParseRecordDataEnabled()
Check, whether the record data of a explain response (ZeeRex record) shall be parsed or not.boolean
isStrictMode()
Get the SRU protocol conformance mode for this requestprotected URI
makeURI(SRUVersion defaultVersion)
void
setExtraRequestData(String name, String value)
Set an extra request parameter for this request.void
setParseRecordDataEnabled(boolean enabled)
Enable or disable parsing of explain record data (ZeeRex record) of the explain response.void
setRecordXmlEscaping(SRURecordXmlEscaping getRecordXmlEscaping)
Set the recordXmlEscpaing (SRU 2.0) or recordPacking (SRU 1.1 and SRU 1.2) parameter of this request.void
setStrictMode(boolean strictMode)
Set the SRU protocol conformance mode for this requestvoid
setVersion(SRUVersion version)
Set the version for this request.
-
-
-
Field Detail
-
PARAM_OPERATION
protected static final String PARAM_OPERATION
- See Also:
- Constant Field Values
-
PARAM_VERSION
protected static final String PARAM_VERSION
- See Also:
- Constant Field Values
-
PARAM_STYLESHEET
protected static final String PARAM_STYLESHEET
- See Also:
- Constant Field Values
-
PARAM_RENDER_BY
protected static final String PARAM_RENDER_BY
- See Also:
- Constant Field Values
-
PARAM_HTTP_ACCEPT
protected static final String PARAM_HTTP_ACCEPT
- See Also:
- Constant Field Values
-
PARAM_RESPONSE_TYPE
protected static final String PARAM_RESPONSE_TYPE
- See Also:
- Constant Field Values
-
PARAM_QUERY
protected static final String PARAM_QUERY
- See Also:
- Constant Field Values
-
PARAM_QUERY_TYPE
protected static final String PARAM_QUERY_TYPE
- See Also:
- Constant Field Values
-
PARAM_START_RECORD
protected static final String PARAM_START_RECORD
- See Also:
- Constant Field Values
-
PARAM_MAXIMUM_RECORDS
protected static final String PARAM_MAXIMUM_RECORDS
- See Also:
- Constant Field Values
-
PARAM_RECORD_XML_ESCAPING
protected static final String PARAM_RECORD_XML_ESCAPING
- See Also:
- Constant Field Values
-
PARAM_RECORD_PACKING
protected static final String PARAM_RECORD_PACKING
- See Also:
- Constant Field Values
-
PARAM_RECORD_SCHEMA
protected static final String PARAM_RECORD_SCHEMA
- See Also:
- Constant Field Values
-
PARAM_RECORD_X_PATH
protected static final String PARAM_RECORD_X_PATH
- See Also:
- Constant Field Values
-
PARAM_RESULT_SET_TTL
protected static final String PARAM_RESULT_SET_TTL
- See Also:
- Constant Field Values
-
PARAM_SORT_KEYS
protected static final String PARAM_SORT_KEYS
- See Also:
- Constant Field Values
-
PARAM_SCAN_CLAUSE
protected static final String PARAM_SCAN_CLAUSE
- See Also:
- Constant Field Values
-
PARAM_RESPONSE_POSITION
protected static final String PARAM_RESPONSE_POSITION
- See Also:
- Constant Field Values
-
PARAM_MAXIMUM_TERMS
protected static final String PARAM_MAXIMUM_TERMS
- See Also:
- Constant Field Values
-
OP_EXPLAIN
protected static final String OP_EXPLAIN
- See Also:
- Constant Field Values
-
OP_SCAN
protected static final String OP_SCAN
- See Also:
- Constant Field Values
-
OP_SEARCH_RETRIEVE
protected static final String OP_SEARCH_RETRIEVE
- See Also:
- Constant Field Values
-
VERSION_1_1
protected static final String VERSION_1_1
- See Also:
- Constant Field Values
-
VERSION_1_2
protected static final String VERSION_1_2
- See Also:
- Constant Field Values
-
RECORD_XML_ESCAPING_XML
protected static final String RECORD_XML_ESCAPING_XML
- See Also:
- Constant Field Values
-
RECORD_XML_ESCPAING_STRING
protected static final String RECORD_XML_ESCPAING_STRING
- See Also:
- Constant Field Values
-
RECORD_PACKING_PACKED
protected static final String RECORD_PACKING_PACKED
- See Also:
- Constant Field Values
-
RECORD_PACKING_UNPACKED
protected static final String RECORD_PACKING_UNPACKED
- See Also:
- Constant Field Values
-
RENDER_BY_CLIENT
protected static final String RENDER_BY_CLIENT
- See Also:
- Constant Field Values
-
RENDER_BY_SERVER
protected static final String RENDER_BY_SERVER
- See Also:
- Constant Field Values
-
PARAM_EXTENSION_PREFIX
protected static final String PARAM_EXTENSION_PREFIX
- See Also:
- Constant Field Values
-
X_MALFORMED_OPERATION
public static final String X_MALFORMED_OPERATION
for end-point conformance testing only. never use in production.- See Also:
- Constant Field Values
-
X_MALFORMED_VERSION
public static final String X_MALFORMED_VERSION
for end-point conformance testing only. never use in production.- See Also:
- Constant Field Values
-
MALFORMED_OMIT
public static final String MALFORMED_OMIT
for end-point conformance testing only. never use in production.- See Also:
- Constant Field Values
-
baseURI
protected final URI baseURI
The baseURI of the SRU server.
-
version
protected SRUVersion version
The version to be used for this request.
-
-
Method Detail
-
getRecordXmlEscaping
public SRURecordXmlEscaping getRecordXmlEscaping()
Get the recordXmlEscpaing (SRU 2.0) or recordPacking (SRU 1.1 and SRU 1.2) parameter of this request.- Returns:
- the requested record packing
- See Also:
SRURecordXmlEscaping
-
setRecordXmlEscaping
public void setRecordXmlEscaping(SRURecordXmlEscaping getRecordXmlEscaping)
Set the recordXmlEscpaing (SRU 2.0) or recordPacking (SRU 1.1 and SRU 1.2) parameter of this request.- Parameters:
getRecordXmlEscaping
- the requested record XML escaping- See Also:
SRURecordXmlEscaping
-
isParseRecordDataEnabled
public boolean isParseRecordDataEnabled()
Check, whether the record data of a explain response (ZeeRex record) shall be parsed or not.- Returns:
true
if parsing is enabled,false
otherwise
-
setParseRecordDataEnabled
public void setParseRecordDataEnabled(boolean enabled)
Enable or disable parsing of explain record data (ZeeRex record) of the explain response.- Parameters:
enabled
-true
enabled parsing,false
disables parsing
-
getOperation
public SRUOperation getOperation()
Note: this method is not a part of public API.- Returns:
- a operation constant for this request
-
getBaseURI
public URI getBaseURI()
Get the baseURI of the SRU server.- Returns:
- the baseURI of the SRU server
-
isStrictMode
public boolean isStrictMode()
Get the SRU protocol conformance mode for this request- Returns:
true
if the request will be performed in strict mode,false
if the request will be performed in a more tolerant mode
-
setStrictMode
public void setStrictMode(boolean strictMode)
Set the SRU protocol conformance mode for this request- Parameters:
strictMode
-true
if the request should be performed in strict mode,false
if the request should be performed client should in a more tolerant mode
-
setVersion
public void setVersion(SRUVersion version)
Set the version for this request.- Parameters:
version
- a version ofnull
for client default
-
getVersion
public SRUVersion getVersion()
Get the version for this request.- Returns:
- version for this request or
null
if client default is used
-
setExtraRequestData
public void setExtraRequestData(String name, String value)
Set an extra request parameter for this request.- Parameters:
name
- the name for the extra request data parametervalue
- the value for the extra request data parameter- Throws:
NullPointerException
- if any required argument isnull
IllegalArgumentException
- if any argument is invalid- See Also:
- SRU Extra Data / Extensions
-
getExtraRequestData
public String getExtraRequestData(String name)
Set the value of extra request parameter for this request.- Parameters:
name
- the name for the extra request data parameter- Returns:
- the value for the extra request data parameter or
null
if parameter was not set - Throws:
NullPointerException
- if any required argument isnull
IllegalArgumentException
- if any argument is invalid- See Also:
- SRU Extra Data / Extensions
-
getRequestedURI
public final URI getRequestedURI()
Get the URI that was used to perform the request. This method may only be called after the request was carried out, otherwise it will throw anIllegalStateException
.- Returns:
- the URI that was used to carry out this request
- Throws:
IllegalStateException
- if the request was not yet carried out
-
getRequestedVersion
public final SRUVersion getRequestedVersion()
Get the version that was used to carry out this request. This method may only be called after the request was carried out, otherwise it will throw anIllegalStateException
.- Returns:
- the version that was used to carry out this request
- Throws:
IllegalStateException
- if the request was not yet carried out
-
makeURI
protected final URI makeURI(SRUVersion defaultVersion) throws SRUClientException
- Throws:
SRUClientException
-
-