use of org.omg.PortableServer.POAPackage.WrongPolicy in project alliance by codice.
the class ProductMgrImplTest method setUp.
@Before
public void setUp() throws Exception {
setupCommonMocks();
setupProductMgrMocks();
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();
productMgr = new ProductMgrImpl(null);
productMgr.setFilterBuilder(new GeotoolsFilterBuilder());
productMgr.setCatalogFramework(mockCatalogFramework);
productMgr.setOutgoingValidationEnabled(false);
if (!CorbaUtils.isIdActive(rootPOA, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
try {
rootPOA.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), productMgr);
} catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
LOGGER.error("Error activating ProductMgr: {}", e);
}
}
rootPOA.create_reference_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), ProductMgrHelper.id());
}
use of org.omg.PortableServer.POAPackage.WrongPolicy in project alliance by codice.
the class StandingQueryMgrImplTest method setUp.
@Before
public void setUp() throws Exception {
setupCommonMocks();
setupStandingQueryMgrMocks();
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();
standingQueryMgr = new StandingQueryMgrImpl(null);
standingQueryMgr.setFilterBuilder(new GeotoolsFilterBuilder());
standingQueryMgr.setCatalogFramework(mockCatalogFramework);
standingQueryMgr.setDefaultUpdateFrequencyMsec(60000);
standingQueryMgr.setMaxWaitToStartTimeMsecs(TimeUnit.MINUTES.toMillis(5));
standingQueryMgr.setMaxPendingResults(10000);
if (!CorbaUtils.isIdActive(rootPOA, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
try {
rootPOA.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), standingQueryMgr);
} catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
LOGGER.error("Error activating StandingQueryMgr: {}", e);
}
}
rootPOA.create_reference_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), StandingQueryMgrHelper.id());
}
use of org.omg.PortableServer.POAPackage.WrongPolicy in project alliance by codice.
the class LibraryImpl method getCatalogMgrObject.
private Object getCatalogMgrObject(String managerId) {
Object obj;
CatalogMgrImpl catalogMgr = new CatalogMgrImpl(poa, filterBuilder, querySources);
catalogMgr.setCatalogFramework(catalogFramework);
catalogMgr.setOutgoingValidationEnabled(outgoingValidationEnabled);
catalogMgr.setRemoveSourceLibrary(removeSourceLibrary);
if (!CorbaUtils.isIdActive(poa, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
try {
poa.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), catalogMgr);
} catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
LOGGER.info("Error activating CatalogMgr: ", e);
}
}
obj = poa.create_reference_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), CatalogMgrHelper.id());
return obj;
}
use of org.omg.PortableServer.POAPackage.WrongPolicy in project alliance by codice.
the class LibraryImpl method getProductObject.
private Object getProductObject(String managerId) {
Object obj;
ProductMgrImpl productMgr = new ProductMgrImpl(querySources);
productMgr.setCatalogFramework(catalogFramework);
productMgr.setFilterBuilder(filterBuilder);
productMgr.setOutgoingValidationEnabled(outgoingValidationEnabled);
if (!CorbaUtils.isIdActive(poa, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
try {
poa.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), productMgr);
} catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
LOGGER.info("Error activating ProductMgr: ", e);
}
}
obj = poa.create_reference_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), ProductMgrHelper.id());
return obj;
}
use of org.omg.PortableServer.POAPackage.WrongPolicy in project alliance by codice.
the class CatalogMgrImpl method submit_query.
@Override
public SubmitQueryRequest submit_query(Query aQuery, String[] result_attributes, SortAttribute[] sort_attributes, NameValue[] properties) throws ProcessingFault, InvalidInputParameter, SystemFault {
BqsConverter bqsConverter = new BqsConverter(filterBuilder, removeSourceLibrary);
SubmitQueryRequestImpl submitQueryRequest = new SubmitQueryRequestImpl(aQuery, filterBuilder, bqsConverter, catalogFramework, querySources);
submitQueryRequest.set_number_of_hits(maxNumResults);
submitQueryRequest.setTimeout(defaultTimeout);
submitQueryRequest.setOutgoingValidationEnabled(outgoingValidationEnabled);
submitQueryRequest.setResultAttributes(result_attributes);
String queryId = UUID.randomUUID().toString();
try {
poa.activate_object_with_id(queryId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), submitQueryRequest);
} catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
LOGGER.debug("submit_query : Unable to activate submitQueryRequest object.", e);
}
org.omg.CORBA.Object obj = poa.create_reference_with_id(queryId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), SubmitQueryRequestHelper.id());
SubmitQueryRequest queryRequest = SubmitQueryRequestHelper.narrow(obj);
return queryRequest;
}
Aggregations