Package eu.clarin.sru.client
Class SRUScanRequest
- java.lang.Object
-
- eu.clarin.sru.client.SRUScanRequest
-
public class SRUScanRequest extends Object
An object for performing a explain operation.The following argument arguments are mandatory:
- scanClause
- See Also:
SRUScanHandler
, SRU Scan 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_MAXIMUM_TERMS
for end-point conformance testing only.static String
X_MALFORMED_OPERATION
for end-point conformance testing only.static String
X_MALFORMED_RESPONSE_POSITION
for end-point conformance testing only.static String
X_MALFORMED_SCAN_CLAUSE
for end-point conformance testing only.static String
X_MALFORMED_VERSION
for end-point conformance testing only.
-
Constructor Summary
Constructors Constructor Description SRUScanRequest(String baseURI)
Constructor.SRUScanRequest(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.int
getMaximumTerms()
Get the value of the maximumTerms argument for this request.SRUOperation
getOperation()
Note: this method is not a part of public API.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.int
getResponsePosition()
Get the value of the responsePosition argument for this request.String
getScanClause()
Get the value of the scanClause argument for this request.SRUVersion
getVersion()
Get the version for this request.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
setMaximumTerms(int maximumTerms)
Set the value of the maximumTerms argument for this request.void
setResponsePosition(int responsePosition)
Set the value of the responsePosition argument for this request.void
setScanClause(String scanClause)
Set the value of the scanClause argument for 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
-
X_MALFORMED_SCAN_CLAUSE
public static final String X_MALFORMED_SCAN_CLAUSE
for end-point conformance testing only. never use in production.- See Also:
- Constant Field Values
-
X_MALFORMED_RESPONSE_POSITION
public static final String X_MALFORMED_RESPONSE_POSITION
for end-point conformance testing only. never use in production.- See Also:
- Constant Field Values
-
X_MALFORMED_MAXIMUM_TERMS
public static final String X_MALFORMED_MAXIMUM_TERMS
for end-point conformance testing only. never use in production.- See Also:
- Constant Field Values
-
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
-
getScanClause
public String getScanClause()
Get the value of the scanClause argument for this request.- Returns:
- the value for the scanClause argument or
null
of none was set
-
setScanClause
public void setScanClause(String scanClause)
Set the value of the scanClause argument for this request.- Parameters:
scanClause
- the value for the scanClause argument- Throws:
NullPointerException
- if any required argument isnull
IllegalArgumentException
- if any argument is invalid
-
getResponsePosition
public int getResponsePosition()
Get the value of the responsePosition argument for this request.- Returns:
- the value for the responsePosition argument
-
setResponsePosition
public void setResponsePosition(int responsePosition)
Set the value of the responsePosition argument for this request.- Parameters:
responsePosition
- the value for the responsePosition argument- Throws:
IllegalArgumentException
- if any argument is invalid
-
getMaximumTerms
public int getMaximumTerms()
Get the value of the maximumTerms argument for this request.- Returns:
- the value for the maximumTerms argument
-
setMaximumTerms
public void setMaximumTerms(int maximumTerms)
Set the value of the maximumTerms argument for this request.- Parameters:
maximumTerms
- the value for the maximumTerms argument- Throws:
IllegalArgumentException
- if any argument is invalid
-
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
-
-