Search in sources :

Example 1 with HitCountRequestImpl

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;
}
Also used : WrongPolicy(org.omg.PortableServer.POAPackage.WrongPolicy) ObjectAlreadyActive(org.omg.PortableServer.POAPackage.ObjectAlreadyActive) HitCountRequestImpl(org.codice.alliance.nsili.endpoint.requests.HitCountRequestImpl) ServantAlreadyActive(org.omg.PortableServer.POAPackage.ServantAlreadyActive) NsiliEndpoint(org.codice.alliance.nsili.endpoint.NsiliEndpoint) HitCountRequest(org.codice.alliance.nsili.common.GIAS.HitCountRequest)

Aggregations

HitCountRequest (org.codice.alliance.nsili.common.GIAS.HitCountRequest)1 NsiliEndpoint (org.codice.alliance.nsili.endpoint.NsiliEndpoint)1 HitCountRequestImpl (org.codice.alliance.nsili.endpoint.requests.HitCountRequestImpl)1 ObjectAlreadyActive (org.omg.PortableServer.POAPackage.ObjectAlreadyActive)1 ServantAlreadyActive (org.omg.PortableServer.POAPackage.ServantAlreadyActive)1 WrongPolicy (org.omg.PortableServer.POAPackage.WrongPolicy)1