Class SRUServerConfig
- java.lang.Object
- 
- eu.clarin.sru.server.SRUServerConfig
 
- 
 public final class SRUServerConfig extends Object SRU server configuration.Example: URL url = MySRUServlet.class.getClassLoader() .getResource("META-INF/sru-server-config.xml"); if (url == null) { throw new ServletException("not found, url == null"); } // other runtime configuration, usually obtained from Servlet context HashMap<String, String> params = new HashMap<String, String>(); params.put(SRUServerConfig.SRU_TRANSPORT, "http"); params.put(SRUServerConfig.SRU_HOST, "127.0.0.1"); params.put(SRUServerConfig.SRU_PORT, "80"); params.put(SRUServerConfig.SRU_DATABASE, "sru-server"); SRUServerConfig config = SRUServerConfig.parse(params, url);The XML configuration file must validate against the "sru-server-config.xsd" W3C schema bundled with the package and need to have the http://www.clarin.eu/sru-server/1.0/XML namespace.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classSRUServerConfig.DatabaseInfostatic classSRUServerConfig.IndexInfostatic classSRUServerConfig.LegacyNamespaceModestatic classSRUServerConfig.LocalizedStringstatic classSRUServerConfig.SchemaInfo
 - 
Field SummaryFields Modifier and Type Field Description static StringSRU_ALLOW_OVERRIDE_INDENT_RESPONSEParameter constant for configuring, if the SRU server will allow the client to override the pretty-printing setting of the server.static StringSRU_ALLOW_OVERRIDE_MAXIMUM_RECORDSParameter constant for configuring, if the SRU server will allow the client to override the maximum number of records the server supports.static StringSRU_ALLOW_OVERRIDE_MAXIMUM_TERMSParameter constant for configuring, if the SRU server will allow the client to override the maximum number of terms the server supports.static StringSRU_DATABASEParameter constant for configuring the database of this SRU server.static StringSRU_ECHO_REQUESTSParameter constant for configuring, if the SRU server will echo the request.static StringSRU_HOSTParameter constant for configuring the host of this SRU server.static StringSRU_INDENT_RESPONSEParameter constant for configuring, if the SRU server pretty-print the XML response.static StringSRU_LEGACY_NAMESPACE_MODEParameter constant for setting the namespace URIs for SRU 1.1 and SRU 1.2.static StringSRU_MAXIMUM_RECORDSParameter constant for configuring the maximum number of records the SRU server will support in the response to a searchRetrieve request.static StringSRU_MAXIMUM_TERMSParameter constant for configuring the maximum number of terms the SRU server will support in the response to a scan request.static StringSRU_NUMBER_OF_RECORDSParameter constant for configuring the default number of records the SRU server will provide in the response to a searchRetrieve request if the client does not provide this value.static StringSRU_NUMBER_OF_TERMSParameter constant for configuring the default number of terms the SRU server will provide in the response to a scan request if the client does not provide this value.static StringSRU_PORTParameter constant for configuring the port number of this SRU server.static StringSRU_RESPONSE_BUFFER_SIZEParameter constant for configuring the size of response buffer.static StringSRU_SUPPORTED_VERSION_DEFAULTParameter constant for setting the default SRU version for this SRU server, e.g. for an Explain request without explicit version.static StringSRU_SUPPORTED_VERSION_MAXParameter constant for setting the maximum supported SRU version for this SRU server.static StringSRU_SUPPORTED_VERSION_MINParameter constant for setting the minimum supported SRU version for this SRU server.static StringSRU_TRANSPORTParameter constant for configuring the transports for this SRU server.
 - 
Method Summary
 
- 
- 
- 
Field Detail- 
SRU_SUPPORTED_VERSION_MINpublic static final String SRU_SUPPORTED_VERSION_MIN Parameter constant for setting the minimum supported SRU version for this SRU server. Must be smaller or equal toSRU_SUPPORTED_VERSION_MAX.Valid values: " 1.1", "1.2" or "2.0" (without quotation marks)- See Also:
- Constant Field Values
 
 - 
