Search in sources :

Example 16 with ServantAlreadyActive

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

the class SubmitStandingQueryRequestImpl method get_request_manager.

@Override
public RequestManager get_request_manager() throws ProcessingFault, SystemFault {
    if (requestManager == null) {
        String requestManagerId = UUID.randomUUID().toString();
        RequestManagerImpl requestManagerImpl = new RequestManagerImpl();
        try {
            _poa().activate_object_with_id(requestManagerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), requestManagerImpl);
        } catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
            LOGGER.debug("Error activating RequestManager: ", e);
        }
        org.omg.CORBA.Object obj = _poa().create_reference_with_id(requestManagerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), RequestManagerHelper.id());
        requestManager = RequestManagerHelper.narrow(obj);
    }
    return requestManager;
}
Also used : WrongPolicy(org.omg.PortableServer.POAPackage.WrongPolicy) ObjectAlreadyActive(org.omg.PortableServer.POAPackage.ObjectAlreadyActive) ServantAlreadyActive(org.omg.PortableServer.POAPackage.ServantAlreadyActive) RequestManagerImpl(org.codice.alliance.nsili.endpoint.managers.RequestManagerImpl)

Example 17 with ServantAlreadyActive

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

the class OrderMgrImplTest method setUp.

@Before
public void setUp() throws Exception {
    setupCommonMocks();
    setupOrderMgrMocks();
    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);
    }
    String managerId = UUID.randomUUID().toString();
    orderMgr = new OrderMgrImpl();
    orderMgr.setFilterBuilder(new GeotoolsFilterBuilder());
    orderMgr.setCatalogFramework(mockCatalogFramework);
    if (!CorbaUtils.isIdActive(rootPOA, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
        try {
            rootPOA.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), orderMgr);
        } catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
            LOGGER.error("Error activating ProductMgr: {}", e);
        }
    }
    rootPOA.create_reference_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), ProductMgrHelper.id());
}
Also used : OrderMgrImpl(org.codice.alliance.nsili.endpoint.managers.OrderMgrImpl) SecurityServiceException(ddf.security.service.SecurityServiceException) ObjectAlreadyActive(org.omg.PortableServer.POAPackage.ObjectAlreadyActive) AdapterInactive(org.omg.PortableServer.POAManagerPackage.AdapterInactive) ServantNotActive(org.omg.PortableServer.POAPackage.ServantNotActive) IOException(java.io.IOException) WrongPolicy(org.omg.PortableServer.POAPackage.WrongPolicy) InvalidName(org.omg.CORBA.ORBPackage.InvalidName) GeotoolsFilterBuilder(ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder) ServantAlreadyActive(org.omg.PortableServer.POAPackage.ServantAlreadyActive) Before(org.junit.Before)

Example 18 with ServantAlreadyActive

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

the class ProductMgrImplTest method setUp.

@Before
public void setUp() throws Exception {
    setupCommonMocks();
    setupProductMgrMocks();
    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);
    }
    String managerId = UUID.randomUUID().toString();
    productMgr = new ProductMgrImpl(null);
    productMgr.setFilterBuilder(new GeotoolsFilterBuilder());
    productMgr.setCatalogFramework(mockCatalogFramework);
    productMgr.setOutgoingValidationEnabled(false);
    if (!CorbaUtils.isIdActive(rootPOA, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
        try {
            rootPOA.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), productMgr);
        } catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
            LOGGER.error("Error activating ProductMgr: {}", e);
        }
    }
    rootPOA.create_reference_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), ProductMgrHelper.id());
}
Also used : SecurityServiceException(ddf.security.service.SecurityServiceException) ObjectAlreadyActive(org.omg.PortableServer.POAPackage.ObjectAlreadyActive) AdapterInactive(org.omg.PortableServer.POAManagerPackage.AdapterInactive) ProductMgrImpl(org.codice.alliance.nsili.endpoint.managers.ProductMgrImpl) ServantNotActive(org.omg.PortableServer.POAPackage.ServantNotActive) IOException(java.io.IOException) WrongPolicy(org.omg.PortableServer.POAPackage.WrongPolicy) InvalidName(org.omg.CORBA.ORBPackage.InvalidName) GeotoolsFilterBuilder(ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder) ServantAlreadyActive(org.omg.PortableServer.POAPackage.ServantAlreadyActive) Before(org.junit.Before)

Example 19 with ServantAlreadyActive

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

the class StandingQueryMgrImplTest method setUp.

@Before
public void setUp() throws Exception {
    setupCommonMocks();
    setupStandingQueryMgrMocks();
    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);
    }
    String managerId = UUID.randomUUID().toString();
    standingQueryMgr = new StandingQueryMgrImpl(null);
    standingQueryMgr.setFilterBuilder(new GeotoolsFilterBuilder());
    standingQueryMgr.setCatalogFramework(mockCatalogFramework);
    standingQueryMgr.setDefaultUpdateFrequencyMsec(60000);
    standingQueryMgr.setMaxWaitToStartTimeMsecs(TimeUnit.MINUTES.toMillis(5));
    standingQueryMgr.setMaxPendingResults(10000);
    if (!CorbaUtils.isIdActive(rootPOA, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
        try {
            rootPOA.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), standingQueryMgr);
        } catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
            LOGGER.error("Error activating StandingQueryMgr: {}", e);
        }
    }
    rootPOA.create_reference_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), StandingQueryMgrHelper.id());
}
Also used : SecurityServiceException(ddf.security.service.SecurityServiceException) ObjectAlreadyActive(org.omg.PortableServer.POAPackage.ObjectAlreadyActive) AdapterInactive(org.omg.PortableServer.POAManagerPackage.AdapterInactive) StandingQueryMgrImpl(org.codice.alliance.nsili.endpoint.managers.StandingQueryMgrImpl) ServantNotActive(org.omg.PortableServer.POAPackage.ServantNotActive) IOException(java.io.IOException) WrongPolicy(org.omg.PortableServer.POAPackage.WrongPolicy) InvalidName(org.omg.CORBA.ORBPackage.InvalidName) GeotoolsFilterBuilder(ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder) ServantAlreadyActive(org.omg.PortableServer.POAPackage.ServantAlreadyActive) Before(org.junit.Before)

Example 20 with ServantAlreadyActive

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

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