Search in sources :

Example 1 with AccessCriteria

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

the class NsiliSource method initMandatoryManagers.

/**
 * Initializes all STANAG 4559 mandatory managers: CatalogMgr OrderMgr DataModelMgr ProductMgr
 */
private void initMandatoryManagers() {
    try {
        accessCriteria = new AccessCriteria(accessUserId, accessPassword, accessLicenseKey);
        LibraryManager libraryManager = library.get_manager(CATALOG_MGR, accessCriteria);
        setCatalogMgr(CatalogMgrHelper.narrow(libraryManager));
        libraryManager = library.get_manager(ORDER_MGR, accessCriteria);
        setOrderMgr(OrderMgrHelper.narrow(libraryManager));
        libraryManager = library.get_manager(PRODUCT_MGR, accessCriteria);
        setProductMgr(ProductMgrHelper.narrow(libraryManager));
        libraryManager = library.get_manager(DATA_MODEL_MGR, accessCriteria);
        setDataModelMgr(DataModelMgrHelper.narrow(libraryManager));
    } catch (ProcessingFault | SystemFault | InvalidInputParameter e) {
        LOGGER.debug("{} : Unable to retrieve mandatory managers.", sourceId, e);
    }
    if (catalogMgr != null && orderMgr != null && productMgr != null && dataModelMgr != null) {
        LOGGER.debug("{} : Initialized STANAG mandatory managers.", getId());
    } else {
        LOGGER.debug("{} : Unable to initialize mandatory mangers.", getId());
    }
}
Also used : SystemFault(org.codice.alliance.nsili.common.UCO.SystemFault) LibraryManager(org.codice.alliance.nsili.common.GIAS.LibraryManager) AccessCriteria(org.codice.alliance.nsili.common.GIAS.AccessCriteria) InvalidInputParameter(org.codice.alliance.nsili.common.UCO.InvalidInputParameter) ProcessingFault(org.codice.alliance.nsili.common.UCO.ProcessingFault)

Example 2 with AccessCriteria

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

the class NsiliEndpointTest method setUp.

@Before
public void setUp() throws SecurityServiceException, AdapterInactive, InvalidName, ServantNotActive, WrongPolicy, IOException {
    setupCommonMocks();
    setupOrb();
    doReturn(orb).when(mockCorbaOrb).getOrb();
    testAccessCriteria = new AccessCriteria("", "", "");
    createEndpoint();
}
Also used : AccessCriteria(org.codice.alliance.nsili.common.GIAS.AccessCriteria) Before(org.junit.Before)

Example 3 with AccessCriteria

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

AccessCriteria (org.codice.alliance.nsili.common.GIAS.AccessCriteria)3 LibraryManager (org.codice.alliance.nsili.common.GIAS.LibraryManager)2 InvalidInputParameter (org.codice.alliance.nsili.common.UCO.InvalidInputParameter)1 ProcessingFault (org.codice.alliance.nsili.common.UCO.ProcessingFault)1 SystemFault (org.codice.alliance.nsili.common.UCO.SystemFault)1 Before (org.junit.Before)1