Search in sources :

Example 1 with CatalogMgrImpl

use of org.codice.alliance.nsili.endpoint.managers.CatalogMgrImpl in project alliance by codice.

the class CatalogMgrImplTest method setUp.

@Before
public void setUp() throws Exception {
    setupCommonMocks();
    setupCatalogMgrMocks();
    try {
        setupOrb();
        orbRunThread = new Thread(() -> orb.run());
        orbRunThread.start();
    } catch (InvalidName | AdapterInactive | WrongPolicy | ServantNotActive e) {
        LOGGER.error("Unable to start the CORBA server", e);
    } catch (IOException e) {
        LOGGER.error("Unable to generate the IOR file", e);
    } catch (SecurityServiceException e) {
        LOGGER.error("Unable to setup guest security credentials", e);
    }
    testQuery = new Query(NsiliConstants.NSIL_ALL_VIEW, bqsQuery);
    catalogMgr = new CatalogMgrImpl(rootPOA, new GeotoolsFilterBuilder(), null);
    catalogMgr.setCatalogFramework(mockCatalogFramework);
}
Also used : WrongPolicy(org.omg.PortableServer.POAPackage.WrongPolicy) SecurityServiceException(ddf.security.service.SecurityServiceException) InvalidName(org.omg.CORBA.ORBPackage.InvalidName) Query(org.codice.alliance.nsili.common.GIAS.Query) AdapterInactive(org.omg.PortableServer.POAManagerPackage.AdapterInactive) GeotoolsFilterBuilder(ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder) CatalogMgrImpl(org.codice.alliance.nsili.endpoint.managers.CatalogMgrImpl) ServantNotActive(org.omg.PortableServer.POAPackage.ServantNotActive) IOException(java.io.IOException) Before(org.junit.Before)

Example 2 with CatalogMgrImpl

use of org.codice.alliance.nsili.endpoint.managers.CatalogMgrImpl in project alliance by codice.

the class LibraryImpl method getCatalogMgrObject.

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

Aggregations

CatalogMgrImpl (org.codice.alliance.nsili.endpoint.managers.CatalogMgrImpl)2 WrongPolicy (org.omg.PortableServer.POAPackage.WrongPolicy)2 GeotoolsFilterBuilder (ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder)1 SecurityServiceException (ddf.security.service.SecurityServiceException)1 IOException (java.io.IOException)1 Query (org.codice.alliance.nsili.common.GIAS.Query)1 Before (org.junit.Before)1 InvalidName (org.omg.CORBA.ORBPackage.InvalidName)1 Object (org.omg.CORBA.Object)1 AdapterInactive (org.omg.PortableServer.POAManagerPackage.AdapterInactive)1 ObjectAlreadyActive (org.omg.PortableServer.POAPackage.ObjectAlreadyActive)1 ServantAlreadyActive (org.omg.PortableServer.POAPackage.ServantAlreadyActive)1 ServantNotActive (org.omg.PortableServer.POAPackage.ServantNotActive)1