Search in sources :

Example 1 with ServantNotActive

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

the class MockNsili method startMockServer.

public void startMockServer(int corbaPort) {
    ORB orb = null;
    try {
        orb = getOrbForServer(corbaPort);
        LOGGER.info("Server Started...");
        // blocks the current thread until the ORB is shutdown
        orb.run();
    } 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);
    }
    if (orb != null) {
        orb.destroy();
    }
}
Also used : WrongPolicy(org.omg.PortableServer.POAPackage.WrongPolicy) InvalidName(org.omg.CORBA.ORBPackage.InvalidName) AdapterInactive(org.omg.PortableServer.POAManagerPackage.AdapterInactive) ServantNotActive(org.omg.PortableServer.POAPackage.ServantNotActive) IOException(java.io.IOException) ORB(org.omg.CORBA.ORB)

Example 2 with ServantNotActive

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

the class AccessManagerImplTest method setUp.

@Before
public void setUp() throws Exception {
    setupCommonMocks();
    setupAccessMgrMocks();
    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);
    String managerId = UUID.randomUUID().toString();
    accessManager = new AccessManagerImpl();
    accessManager.setFilterBuilder(new GeotoolsFilterBuilder());
    accessManager.setCatalogFramework(mockCatalogFramework);
    if (!CorbaUtils.isIdActive(rootPOA, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
        try {
            rootPOA.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), accessManager);
        } 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 : AccessManagerImpl(org.codice.alliance.nsili.endpoint.managers.AccessManagerImpl) SecurityServiceException(ddf.security.service.SecurityServiceException) Query(org.codice.alliance.nsili.common.GIAS.Query) 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 3 with ServantNotActive

use of org.omg.PortableServer.POAPackage.ServantNotActive 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 4 with ServantNotActive

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

the class CreationMgrImplTest method setUp.

@Before
public void setUp() throws Exception {
    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();
    creationMgr = new CreationMgrImpl();
    creationMgr.setFilterBuilder(new GeotoolsFilterBuilder());
    creationMgr.setCatalogFramework(mockCatalogFramework);
    if (!CorbaUtils.isIdActive(rootPOA, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
        try {
            rootPOA.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), creationMgr);
        } 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) ServantNotActive(org.omg.PortableServer.POAPackage.ServantNotActive) IOException(java.io.IOException) WrongPolicy(org.omg.PortableServer.POAPackage.WrongPolicy) CreationMgrImpl(org.codice.alliance.nsili.endpoint.managers.CreationMgrImpl) InvalidName(org.omg.CORBA.ORBPackage.InvalidName) GeotoolsFilterBuilder(ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder) ServantAlreadyActive(org.omg.PortableServer.POAPackage.ServantAlreadyActive) Before(org.junit.Before)

Example 5 with ServantNotActive

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

Aggregations

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