use of org.codice.alliance.nsili.endpoint.requests.OrderRequestImpl in project alliance by codice.
the class OrderMgrImpl method order.
@Override
public OrderRequest order(OrderContents order, NameValue[] properties) throws ProcessingFault, InvalidInputParameter, SystemFault {
String protocol = "http";
int port = 80;
for (NameValue prop : properties) {
if (prop.aname.equals(NsiliConstants.PROP_PROTOCOL)) {
protocol = DAGConverter.getString(prop.value);
} else if (prop.aname.equals(NsiliConstants.PROP_PORT)) {
Integer portInteger = DAGConverter.getInteger(prop.value);
if (portInteger != null) {
port = portInteger;
}
}
}
OrderRequestImpl orderRequestImpl = new OrderRequestImpl(order, protocol, port, getAccessManager(), catalogFramework, emailConfiguration);
String id = UUID.randomUUID().toString();
try {
_poa().activate_object_with_id(id.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), orderRequestImpl);
} catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
LOGGER.debug("order : Unable to activate orderRequest object.", e);
}
org.omg.CORBA.Object obj = _poa().create_reference_with_id(id.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), OrderRequestHelper.id());
OrderRequest orderRequest = OrderRequestHelper.narrow(obj);
return orderRequest;
}
Aggregations