Search in sources :

Example 1 with OrderMgrImpl

use of org.codice.alliance.nsili.mockserver.impl.managers.OrderMgrImpl in project alliance by codice.

the class LibraryImpl method get_manager.

@Override
public LibraryManager get_manager(String manager_type, AccessCriteria access_criteria) throws ProcessingFault, InvalidInputParameter, SystemFault {
    org.omg.CORBA.Object obj;
    switch(manager_type) {
        case "CatalogMgr":
            CatalogMgrImpl catalogMgr = new CatalogMgrImpl(poa_);
            try {
                poa_.activate_object_with_id(manager_type.getBytes(Charset.forName(ENCODING)), catalogMgr);
            } catch (Exception e) {
            // Ignore
            }
            obj = poa_.create_reference_with_id(manager_type.getBytes(Charset.forName(ENCODING)), CatalogMgrHelper.id());
            break;
        case "OrderMgr":
            OrderMgrImpl orderMgr = new OrderMgrImpl();
            try {
                poa_.activate_object_with_id(manager_type.getBytes(Charset.forName(ENCODING)), orderMgr);
            } catch (Exception e) {
            // Ignore
            }
            obj = poa_.create_reference_with_id(manager_type.getBytes(Charset.forName(ENCODING)), OrderMgrHelper.id());
            break;
        case "ProductMgr":
            ProductMgrImpl productMgr = new ProductMgrImpl();
            try {
                poa_.activate_object_with_id(manager_type.getBytes(Charset.forName(ENCODING)), productMgr);
            } catch (Exception e) {
            // Ignore
            }
            obj = poa_.create_reference_with_id(manager_type.getBytes(Charset.forName(ENCODING)), ProductMgrHelper.id());
            break;
        case "DataModelMgr":
            DataModelMgrImpl dataModelMgr = new DataModelMgrImpl();
            try {
                poa_.activate_object_with_id(manager_type.getBytes(Charset.forName(ENCODING)), dataModelMgr);
            } catch (Exception e) {
            // Ignore
            }
            obj = poa_.create_reference_with_id(manager_type.getBytes(Charset.forName(ENCODING)), DataModelMgrHelper.id());
            break;
        default:
            String[] bad_params = { manager_type };
            throw new InvalidInputParameter("UnknownMangerType", new exception_details("UnknownMangerType", true, manager_type), bad_params);
    }
    LibraryManager libraryManager = LibraryManagerHelper.narrow(obj);
    return libraryManager;
}
Also used : OrderMgrImpl(org.codice.alliance.nsili.mockserver.impl.managers.OrderMgrImpl) DataModelMgrImpl(org.codice.alliance.nsili.mockserver.impl.managers.DataModelMgrImpl) ProductMgrImpl(org.codice.alliance.nsili.mockserver.impl.managers.ProductMgrImpl) UCO.exception_details(org.codice.alliance.nsili.common.UCO.exception_details) LibraryManager(org.codice.alliance.nsili.common.GIAS.LibraryManager) CatalogMgrImpl(org.codice.alliance.nsili.mockserver.impl.managers.CatalogMgrImpl) InvalidInputParameter(org.codice.alliance.nsili.common.UCO.InvalidInputParameter)

Aggregations

LibraryManager (org.codice.alliance.nsili.common.GIAS.LibraryManager)1 InvalidInputParameter (org.codice.alliance.nsili.common.UCO.InvalidInputParameter)1 UCO.exception_details (org.codice.alliance.nsili.common.UCO.exception_details)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