String convertToXml = blGroovyHandlerBean.convertToXml(message);
LOG.debug("Converted Xml by Groovy :\n{}", convertToXml);
Cargo inputUWSInfo = (Cargo) _um.unmarshal(new StreamSource(new StringReader(convertToXml)));
Meta meta = inputUWSInfo.getMeta();
UWSInfo uwsInfo = inputUWSInfo.getUWSInfo();
if(existsMandatory(meta, uwsInfo)) {
LOG.warn("Compulsory uws info are empty. Message will be dropped.");
addExptInfo(EMAND.name(), "");
return false;
}
if(!meta.getType().equalsIgnoreCase(UWS)) {
LOG.warn("Processing performs only for UWS. Message will be dropped.");
addExptInfo(EWVAL.name(), meta.getType());
return false;
}
if(!OP_TYPE.UPD.name().equalsIgnoreCase(meta.getSubtype().trim())) {
LOG.warn("Processing performs only for UPD sub type. Message will be dropped.");
addExptInfo(EENUM.name(), meta.getSubtype());
return false;
}
if(!meta.getSource().equalsIgnoreCase(SKY_CHAIN)) {
LOG.error("Processing performs only for SkyChain. Message will be dropped.");
addExptInfo(EWVAL.name(), meta.getSource());
return false;
}
FlightInfo inputFlightID = uwsInfo.getFlightInfo();
String flightNumber = formatFlightNo(inputFlightID.getFlightNumber());