Package ek.proveo.telemetryDataMessage

Examples of ek.proveo.telemetryDataMessage.TelemetryDataMessages


  }

  public boolean routeMessage(Message inMessage, String message,
      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) {
View Full Code Here

TOP

Related Classes of ek.proveo.telemetryDataMessage.TelemetryDataMessages

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.