Examples of TipoMensaje


Examples of es.emergya.bbdd.bean.TipoMensaje

      dispose();
    }
  }

  private Outbox send() {
    TipoMensaje tmensaje = TipoMensajeConsultas
        .getTipoByCode(es.emergya.utils.LogicConstants
            .getInt("SDS", 31));

    if (destino.getDispositivo() == null) {
      notification.setText(i18n.getString("progress.message.nodevice"));
      notification.setForeground(Color.RED);

      return null;
    }

    try {
      return MessageGenerator.sendMessage(tmensaje.getCodigo(),
          tmensaje.getTipoTetra(), tmensaje.getPrioridad(),
          sds.getText(), destino.getDispositivo().toString());
    } catch (MessageGeneratingException ex) {
      notification.setText(i18n.getString("progress.message.fail"));
      notification.setForeground(Color.RED);
View Full Code Here

Examples of es.emergya.bbdd.bean.TipoMensaje

      dispose();
    }
  }

  private Outbox send() {
    TipoMensaje tmensaje = TipoMensajeConsultas
        .getTipoByCode(es.emergya.utils.LogicConstants
            .getInt("GPS", 32));

    if (target.getDispositivo() == null) {
      notification.setText(i18n.getString("progress.message.nodevice"));
      notification.setForeground(Color.RED);

      return null;
    }

    try {
      return MessageGenerator.sendMessage(tmensaje.getCodigo(), tmensaje
          .getTipoTetra(), tmensaje.getPrioridad(), LogicConstants
          .get("DATAGRAMA_SOLICITUD_GPS"), target.getDispositivo()
          .toString());
    } catch (MessageGeneratingException e) {
      notification.setText(i18n.getString("progress.message.fail"));
      notification.setForeground(Color.RED);
View Full Code Here

Examples of es.emergya.bbdd.bean.TipoMensaje

    InboxAdmin.saveOrUpdate(entrada);
  }

  @Transactional
  private Integer getTipoMensaje(Inbox entrada, String[] campos) {
    TipoMensaje tipo = null;
    try {
      Integer codigo = Integer.parseInt(campos[1]);
      tipo = tipoMensajeHome.getTipoByCode(codigo);
      if (tipo == null)
        save(entrada);
      else
        return tipo.getCodigo();
    } catch (NumberFormatException nfe) {
      save(entrada);
    }
    return -1;
  }
View Full Code Here

Examples of es.emergya.bbdd.bean.TipoMensaje

        /*
         * BODY = PATRULLA
         */
        String confirmacion = LogicConstants.get("SDS_NO",
                "Error al asignar el recurso.");
        TipoMensaje tmensaje = null;
        Recurso recurso = null;
        MessageProcessingException exception = null;
        try {
            tmensaje = TipoMensajeConsultas.getTipoByCode(SDS_CODE);
            recurso = RecursoConsultas.getbyDispositivo(entrada.getOrigen());
            if (recurso == null) {
                throw new MessageProcessingException("No encuentro el recurso "
                        + entrada.getOrigen());
            }

            if (!recurso.getHabilitado()) {
                throw new MessageProcessingException(
                        "El recurso está deshabilitado ('"
                        + recurso.getDispositivo() + "')");
            }
            recurso.setMalAsignado(true);

            Patrulla p = PatrullaConsultas.find(campos[2]);
            if (p == null) {
                throw new MessageProcessingException(
                        "No encuentro la patrulla " + campos[2]);
            }

            recurso.setPatrullas(p);
            recurso.setMalAsignado(false);
            confirmacion = LogicConstants.get("SDS_SI", "Recurso asignado.");

        } catch (Throwable t) {
            log.error(t, t);
            exception = new MessageProcessingException(
                    "Error al procesar un mensaje de asignacion de patrulla: "
                    + t, entrada);
        } finally {
            try {
                if (recurso != null) {
                    RecursoAdmin.saveOrUpdate(recurso);
                }
                MessageGenerator.sendMessage(tmensaje.getCodigo(), tmensaje.getTipoTetra(), tmensaje.getPrioridad(), confirmacion,
                        entrada.getOrigen());
            } catch (MessageGeneratingException e) {
                log.error(e, e);
                throw new MessageProcessingException(
                        "Error al enviar el mensaje " + e, entrada);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.