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 Map<String,String>authenticationContextA map of extra authentication context data.protected URIbaseURIThe baseURI of the SRU server.protected Map<String,String>extraRequestDataA map of extra request data parameters.static StringMALFORMED_OMITfor end-point conformance testing only. never use in production.protected static StringOP_EXPLAINprotected static StringOP_SCANprotected static StringOP_SEARCH_RETRIEVEprotected static StringPARAM_EXTENSION_PREFIXprotected static StringPARAM_HTTP_ACCEPTprotected static StringPARAM_MAXIMUM_RECORDSprotected static StringPARAM_MAXIMUM_TERMSprotected static StringPARAM_OPERATIONprotected static StringPARAM_QUERYprotected static StringPARAM_QUERY_TYPEprotected static StringPARAM_RECORD_PACKINGprotected static StringPARAM_RECORD_SCHEMAprotected static StringPARAM_RECORD_X_PATHprotected static StringPARAM_RECORD_XML_ESCAPINGprotected static StringPARAM_RENDER_BYprotected static StringPARAM_RESPONSE_POSITIONprotected static StringPARAM_RESPONSE_TYPEprotected static StringPARAM_RESULT_SET_TTLprotected static StringPARAM_SCAN_CLAUSEprotected static StringPARAM_SORT_KEYSprotected static StringPARAM_START_RECORDprotected static StringPARAM_STYLESHEETprotected static StringPARAM_VERSIONprotected static StringRECORD_PACKING_PACKEDprotected static StringRECORD_PACKING_UNPACKEDprotected static StringRECORD_XML_ESCAPING_XMLprotected static StringRECORD_XML_ESCPAING_STRINGprotected static StringRENDER_BY_CLIENTprotected static StringRENDER_BY_SERVERprotected SRUVersionversionThe version to be used for this request.protected static StringVERSION_1_1protected static StringVERSION_1_2static StringX_MALFORMED_MAXIMUM_TERMSfor end-point conformance testing only. never use in production.static StringX_MALFORMED_OPERATIONfor end-point conformance testing only. never use in production.static StringX_MALFORMED_RESPONSE_POSITIONfor end-point conformance testing only. never use in production.static StringX_MALFORMED_SCAN_CLAUSEfor end-point conformance testing only. never use in production.static StringX_MALFORMED_VERSIONfor end-point conformance testing only. never use in production.
-
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 Map<String,String>getAuthenticationContext()Returns a nullable read-only map of authentication context data.URIgetBaseURI()Get the baseURI of the SRU server.StringgetExtraRequestData(String name)Set the value of extra request parameter for this request.intgetMaximumTerms()Get the value of the maximumTerms argument for this request.SRUOperationgetOperation()Note: this method is not a part of public API.URIgetRequestedURI()Get the URI that was used to perform the request.SRUVersiongetRequestedVersion()Get the version that was used to carry out this request.intgetResponsePosition()Get the value of the responsePosition argument for this request.StringgetScanClause()Get the value of the scanClause argument for this request.SRUVersiongetVersion()Get the version for this request.booleanisSendAuthentication()Get the authentication mode for this requestbooleanisStrictMode()Get the SRU protocol conformance mode for this requestprotected URImakeURI(SRUVersion defaultVersion)voidsetAuthenticationContext(String name, String value)Set an authentication context entry for this request.voidsetExtraRequestData(String name, String value)Set an extra request parameter for this request.voidsetMaximumTerms(int maximumTerms)Set the value of the maximumTerms argument for this request.voidsetResponsePosition(int responsePosition)Set the value of the responsePosition argument for this request.voidsetScanClause(String scanClause)Set the value of the scanClause argument for this request.voidsetSendAuthentication(boolean sendAuthentication)Set whether authentication information should be sent for this requestvoidsetStrictMode(boolean strictMode)Set the SRU protocol conformance mode for this requestvoidsetVersion(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.
-
extraRequestData
protected Map<String,String> extraRequestData
A map of extra request data parameters.
-
-
Method Detail
-
getScanClause
public String getScanClause()
Get the value of the scanClause argument for this request.- Returns:
- the value for the scanClause argument or
nullof 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 isnullIllegalArgumentException- 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:
trueif the request will be performed in strict mode,falseif 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-trueif the request should be performed in strict mode,falseif 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 ofnullfor client default
-
getVersion
public SRUVersion getVersion()
Get the version for this request.- Returns:
- version for this request or
nullif 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 isnullIllegalArgumentException- 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
nullif parameter was not set - Throws:
NullPointerException- if any required argument isnullIllegalArgumentException- 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
-
isSendAuthentication
public boolean isSendAuthentication()
Get the authentication mode for this request- Returns:
trueif the request will try to send authentication data (header),falseif the request will not send send authentication information
-
setSendAuthentication
public void setSendAuthentication(boolean sendAuthentication)
Set whether authentication information should be sent for this request- Parameters:
sendAuthentication-trueif the request should try to send authentication information,falseif sending should be suppressed
-
getAuthenticationContext
public Map<String,String> getAuthenticationContext()
Returns a nullable read-only map of authentication context data.- Returns:
- the authentication context map or
nullif no entries were created
-
setAuthenticationContext
public void setAuthenticationContext(String name, String value)
Set an authentication context entry for this request.- Parameters:
name- the name for the context entry parametervalue- the value for the context entry parameter- Throws:
NullPointerException- if any required argument isnullIllegalArgumentException- if any argument is invalid
-
makeURI
protected final URI makeURI(SRUVersion defaultVersion) throws SRUClientException
- Throws:
SRUClientException
-
-