use of org.codice.alliance.nsili.endpoint.requests.HitCountRequestImpl in project alliance by codice.
the class CatalogMgrImpl method hit_count.
@Override
public HitCountRequest hit_count(Query aQuery, NameValue[] properties) throws ProcessingFault, InvalidInputParameter, SystemFault {
// Force this to be an int per the NSILI API
int numResults = (int) getResultCount(aQuery);
HitCountRequestImpl hitCountRequest = new HitCountRequestImpl(numResults);
String id = UUID.randomUUID().toString();
try {
poa.activate_object_with_id(id.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), hitCountRequest);
} catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
LOGGER.debug("hit_count : Unable to activate hitCountRequest object: {}", id, e);
}
org.omg.CORBA.Object obj = poa.create_reference_with_id(id.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), HitCountRequestHelper.id());
HitCountRequest queryRequest = HitCountRequestHelper.narrow(obj);
return queryRequest;
}
Aggregations