Class SRUSearchRetrieveRequest

    • Constructor Detail

      • SRUSearchRetrieveRequest

        public SRUSearchRetrieveRequest​(URI baseURI)
        Constructor.
        Parameters:
        baseURI - the baseURI of the endpoint
      • SRUSearchRetrieveRequest

        public SRUSearchRetrieveRequest​(String baseURI)
        Constructor.
        Parameters:
        baseURI - the baseURI of the endpoint
    • Method Detail

      • getQueryType

        public String getQueryType()
        (SRU 2.0) Get the value of the queryType argument for this request.
        Returns:
        the value for the queryType argument or null of none was set
      • getQuery

        public String getQuery()
        Get the value of the query argument for this request.
        Returns:
        the value for the query argument or null of none was set
      • setQuery

        public void setQuery​(String queryType,
                             String query)
        Set the value of the queryType (SRU 2.0) and the query argument for this request.

        For SRU 1.1 and SRU 1.2 requests use the following:

         
         String cql_query = ...
         SRUSearchRetrieveRequest req =
              new SRUSearchRetrieveRequest("http://endpoint.example.org");
         req.setQuery(SRUClientConstants.QUERY_TYPE_CQL, cql_query);
         
         
        Parameters:
        queryType - the value for the queryType argument
        query - the value for the query argument
        Throws:
        NullPointerException - if any required argument is null
        IllegalArgumentException - if any argument is invalid
        See Also:
        SRUClientConstants.QUERY_TYPE_CQL
      • getStartRecord

        public int getStartRecord()
        Get the value of the startRecord argument for this request.
        Returns:
        the value for the startRecord argument or -1 of none was set
      • setStartRecord

        public void setStartRecord​(int startRecord)
        Set the value of the startRecord argument for this request.
        Parameters:
        startRecord - the value for the startRecord argument
        Throws:
        IllegalArgumentException - if any argument is invalid
      • getMaximumRecords

        public int getMaximumRecords()
        Get the value of the maximumRecords argument for this request.
        Returns:
        the value for the maximumRecords argument or -1 of none was set
      • setMaximumRecords

        public void setMaximumRecords​(int maximumRecords)
        Set the value of the maximumRecords argument for this request.
        Parameters:
        maximumRecords - the value for the maximumRecords argument
        Throws:
        IllegalArgumentException - if any argument is invalid
      • getRecordSchema

        public String getRecordSchema()
        Get the value of the recordSchema argument for this request.
        Returns:
        the value for the recordSchema argument or null of none was set
      • setRecordSchema

        public void setRecordSchema​(String recordSchema)
        Set the value of the recordSchema argument for this request.
        Parameters:
        recordSchema - the value for the recordSchema argument
        Throws:
        NullPointerException - if any required argument is null
        IllegalArgumentException - if any argument is invalid
      • 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 XML escaping
        See Also:
        SRURecordXmlEscaping
      • setRecordXmlEscaping

        public void setRecordXmlEscaping​(SRURecordXmlEscaping recordXmlEscaping)
        Set the recordXmlEscpaing (SRU 2.0) or recordPacking (SRU 1.1 and SRU 1.2) parameter of this request.
        Parameters:
        recordXmlEscaping - the requested record XML escaping
        See Also:
        SRURecordXmlEscaping
      • getRecordPacking

        public SRURecordPacking getRecordPacking()
        Get the recordPacking (SRU 2.0) parameter of this request.
        Returns:
        the requested record packing
        See Also:
        SRURecordPacking
      • setRecordPacking

        public void setRecordPacking​(SRURecordPacking recordPacking)
        Set the recordPacking (SRU 2.0) parameter of this request.
        Parameters:
        recordPacking - the requested recordPacking mode
        See Also:
        SRURecordXmlEscaping
      • getResultSetTTL

        public int getResultSetTTL()
        Get the value of the resultSetTTL argument for this request.
        Returns:
        the value for the resultSetTTL argument or -1 of none was set
      • setResultSetTTL

        public void setResultSetTTL​(int resultSetTTL)
        Set the value of the resultSetTTL argument for this request.
        Parameters:
        resultSetTTL - the value for the resultSetTTL 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 of null 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
      • 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 is null
        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 an IllegalStateException.
        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 an IllegalStateException.
        Returns:
        the version that was used to carry out this request
        Throws:
        IllegalStateException - if the request was not yet carried out