Search in sources :

Example 21 with ObjectAlreadyActive

use of org.omg.PortableServer.POAPackage.ObjectAlreadyActive in project alliance by codice.

the class LibraryImpl method getProductObject.

private Object getProductObject(String managerId) {
    Object obj;
    ProductMgrImpl productMgr = new ProductMgrImpl(querySources);
    productMgr.setCatalogFramework(catalogFramework);
    productMgr.setFilterBuilder(filterBuilder);
    productMgr.setOutgoingValidationEnabled(outgoingValidationEnabled);
    if (!CorbaUtils.isIdActive(poa, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
        try {
            poa.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), productMgr);
        } catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
            LOGGER.info("Error activating ProductMgr: ", e);
        }
    }
    obj = poa.create_reference_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), ProductMgrHelper.id());
    return obj;
}
Also used : WrongPolicy(org.omg.PortableServer.POAPackage.WrongPolicy) ObjectAlreadyActive(org.omg.PortableServer.POAPackage.ObjectAlreadyActive) ProductMgrImpl(org.codice.alliance.nsili.endpoint.managers.ProductMgrImpl) Object(org.omg.CORBA.Object) ServantAlreadyActive(org.omg.PortableServer.POAPackage.ServantAlreadyActive)

Example 22 with ObjectAlreadyActive

use of org.omg.PortableServer.POAPackage.ObjectAlreadyActive 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)

Example 23 with ObjectAlreadyActive

use of org.omg.PortableServer.POAPackage.ObjectAlreadyActive in project alliance by codice.

the class ProductMgrImpl method get_parameters.

@Override
public GetParametersRequest get_parameters(Product prod, String[] desired_parameters, NameValue[] properties) throws ProcessingFault, InvalidInputParameter, SystemFault {
    GetParametersRequest getParamRequest = null;
    String id = UUID.randomUUID().toString();
    try {
        String productIdStr = getAccessManager().getProductId(prod);
        GetParametersRequestImpl getParametersRequest = new GetParametersRequestImpl(productIdStr, desired_parameters, catalogFramework, filterBuilder, querySources, outgoingValidationEnabled);
        _poa().activate_object_with_id(id.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), getParametersRequest);
        org.omg.CORBA.Object obj = _poa().create_reference_with_id(id.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), GetParametersRequestHelper.id());
        getParamRequest = GetParametersRequestHelper.narrow(obj);
    } catch (WrongAdapter | WrongPolicy | UnsupportedEncodingException e) {
        LOGGER.debug("Unable to get ID from product reference: {}", NsilCorbaExceptionUtil.getExceptionDetails(e), e);
    } catch (ServantAlreadyActive | ObjectAlreadyActive e) {
        LOGGER.debug("get_parameters : Unable to activate getParametersRequest object. {}", NsilCorbaExceptionUtil.getExceptionDetails(e), e);
    }
    return getParamRequest;
}
Also used : ObjectAlreadyActive(org.omg.PortableServer.POAPackage.ObjectAlreadyActive) UnsupportedEncodingException(java.io.UnsupportedEncodingException) GetParametersRequestImpl(org.codice.alliance.nsili.endpoint.requests.GetParametersRequestImpl) WrongPolicy(org.omg.PortableServer.POAPackage.WrongPolicy) WrongAdapter(org.omg.PortableServer.POAPackage.WrongAdapter) ServantAlreadyActive(org.omg.PortableServer.POAPackage.ServantAlreadyActive) GetParametersRequest(org.codice.alliance.nsili.common.GIAS.GetParametersRequest)

Example 24 with ObjectAlreadyActive

use of org.omg.PortableServer.POAPackage.ObjectAlreadyActive in project alliance by codice.

the class ProductMgrImpl method get_parameters.

