use of org.codice.alliance.nsili.common.GIAS.SubmitQueryRequest 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;
}
use of org.codice.alliance.nsili.common.GIAS.SubmitQueryRequest in project alliance by codice.
the class SampleNsiliClient method testCallbackCatalogMgr.
public void testCallbackCatalogMgr() throws Exception {
if (catalogMgr != null) {
LOGGER.info("Testing Query Results via Callback ...");
SortAttribute[] sortAttributes = getSortableAttributes();
String[] resultAttributes = getResultAttributes();
LOGGER.info("Query: {}", STANDING_ALL_QUERY.bqs_query);
SubmitQueryRequest catalogSearchQueryRequest = catalogMgr.submit_query(STANDING_ALL_QUERY, resultAttributes, sortAttributes, new NameValue[0]);
catalogSearchQueryRequest.set_user_info(ALLIANCE);
catalogSearchQueryRequest.set_number_of_hits(200);
TestNsiliCallback nsiliCallback = new TestNsiliCallback(catalogSearchQueryRequest);
byte[] poaObjId = poa.activate_object(nsiliCallback);
org.omg.CORBA.Object obj = poa.id_to_reference(poaObjId);
String catalogSearchCallbackID = catalogSearchQueryRequest.register_callback(CallbackHelper.narrow(obj));
nsiliCallback.setCallbackID(catalogSearchCallbackID);
callbacks.add(nsiliCallback);
LOGGER.info("Callback Catalog Mgr Callback registered: {}", catalogSearchCallbackID);
} else {
LOGGER.warn("CatalogMgr is not initialized, unable to submit queries");
}
}
Aggregations