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 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;
}
use of org.codice.alliance.nsili.common.GIAS.LibraryManager 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());
}
}
use of org.codice.alliance.nsili.common.GIAS.LibraryManager in project alliance by codice.
the class NsiliEndpointTest method testGetDataModelMgr.
@Test
public void testGetDataModelMgr() throws Exception {
LibraryManager dataModelMgr = nsiliEndpoint.getLibrary().get_manager(NsiliManagerType.DATA_MODEL_MGR.getSpecName(), testAccessCriteria);
assertThat(dataModelMgr, notNullValue());
}
use of org.codice.alliance.nsili.common.GIAS.LibraryManager in project alliance by codice.
the class NsiliEndpointTest method testGetProductMgr.
@Test
public void testGetProductMgr() throws Exception {
LibraryManager productMgr = nsiliEndpoint.getLibrary().get_manager(NsiliManagerType.PRODUCT_MGR.getSpecName(), testAccessCriteria);
assertThat(productMgr, notNullValue());
}
use of org.codice.alliance.nsili.common.GIAS.LibraryManager in project alliance by codice.
the class NsiliEndpointTest method testGetCatalogMgr.
@Test
public void testGetCatalogMgr() throws Exception {
LibraryManager catalogMgr = nsiliEndpoint.getLibrary().get_manager(NsiliManagerType.CATALOG_MGR.getSpecName(), testAccessCriteria);
assertThat(catalogMgr, notNullValue());
}
Aggregations