@Override
public GetParametersRequest get_parameters(Product prod, String[] desired_parameters, NameValue[] properties) throws ProcessingFault, InvalidInputParameter, SystemFault {
    GetParametersRequestImpl getParametersRequest = new GetParametersRequestImpl();
    try {
        _poa().activate_object_with_id("get_parameters".getBytes(Charset.forName(ENCODING)), getParametersRequest);
    } catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
        LOGGER.warn("get_parameters : Unable to activate getParametersRequest object.", e);
    }
    org.omg.CORBA.Object obj = _poa().create_reference_with_id("get_parameters".getBytes(Charset.forName(ENCODING)), GetParametersRequestHelper.id());
    GetParametersRequest queryRequest = GetParametersRequestHelper.narrow(obj);
    return queryRequest;
}
Also used : WrongPolicy(org.omg.PortableServer.POAPackage.WrongPolicy) ObjectAlreadyActive(org.omg.PortableServer.POAPackage.ObjectAlreadyActive) ServantAlreadyActive(org.omg.PortableServer.POAPackage.ServantAlreadyActive) GetParametersRequestImpl(org.codice.alliance.nsili.mockserver.impl.requests.GetParametersRequestImpl) GetParametersRequest(org.codice.alliance.nsili.common.GIAS.GetParametersRequest)

Example 25 with ObjectAlreadyActive

use of org.omg.PortableServer.POAPackage.ObjectAlreadyActive in project alliance by codice.

the class ProductMgrImpl method get_related_files.

@Override
public GetRelatedFilesRequest get_related_files(Product[] products, FileLocation location, String type, NameValue[] properties) throws ProcessingFault, InvalidInputParameter, SystemFault {
    GetRelatedFilesRequestImpl getRelatedFilesRequest = new GetRelatedFilesRequestImpl();
    try {
        _poa().activate_object_with_id("get_related_files".getBytes(Charset.forName(ENCODING)), getRelatedFilesRequest);
    } catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
        LOGGER.warn("get_related_files : Unable to activate getRelatedFilesRequest object.", e);
    }
    org.omg.CORBA.Object obj = _poa().create_reference_with_id("get_related_files".getBytes(Charset.forName(ENCODING)), GetRelatedFilesRequestHelper.id());
    GetRelatedFilesRequest queryRequest = GetRelatedFilesRequestHelper.narrow(obj);
    return queryRequest;
}
Also used : WrongPolicy(org.omg.PortableServer.POAPackage.WrongPolicy) GetRelatedFilesRequestImpl(org.codice.alliance.nsili.mockserver.impl.requests.GetRelatedFilesRequestImpl) ObjectAlreadyActive(org.omg.PortableServer.POAPackage.ObjectAlreadyActive) GetRelatedFilesRequest(org.codice.alliance.nsili.common.GIAS.GetRelatedFilesRequest) ServantAlreadyActive(org.omg.PortableServer.POAPackage.ServantAlreadyActive)

Aggregations

ObjectAlreadyActive (org.omg.PortableServer.POAPackage.ObjectAlreadyActive)25 ServantAlreadyActive (org.omg.PortableServer.POAPackage.ServantAlreadyActive)25 WrongPolicy (org.omg.PortableServer.POAPackage.WrongPolicy)25 IOException (java.io.IOException)6 Object (org.omg.CORBA.Object)6 GeotoolsFilterBuilder (ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder)5 SecurityServiceException (ddf.security.service.SecurityServiceException)5 Before (org.junit.Before)5 InvalidName (org.omg.CORBA.ORBPackage.InvalidName)5 AdapterInactive (org.omg.PortableServer.POAManagerPackage.AdapterInactive)5 ServantNotActive (org.omg.PortableServer.POAPackage.ServantNotActive)5 Metacard (ddf.catalog.data.Metacard)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 ArrayList (java.util.ArrayList)2 GetParametersRequest (org.codice.alliance.nsili.common.GIAS.GetParametersRequest)2 GetRelatedFilesRequest (org.codice.alliance.nsili.common.GIAS.GetRelatedFilesRequest)2 HitCountRequest (org.codice.alliance.nsili.common.GIAS.HitCountRequest)2 OrderRequest (org.codice.alliance.nsili.common.GIAS.OrderRequest)2 SubmitQueryRequest (org.codice.alliance.nsili.common.GIAS.SubmitQueryRequest)2 NameValue (org.codice.alliance.nsili.common.UCO.NameValue)2