INFOBJFLIGHT infobjFlight = new INFOBJFLIGHT();
MSGOBJECTS msgobjects = new MSGOBJECTS();
INFOBJGENERIC infobjgeneric = new INFOBJGENERIC();
INFOJXAFTAB infojxaftab = new INFOJXAFTAB();
INFOBJFUELSTATUS infofuelstatus = new INFOBJFUELSTATUS();
INFOJFEVTABLIST infojfevtablist = new INFOJFEVTABLIST();
Boolean xafFound = false;
Boolean fevFound = false;
/*
* REGN Java program has to trim the hyphen char '-'
*/
infobjFlight.setREGN(aftFlight.getRegn());
/*
* Change to number for both in order to compare when use to search
* flight
*/
//infobjFlight.setFLTN(flightEvent.getEGDSBODY().getFNR());
infobjFlight.setALC2(aftFlight.getAlc2());
infobjFlight.setALC3(aftFlight.getAlc3());
infobjFlight.setFLDA(aftFlight.getFlda());
infobjFlight.setFLTN(aftFlight.getFltn());
infobjFlight.setORG3(flightEvent.getEGDSBODY().getDEP());
if ("DXB".equals(flightEvent.getEGDSBODY().getDEP()) && "DXB".equals(flightEvent.getEGDSBODY().getARR())) {
infobjFlight.setADID(ADID.B);
} else if ("DXB".equals(flightEvent.getEGDSBODY().getDEP())) {
infobjFlight.setADID(ADID.D);
} else {
infobjFlight.setADID(ADID.fromValue(aftFlight.getAdid().toString()));
}
// according to type settle down return message
if (flightEvent.getEGDSBODY().getTYPE() != null) {
switch (flightEvent.getEGDSBODY().getTYPE()) {
case MVT:
/*
* OUT -> AOBN
* OFF -> ATON
* ON -> ALDN
* IN -> AIBN
*/
if (HpUfisUtils.isNotEmptyStr(flightEvent.getEGDSBODY().getTRIGEVT())) {
String trigevt = flightEvent.getEGDSBODY().getTRIGEVT();
if (trigevt.contains("OUT")) {
infobjFlight.setAOBN(flightEvent.getEGDSBODY().getATA());
} else if (trigevt.contains("OFF")) {
infobjFlight.setATON(flightEvent.getEGDSBODY().getATA());
} else if (trigevt.contains("ON")) {
infobjFlight.setALDN(flightEvent.getEGDSBODY().getATA());
} else if (trigevt.contains("IN")) {
infobjFlight.setAIBN(flightEvent.getEGDSBODY().getATA());
}
}
if (HpUfisUtils.isNotEmptyStr(flightEvent.getEGDSBODY().getFOB())) {
infojxaftab.setFUOB(flightEvent.getEGDSBODY().getFOB());
xafFound = true;
}
// Cargo Door closed and Cabin Door closed
if (HpUfisUtils.isNotEmptyStr(flightEvent.getEGDSBODY().getCARD())) {
ufisCalendar.setTime(flightEvent.getEGDSBODY().getCARD(), ufisCalendar.getCustomFormat());
INFOJFEVTAB cargoDoor = new INFOJFEVTAB();
cargoDoor.setSTNM("CARGO DOOR CLOSED");
cargoDoor.setSTTM(ufisCalendar.getCedaString());
infojfevtablist.getINFOJFEVTAB().add(cargoDoor);
fevFound = true;
}
if (HpUfisUtils.isNotEmptyStr(flightEvent.getEGDSBODY().getCABD())) {
ufisCalendar.setTime(flightEvent.getEGDSBODY().getCABD(), ufisCalendar.getCustomFormat());
INFOJFEVTAB cabinDoor = new INFOJFEVTAB();
cabinDoor.setSTNM("CABIN DOOR CLOSED");
cabinDoor.setSTTM(ufisCalendar.getCedaString());
infojfevtablist.getINFOJFEVTAB().add(cabinDoor);
fevFound = true;
}
break;
case PROGRESSREPORT:
// if (HpUfisUtils.isNotEmptyStr(flightEvent.getEGDSBODY().getETA())) {
// infobjFlight.setELDN(flightEvent.getEGDSBODY().getETA());
// }
infobjFlight.setEIBN(flightEvent.getEGDSBODY().getETA());
break;
case LOADACC:
infojxaftab.setLSHT(flightEvent.getEGDSBODY().getLOADSHEET());
// if (HpUfisUtils.isNotEmptyStr(flightEvent.getEGDSBODY().getZFW())) {
// infojxaftab.setZFWT(flightEvent.getEGDSBODY().getZFW());
// xafFound = true;
// }
// if (HpUfisUtils.isNotEmptyStr(flightEvent.getEGDSBODY().getTOW())) {
// infojxaftab.setTOWT(flightEvent.getEGDSBODY().getTOW());
// xafFound = true;
// }
break;
case ROUTE:
// confirm message from pilot that crew is on board
// due to if NON-EK need to ignore whole message
infobjgeneric.setALC2("EK");
if (HpUfisUtils.isNotEmptyStr(flightEvent.getEGDSHEADER().getTIMESTAMP())) {
ufisCalendar.setTime(flightEvent.getEGDSHEADER().getTIMESTAMP(), ufisCalendar.getCustomFormat());
INFOJFEVTAB route = new INFOJFEVTAB();
route.setSTNM("Route Request");
route.setSTRM("<ACR>");
route.setSTTM(ufisCalendar.getCedaString());
infojfevtablist.getINFOJFEVTAB().add(route);
fevFound = true;
}
break;
case FUEL:
// message send datetime
ufisCalendar.setTime(flightEvent.getEGDSHEADER().getTIMESTAMP(), ufisCalendar.getCustomFormat());
infofuelstatus.setMSGSENDDATE(ufisCalendar.getCedaString());
// regn
infofuelstatus.setFLTREGN(aftFlight.getRegn());
// alc2
infofuelstatus.setAIRLINECODE2(aftFlight.getAlc2());
// org3
infofuelstatus.setFLTORIGIN3(aftFlight.getOrg3());
// des3
infofuelstatus.setFLTDEST3(aftFlight.getDes3());
// trip_fuel
infofuelstatus.setTRIPFUEL(flightEvent.getEGDSBODY().getTripFuel());
// taxi_fuel
infofuelstatus.setTAXIFUEL(flightEvent.getEGDSBODY().getTaxiFuel());
// ramp_fuel
infofuelstatus.setRAMPFUEL(flightEvent.getEGDSBODY().getRampFuel());
// trm
infofuelstatus.setTRM(flightEvent.getEGDSBODY().getTRM());
// den
infofuelstatus.setDEN(flightEvent.getEGDSBODY().getDEN());
// rtw
infofuelstatus.setRTW(flightEvent.getEGDSBODY().getRTW());
break;
}
}
/*