Example usage for java.io CharConversionException getMessage

List of usage examples for java.io CharConversionException getMessage

Introduction

In this page you can find the example usage for java.io CharConversionException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:ORG.oclc.os.SRW.ParallelSearching.SRWRemoteDatabase.java

public QueryResult getQueryResult(String query, SearchRetrieveRequestType request)
        throws InstantiationException {
    long startTime = System.currentTimeMillis();
    String urlStr = url + "&operation=searchRetrieve&query=" + Utilities.urlParameterEncode(query);

    NonNegativeInteger maxRecords = request.getMaximumRecords();
    if (maxRecords != null)
        urlStr = urlStr + "&maximumRecords=" + maxRecords;

    NonNegativeInteger startRecord = request.getStartRecord();
    if (startRecord != null)
        urlStr = urlStr + "&startRecord=" + startRecord;

    String schema = request.getRecordSchema();
    if (schema != null)
        urlStr = urlStr + "&recordSchema=" + schema;

    NonNegativeInteger resultSetTTL = request.getResultSetTTL();
    if (resultSetTTL != null)
        urlStr = urlStr + "&resultSetTTL=" + resultSetTTL;

    String sortKeys = request.getSortKeys();
    if (sortKeys != null)
        urlStr = urlStr + "&sortKeys=" + Utilities.urlParameterEncode(sortKeys);

    Hashtable extraRequestDataElements = parseElements(request.getExtraRequestData());
    String s = (String) extraRequestDataElements.get("restrictorSummary");
    if (s != null && !s.equals("false")) {
        //                restrictorSummary=true;
        urlStr = urlStr + "&x-info-5-restrictorSummary";
        log.info("turned restrictorSummary on");
    }/*from   w ww.j  a  v  a2s. c  o  m*/
    s = (String) extraRequestDataElements.get("returnSortKeys");
    if (s != null && !s.equals("false")) {
        //                returnSortKeys=true;
        urlStr = urlStr + "&x-info-5-returnSortKeys";
        log.info("turned returnSortKeys on");
    }
    log.info("urlStr=" + urlStr + "; " + System.currentTimeMillis());
    try {
        RemoteQueryResult rqr = new RemoteQueryResult(url, getRemoteResponse(urlStr));
        log.info("search " + query + ": " + (System.currentTimeMillis() - startTime) + "ms");
        return rqr;
    } catch (CharConversionException e) {
        log.error(e, e);
        throw new InstantiationException(e.getMessage());
    } catch (EOFException e) {
        log.error(e, e);
        throw new InstantiationException(e.getMessage());
    } catch (IOException e) {
        log.error(e, e);
        throw new InstantiationException(e.getMessage());
    }
    //            if(recordPacking==null) {
    //                MessageContext msgContext=MessageContext.getCurrentContext();
    //                if(msgContext!=null && msgContext.getProperty("sru")!=null)
    //                    recordPacking="xml"; // default for sru
    //                else
    //                    recordPacking="string"; // default for srw
    //            }
    //            log.info("calling getNextSearchRetrieveResponse"+"; "+System.currentTimeMillis());
    //            SearchRetrieveResponseType response=searchHandler.getNextSearchRetrieveResponse(recordPacking);
    //            log.info("exit doRequest"+"; "+System.currentTimeMillis());
    //            return response;
}