SRU_SUPPORTED_VERSION_MAXpublic static final String SRU_SUPPORTED_VERSION_MAX Parameter constant for setting the maximum supported SRU version for this SRU server. Must be larger or equal toSRU_SUPPORTED_VERSION_MIN.Valid values: " 1.1", "1.2" or "2.0" (without quotation marks)- See Also:
- Constant Field Values
 
 - 
SRU_SUPPORTED_VERSION_DEFAULTpublic static final String SRU_SUPPORTED_VERSION_DEFAULT Parameter constant for setting the default SRU version for this SRU server, e.g. for an Explain request without explicit version. Must not me less thanSRU_SUPPORTED_VERSION_MINor larger thanSRU_SUPPORTED_VERSION_MAX. Defaults toSRU_SUPPORTED_VERSION_MAX.Valid values: " 1.1", "1.2" or "2.0" (without quotation marks)- See Also:
- Constant Field Values
 
 - 
SRU_LEGACY_NAMESPACE_MODEpublic static final String SRU_LEGACY_NAMESPACE_MODE Parameter constant for setting the namespace URIs for SRU 1.1 and SRU 1.2.Valid values: " loc" for Library Of Congress URI or "oasis" for OASIS URIs (without quotation marks).- See Also:
- Constant Field Values
 
 - 
SRU_TRANSPORTpublic static final String SRU_TRANSPORT Parameter constant for configuring the transports for this SRU server.Valid values: " http", "https" or "http https" (without quotation marks)
 Used as part of the Explain response. - See Also:
- Constant Field Values
 
 - 
SRU_HOSTpublic static final String SRU_HOST Parameter constant for configuring the host of this SRU server.Valid values: any fully qualified hostname, e.g. sru.example.org
 Used as part of the Explain response.- See Also:
- Constant Field Values
 
 - 
SRU_PORTpublic static final String SRU_PORT Parameter constant for configuring the port number of this SRU server.Valid values: number between 1 and 65535 (typically 80 or 8080) 
 Used as part of the Explain response.- See Also:
- Constant Field Values
 
 - 
SRU_DATABASEpublic static final String SRU_DATABASE Parameter constant for configuring the database of this SRU server. This is usually the path component of the SRU servers URI.Valid values: typically the path component if the SRU server URI. 
 Used as part of the Explain response.- See Also:
- Constant Field Values
 
 - 
SRU_NUMBER_OF_RECORDSpublic static final String SRU_NUMBER_OF_RECORDS Parameter constant for configuring the default number of records the SRU server will provide in the response to a searchRetrieve request if the client does not provide this value.Valid values: a integer greater than 0 (default value is 100) - See Also:
- Constant Field Values
 
 - 
SRU_MAXIMUM_RECORDSpublic static final String SRU_MAXIMUM_RECORDS Parameter constant for configuring the maximum number of records the SRU server will support in the response to a searchRetrieve request. If a client requests more records, the number will be limited to this value.Valid values: a integer greater than 0 (default value is 250) - See Also:
- Constant Field Values
 
 - 
SRU_NUMBER_OF_TERMSpublic static final String SRU_NUMBER_OF_TERMS Parameter constant for configuring the default number of terms the SRU server will provide in the response to a scan request if the client does not provide this value.Valid values: a integer greater than 0 (default value is 250) - See Also:
- Constant Field Values
 
 - 
SRU_MAXIMUM_TERMSpublic static final String SRU_MAXIMUM_TERMS Parameter constant for configuring the maximum number of terms the SRU server will support in the response to a scan request. If a client requests more records, the number will be limited to this value.Valid values: a integer greater than 0 (default value is 500) - See Also:
- Constant Field Values
 
 - 
SRU_ECHO_REQUESTSpublic static final String SRU_ECHO_REQUESTS Parameter constant for configuring, if the SRU server will echo the request.Valid values: trueorfalse- See Also:
- Constant Field Values
 
 - 
SRU_INDENT_RESPONSEpublic static final String SRU_INDENT_RESPONSE Parameter constant for configuring, if the SRU server pretty-print the XML response. Setting this parameter can be useful for manual debugging of the XML response, however it is not recommended for production setups.Valid values: any integer greater or equal to -1(default) and less or equal to8- See Also:
- Constant Field Values
 
 - 
