Search in sources :

Example 1 with SubmitQueryRequestImpl

use of org.codice.alliance.nsili.endpoint.requests.SubmitQueryRequestImpl in project alliance by codice.

the class CatalogMgrImpl method submit_query.

@Override
public SubmitQueryRequest submit_query(Query aQuery, String[] result_attributes, SortAttribute[] sort_attributes, NameValue[] properties) throws ProcessingFault, InvalidInputParameter, SystemFault {
    BqsConverter bqsConverter = new BqsConverter(filterBuilder, removeSourceLibrary);
    SubmitQueryRequestImpl submitQueryRequest = new SubmitQueryRequestImpl(aQuery, filterBuilder, bqsConverter, catalogFramework, querySources);
    submitQueryRequest.set_number_of_hits(maxNumResults);
    submitQueryRequest.setTimeout(defaultTimeout);
    submitQueryRequest.setOutgoingValidationEnabled(outgoingValidationEnabled);
    submitQueryRequest.setResultAttributes(result_attributes);
    String queryId = UUID.randomUUID().toString();
    try {
        poa.activate_object_with_id(queryId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), submitQueryRequest);
    } catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
        LOGGER.debug("submit_query : Unable to activate submitQueryRequest object.", e);
    }
    org.omg.CORBA.Object obj = poa.create_reference_with_id(queryId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), SubmitQueryRequestHelper.id());
    SubmitQueryRequest queryRequest = SubmitQueryRequestHelper.narrow(obj);
    return queryRequest;
}
Also used : WrongPolicy(org.omg.PortableServer.POAPackage.WrongPolicy) SubmitQueryRequest(org.codice.alliance.nsili.common.GIAS.SubmitQueryRequest) ObjectAlreadyActive(org.omg.PortableServer.POAPackage.ObjectAlreadyActive) BqsConverter(org.codice.alliance.nsili.common.BqsConverter) ServantAlreadyActive(org.omg.PortableServer.POAPackage.ServantAlreadyActive) SubmitQueryRequestImpl(org.codice.alliance.nsili.endpoint.requests.SubmitQueryRequestImpl)

Aggregations

BqsConverter (org.codice.alliance.nsili.common.BqsConverter)1 SubmitQueryRequest (org.codice.alliance.nsili.common.GIAS.SubmitQueryRequest)1 SubmitQueryRequestImpl (org.codice.alliance.nsili.endpoint.requests.SubmitQueryRequestImpl)1 ObjectAlreadyActive (org.omg.PortableServer.POAPackage.ObjectAlreadyActive)1 ServantAlreadyActive (org.omg.PortableServer.POAPackage.ServantAlreadyActive)1 WrongPolicy (org.omg.PortableServer.POAPackage.WrongPolicy)1