Search in sources :

Example 6 with LibraryManager

use of org.codice.alliance.nsili.common.GIAS.LibraryManager in project alliance by codice.

the class NsiliEndpointTest method testCreationMgr.

@Test
public void testCreationMgr() throws Exception {
    LibraryManager creationMgr = nsiliEndpoint.getLibrary().get_manager(NsiliManagerType.CREATION_MGR.getSpecName(), testAccessCriteria);
    assertThat(creationMgr, notNullValue());
}
Also used : LibraryManager(org.codice.alliance.nsili.common.GIAS.LibraryManager) Test(org.junit.Test)

Example 7 with LibraryManager

use of org.codice.alliance.nsili.common.GIAS.LibraryManager in project alliance by codice.

the class NsiliEndpointTest method testStandingQueryMgr.

@Test
public void testStandingQueryMgr() throws Exception {
    LibraryManager standingQueryMgr = nsiliEndpoint.getLibrary().get_manager(NsiliManagerType.STANDING_QUERY_MGR.getSpecName(), testAccessCriteria);
    assertThat(standingQueryMgr, notNullValue());
}
Also used : LibraryManager(org.codice.alliance.nsili.common.GIAS.LibraryManager) Test(org.junit.Test)

Example 8 with LibraryManager

use of org.codice.alliance.nsili.common.GIAS.LibraryManager in project alliance by codice.

the class NsiliEndpointTest method testGetOrderMgr.

@Test
public void testGetOrderMgr() throws Exception {
    LibraryManager orderMgr = nsiliEndpoint.getLibrary().get_manager(NsiliManagerType.ORDER_MGR.getSpecName(), testAccessCriteria);
    assertThat(orderMgr, notNullValue());
}
Also used : LibraryManager(org.codice.alliance.nsili.common.GIAS.LibraryManager) Test(org.junit.Test)

Example 9 with LibraryManager

use of org.codice.alliance.nsili.common.GIAS.LibraryManager 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)

Example 10 with LibraryManager

use of org.codice.alliance.nsili.common.GIAS.LibraryManager in project alliance by codice.

the class SampleNsiliClient method initManagers.

private void initManagers() throws Exception {
    final AccessCriteria accessCriteria = new AccessCriteria("", "", "");
    for (String managerType : getManagerTypes()) {
        if (managerType.equals(NsiliManagerType.CATALOG_MGR.getSpecName())) {
            // Get Mandatory Managers
            LOGGER.info("Getting CatalogMgr from source...");
            LibraryManager libraryManager = library.get_manager(NsiliManagerType.CATALOG_MGR.getSpecName(), accessCriteria);
            catalogMgr = CatalogMgrHelper.narrow(libraryManager);
            LOGGER.info(SOURCE_RETURNED, catalogMgr.getClass());
        } else if (managerType.equals(NsiliManagerType.ORDER_MGR.getSpecName())) {
            LOGGER.info("Getting OrderMgr from source...");
            LibraryManager libraryManager = library.get_manager(NsiliManagerType.ORDER_MGR.getSpecName(), accessCriteria);
            orderMgr = OrderMgrHelper.narrow(libraryManager);
            LOGGER.info(SOURCE_RETURNED, orderMgr.getClass());
        } else if (managerType.equals(NsiliManagerType.PRODUCT_MGR.getSpecName())) {
            LOGGER.info("Getting ProductMgr from source...");
            LibraryManager libraryManager = library.get_manager(NsiliManagerType.PRODUCT_MGR.getSpecName(), accessCriteria);
            productMgr = ProductMgrHelper.narrow(libraryManager);
            LOGGER.info(SOURCE_RETURNED, productMgr.getClass());
        } else if (managerType.equals(NsiliManagerType.DATA_MODEL_MGR.getSpecName())) {
            LOGGER.info("Getting DataModelMgr from source...");
            LibraryManager libraryManager = library.get_manager(NsiliManagerType.DATA_MODEL_MGR.getSpecName(), accessCriteria);
            dataModelMgr = DataModelMgrHelper.narrow(libraryManager);
            LOGGER.info(SOURCE_RETURNED, dataModelMgr.getClass());
        } else if (managerType.equals(NsiliManagerType.STANDING_QUERY_MGR.getSpecName())) {
            LOGGER.info("Getting StandingQueryMgr from source...");
            LibraryManager libraryManager = library.get_manager(NsiliManagerType.STANDING_QUERY_MGR.getSpecName(), accessCriteria);
            standingQueryMgr = StandingQueryMgrHelper.narrow(libraryManager);
            LOGGER.info(SOURCE_RETURNED, standingQueryMgr.getClass());
        }
    }
}
Also used : LibraryManager(org.codice.alliance.nsili.common.GIAS.LibraryManager) AccessCriteria(org.codice.alliance.nsili.common.GIAS.AccessCriteria)

Aggregations

LibraryManager (org.codice.alliance.nsili.common.GIAS.LibraryManager)10 Test (org.junit.Test)6 InvalidInputParameter (org.codice.alliance.nsili.common.UCO.InvalidInputParameter)3 AccessCriteria (org.codice.alliance.nsili.common.GIAS.AccessCriteria)2 UCO.exception_details (org.codice.alliance.nsili.common.UCO.exception_details)2 ProcessingFault (org.codice.alliance.nsili.common.UCO.ProcessingFault)1 SystemFault (org.codice.alliance.nsili.common.UCO.SystemFault)1 CatalogMgrImpl (org.codice.alliance.nsili.mockserver.impl.managers.CatalogMgrImpl)1 DataModelMgrImpl (org.codice.alliance.nsili.mockserver.impl.managers.DataModelMgrImpl)1 OrderMgrImpl (org.codice.alliance.nsili.mockserver.impl.managers.OrderMgrImpl)1 ProductMgrImpl (org.codice.alliance.nsili.mockserver.impl.managers.ProductMgrImpl)1 Object (org.omg.CORBA.Object)1