SRU_ALLOW_OVERRIDE_MAXIMUM_RECORDSpublic static final String SRU_ALLOW_OVERRIDE_MAXIMUM_RECORDS Parameter constant for configuring, if the SRU server will allow the client to override the maximum number of records the server supports. This parameter is solely intended for debugging and setting it totrueis strongly discouraged for production setups.Valid values: trueorfalse(default)- See Also:
- Constant Field Values
 
 - 
SRU_ALLOW_OVERRIDE_MAXIMUM_TERMSpublic static final String SRU_ALLOW_OVERRIDE_MAXIMUM_TERMS Parameter constant for configuring, if the SRU server will allow the client to override the maximum number of terms the server supports. This parameter is solely intended for debugging and setting it totrueit is strongly discouraged for production setups.Valid values: trueorfalse(default)- See Also:
- Constant Field Values
 
 - 
SRU_ALLOW_OVERRIDE_INDENT_RESPONSEpublic static final String SRU_ALLOW_OVERRIDE_INDENT_RESPONSE Parameter constant for configuring, if the SRU server will allow the client to override the pretty-printing setting of the server. This parameter is solely intended for debugging and setting it totrueit is strongly discouraged for production setups.Valid values: trueorfalse(default)- See Also:
- Constant Field Values
 
 - 
SRU_RESPONSE_BUFFER_SIZEpublic static final String SRU_RESPONSE_BUFFER_SIZE Parameter constant for configuring the size of response buffer. The Servlet will buffer up to this amount of data before sending a response to the client. This value specifies the size of the buffer in bytes.Valid values: any positive integer (default 65536) - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getMinVersionpublic SRUVersion getMinVersion() 
 - 
getMaxVersionpublic SRUVersion getMaxVersion() 
 - 
getDefaultVersionpublic SRUVersion getDefaultVersion() 
 - 
getLegacyNamespaceModepublic SRUServerConfig.LegacyNamespaceMode getLegacyNamespaceMode() 
 - 
getDefaultRecordXmlEscapingpublic SRURecordXmlEscaping getDefaultRecordXmlEscaping() 
 - 
getDefaultRecordPackingpublic SRURecordPacking getDefaultRecordPacking() 
 - 
getEchoRequestspublic boolean getEchoRequests() 
 - 
getTransportspublic String getTransports() 
 - 
getHostpublic String getHost() 
 - 
getPortpublic int getPort() 
 - 
getDatabasepublic String getDatabase() 
 - 
getBaseUrlpublic String getBaseUrl() 
 - 
getNumberOfRecordspublic int getNumberOfRecords() 
 - 
getMaximumRecordspublic int getMaximumRecords() 
 - 
getNumberOfTermspublic int getNumberOfTerms() 
 - 
getMaximumTermspublic int getMaximumTerms() 
 - 
getIndentResponsepublic int getIndentResponse() 
 - 
allowOverrideMaximumRecordspublic boolean allowOverrideMaximumRecords() 
 - 
allowOverrideMaximumTermspublic boolean allowOverrideMaximumTerms() 
 - 
allowOverrideIndentResponsepublic boolean allowOverrideIndentResponse() 
 - 
getResponseBufferSizepublic int getResponseBufferSize() 
 - 
getDatabaseInfopublic SRUServerConfig.DatabaseInfo getDatabaseInfo() 
 - 
getIndexInfopublic SRUServerConfig.IndexInfo getIndexInfo() 
 - 
getSchemaInfopublic List<SRUServerConfig.SchemaInfo> getSchemaInfo() 
 - 
findSchemaInfopublic SRUServerConfig.SchemaInfo findSchemaInfo(String value) 
 - 
parsepublic static SRUServerConfig parse(Map<String,String> params, URL configFile) throws SRUConfigException Parse a SRU server XML configuration file and create an configuration object from it.- Parameters:
- params- additional settings
- configFile- an- URLpointing to the XML configuration file
- Returns:
- a initialized SRUEndpointConfiginstance
- Throws:
- NullPointerException- if params or configFile is- null
- SRUConfigException- if an error occurred
 
 
- 
 
-