InterfaceConfig interfaceConfig, Long irmtabRef) {
long startTime = new Date().getTime();
TelemetryDataMessages proveoMessage = new TelemetryDataMessages();
List<TelemetryDataMessage> telemetryMsgList = Collections.EMPTY_LIST;
EventTypes eventType = null;
EntDbEquipPos equipPosIns;
String dtflString = _startupInitSingleton.getDtflStr();
msgLogged = Boolean.FALSE;
logLevel = _startupInitSingleton.getIrmLogLev();
// List<EntDbEquipPos> equipPosPersistRecs = new
// ArrayList<EntDbEquipPos>();
// String cmdForBroadcasting = null;
EntDbEquipPos equipPosPersistRec = null;
Boolean isLast = Boolean.FALSE;
if (irmtabRef > 0) {
msgLogged = Boolean.TRUE;
}
try {
JAXBElement<TelemetryDataMessages> data = _um.unmarshal(
new StreamSource(new StringReader(message)),
TelemetryDataMessages.class);
proveoMessage = (TelemetryDataMessages) data.getValue();
if (proveoMessage == null) {
LOG.info(
" Dropping the message. Message is NOT Valid. MSG : {}",
message);
if (logLevel
.equalsIgnoreCase(HpUfisAppConstants.IrmtabLogLev.LOG_ERR
.name())) {
if (!msgLogged) {
irmtabRef = _irmfacade.storeRawMsg(inMessage,
dtflString);
msgLogged = Boolean.TRUE;
}
}
if (irmtabRef > 0) {
sendErrInfo(EnumExceptionCodes.EXSDF, irmtabRef,
"Invalid Message");
}
return false;
}
if (proveoMessage.getTelemetryDataMessage().isEmpty()) {
LOG.info(
"Dropping the message. No TelemetryDataMessages are defined in the MSG: {}",
message);
if (logLevel
.equalsIgnoreCase(HpUfisAppConstants.IrmtabLogLev.LOG_ERR
.name())) {
if (!msgLogged) {
irmtabRef = _irmfacade.storeRawMsg(inMessage,
dtflString);
msgLogged = Boolean.TRUE;
}
}
if (irmtabRef > 0) {
sendErrInfo(EnumExceptionCodes.EXSDF, irmtabRef,
"No TelemetryDataMessage defined");
}
return false;
}
if (proveoMessage.getEventType() == null) {
LOG.info(
"Dropping the message. Event Type is either not specified or an Invalid value(NOT in GEO,STATE,NOTIFY) in the MSG : {}",
message);
if (logLevel
.equalsIgnoreCase(HpUfisAppConstants.IrmtabLogLev.LOG_ERR
.name())) {
if (!msgLogged) {
irmtabRef = _irmfacade.storeRawMsg(inMessage,
dtflString);
msgLogged = Boolean.TRUE;
}
}
if (irmtabRef > 0) {
sendErrInfo(EnumExceptionCodes.EWEVT, irmtabRef,
"Event Type is NULL(Invalid Or Not Specified)");
}
return false;
}
if (mdEquipMap.isEmpty()) {
LOG.info("Loading masterdata EntDbMdEquip into Map");
// List<EntDbMdEquip> equipMasterdataList =
// _startupInitSingleton.getMdEquipList();
// for (EntDbMdEquip equipEnt : equipMasterdataList) {
// mdEquipMap.put(equipEnt.getEquipNum(), equipEnt);
// }
mdEquipMap = _startupInitSingleton.getMdEquipList();
}
if (mdEquipLocMap.isEmpty()) {
LOG.info("Loading masterdata EntDbMdEquipLoc into Map");
// List<EntDbMdEquipLoc> equipMasterdataList =
// _startupInitSingleton.getMdEquipLocList();
// for (EntDbMdEquipLoc equipEntLoc : equipMasterdataList) {
// mdEquipLocMap.put(equipEntLoc.getEquipArea(), equipEntLoc);
// }
mdEquipLocMap = _startupInitSingleton.getMdEquipLocList();
}
if ((_startupInitSingleton.isMdEquipLocOn() && mdEquipLocMap
.isEmpty())
|| (_startupInitSingleton.isMdEquipOn() && mdEquipMap
.isEmpty())) {
LOG.error("Either of Master data(MD_EQUIP/MD_EQUIP_LOC) is EMPTY");
}
telemetryMsgList = proveoMessage.getTelemetryDataMessage();
eventType = proveoMessage.getEventType();
LOG.info("Total TelemetryDataMessages : {}",
telemetryMsgList.size() + " Time For Mandatory Checks:"
+ (new Date().getTime() - startTime));
int size = telemetryMsgList.size();
for (TelemetryDataMessage teleMsg : telemetryMsgList) {
if (teleMsg.equals(telemetryMsgList.get(size - 1))) {
isLast = Boolean.TRUE;
}
LOG.debug("ISLAST:{}", isLast);
long startTime1 = new Date().getTime();
// LOG.info("Processing TelemetryDataMessages : {}",
// (startTime1));
if (HpUfisUtils.isNullOrEmptyStr(teleMsg.getMessageId())) {
LOG.info(
"Dropping the message.Mandatory Field Message ID is not Specified in the TeleMessage. Tele Message ID:{}",
teleMsg.getMessageId());
if (logLevel
.equalsIgnoreCase(HpUfisAppConstants.IrmtabLogLev.LOG_ERR
.name())) {
if (!msgLogged) {
irmtabRef = _irmfacade.storeRawMsg(inMessage,
dtflString);
msgLogged = Boolean.TRUE;
}
}
if (irmtabRef > 0) {
sendErrInfo(
EnumExceptionCodes.EMAND,
irmtabRef,
("Message Id(Mandatory Field) is Null. Tele Message ID:" + teleMsg
.getMessageId()));
}
continue;
}
if (HpUfisUtils.isNullOrEmptyStr(teleMsg.getProveoId())
|| HpUfisUtils.isNullOrEmptyStr(teleMsg.getUnitName())) {
LOG.info(
"Dropping the message.Mandatory Field (Proveo ID/Unit Name) is not Specified in the message. Tele Message ID:{}",
teleMsg.getMessageId());
if (logLevel
.equalsIgnoreCase(HpUfisAppConstants.IrmtabLogLev.LOG_ERR
.name())) {
if (!msgLogged) {
irmtabRef = _irmfacade.storeRawMsg(inMessage,
dtflString);
msgLogged = Boolean.TRUE;
}
}
if (irmtabRef > 0) {
sendErrInfo(
EnumExceptionCodes.EMAND,
irmtabRef,
("Either Proveo Id OR Unit Name(Mandatory Fields) is Null.Tele Message ID:" + teleMsg
.getMessageId()));
}
// return false;
continue;
}
equipPosIns = new EntDbEquipPos();
equipPosIns.setTrackNum(teleMsg.getProveoId());
// Look into master data for the equip Number
if (!mdEquipMap.isEmpty()) {
if (!mdEquipMap.contains(teleMsg.getUnitName()
.toUpperCase())) {