Search in sources :

Example 6 with InvalidInputParameter

use of org.codice.alliance.nsili.common.UCO.InvalidInputParameter in project alliance by codice.

the class NsiliSource method getHitCount.

/**
 * Obtains the number of hits that the given query has received from the server.
 *
 * @param query - a BQS query
 * @param properties - a list of properties for the query
 * @return - the hit count
 */
private int getHitCount(org.codice.alliance.nsili.common.GIAS.Query query, NameValue[] properties) {
    IntHolder intHolder = new IntHolder();
    try {
        synchronized (queryLockObj) {
            HitCountRequest hitCountRequest = catalogMgr.hit_count(query, properties);
            hitCountRequest.complete(intHolder);
        }
    } catch (ProcessingFault | SystemFault | InvalidInputParameter e) {
        LOGGER.debug("{} : Unable to get hit count for query. : {}", getId(), NsilCorbaExceptionUtil.getExceptionDetails(e), e);
    }
    LOGGER.debug("{} :  Received {} hit(s) from query.", getId(), intHolder.value);
    return intHolder.value;
}
Also used : SystemFault(org.codice.alliance.nsili.common.UCO.SystemFault) IntHolder(org.omg.CORBA.IntHolder) InvalidInputParameter(org.codice.alliance.nsili.common.UCO.InvalidInputParameter) ProcessingFault(org.codice.alliance.nsili.common.UCO.ProcessingFault) HitCountRequest(org.codice.alliance.nsili.common.GIAS.HitCountRequest)

Example 7 with InvalidInputParameter

use of org.codice.alliance.nsili.common.UCO.InvalidInputParameter in project alliance by codice.

the class LibraryImpl method get_manager.

@Override
public LibraryManager get_manager(String managerType, AccessCriteria accessCriteria) throws ProcessingFault, InvalidInputParameter, SystemFault {
    org.omg.CORBA.Object obj;
    String managerId = UUID.randomUUID().toString();
    if (managerType.equals(NsiliManagerType.CATALOG_MGR.getSpecName())) {
        obj = getCatalogMgrObject(managerId);
    } else if (managerType.equals(NsiliManagerType.ORDER_MGR.getSpecName())) {
        obj = getOrderMgrObject(managerId);
    } else if (managerType.equals(NsiliManagerType.PRODUCT_MGR.getSpecName())) {
        obj = getProductObject(managerId);
    } else if (managerType.equals(NsiliManagerType.DATA_MODEL_MGR.getSpecName())) {
        obj = getDataModelMgrObject(managerId);
    } else if (managerType.equals(NsiliManagerType.CREATION_MGR.getSpecName())) {
        obj = getCreationMgrObject(managerId);
    } else if (managerType.equals(NsiliManagerType.STANDING_QUERY_MGR.getSpecName())) {
        obj = getStandingQueryMgrObject(managerId);
    } else {
        String[] badParams = { managerType };
        throw new InvalidInputParameter("UnknownMangerType", new exception_details("UnknownMangerType", true, managerType), badParams);
    }
    LibraryManager libraryManager = LibraryManagerHelper.narrow(obj);
    LOGGER.trace("get_manager, type: {}, id: {}", managerType, managerId);
    return libraryManager;
}
Also used : UCO.exception_details(org.codice.alliance.nsili.common.UCO.exception_details) Object(org.omg.CORBA.Object) LibraryManager(org.codice.alliance.nsili.common.GIAS.LibraryManager) InvalidInputParameter(org.codice.alliance.nsili.common.UCO.InvalidInputParameter)

Aggregations

InvalidInputParameter (org.codice.alliance.nsili.common.UCO.InvalidInputParameter)7 ProcessingFault (org.codice.alliance.nsili.common.UCO.ProcessingFault)4 SystemFault (org.codice.alliance.nsili.common.UCO.SystemFault)4 LibraryManager (org.codice.alliance.nsili.common.GIAS.LibraryManager)3 UCO.exception_details (org.codice.alliance.nsili.common.UCO.exception_details)3 ArrayList (java.util.ArrayList)2 HitCountRequest (org.codice.alliance.nsili.common.GIAS.HitCountRequest)2 IntHolder (org.omg.CORBA.IntHolder)2 Metacard (ddf.catalog.data.Metacard)1 Result (ddf.catalog.data.Result)1 ResultImpl (ddf.catalog.data.impl.ResultImpl)1 SourceResponseImpl (ddf.catalog.operation.impl.SourceResponseImpl)1 HashMap (java.util.HashMap)1 List (java.util.List)1 ExecutionException (java.util.concurrent.ExecutionException)1 Future (java.util.concurrent.Future)1 ScheduledFuture (java.util.concurrent.ScheduledFuture)1 AccessCriteria (org.codice.alliance.nsili.common.GIAS.AccessCriteria)1 AttributeInformation (org.codice.alliance.nsili.common.GIAS.AttributeInformation)1 SortAttribute (org.codice.alliance.nsili.common.GIAS.SortAttribute)1