// This method returns the destination list for a message
  private Vector<SocketInfo> getDestinationList(Element element, boolean senderIsMailUser) {
    Vector<SocketInfo> usersVector = new Vector<SocketInfo>();

    String target = element.getChildText("toName");

    // If sender is a POS user
    if (!senderIsMailUser) {
      usersVector = SocketServer.getAllClients(groupID);
    }
    // If sender is a POP user
    else {
      // If destination is one user
      if (target != null) {
        SocketInfo destination = getUserData(target, false);
        if (destination != null) {
          usersVector.add(destination);
          return usersVector;
        }
      }
      // If destination is a group
      usersVector = SocketServer.getAllClients(target);
    }

    return usersVector;
  }
  // This method sends an alarm message to the CoMeet group when the system fails
  public static void sendAlarm(String subject, String body) {
    Vector<SocketInfo> usersVector = SocketServer.getAllClients("COMEET");
    int groupSize = usersVector.size();
    Date date = Calendar.getInstance().getTime();
    String dateString = formatDate.format(date);
    String hourString = formatHour.format(date);

    for (SocketInfo destination : usersVector) {
      EmailSender mail = new EmailSender();
      mail.setFrom(Pop3Handler.getUser() + "@" + Pop3Handler.getHost());
      mail.setSender(destination.getEmail());
      mail.setSubject("[Error CoMeet]: " + subject);
      mail.setDate(date);
      mail.setMessage(body);
      mail.setSenderFullName("Sistema CoMeet");
      mail.setWorkStation("Servidor");
      mail.send();
      LogWriter.write(
          "INFO: Enviando notificacion de alarma a {"
              + destination.getEmail()
              + "} / Asunto: ["
              + subject
              + "]");

      String isValid = groupSize > 0 ? "true" : "false";
      String[] argsArray = {
        String.valueOf(destination.getUid()),
        String.valueOf(0),
        dateString,
        hourString,
        subject.trim(),
        body.trim(),
        isValid,
        String.valueOf(ConfigFileHandler.getMessageLifeTimeForClients()),
        "false",
        "-1"
      };

      QueryRunner qRunner = null;
      try {
        LogWriter.write("INFO: Almacenando registro de alarma en la base de datos...");
        qRunner = new QueryRunner("INS0003", argsArray);
        qRunner.setAutoCommit(false);
        qRunner.executeSQL();
        qRunner.commit();
      } catch (SQLNotFoundException e) {
        qRunner.rollback();
        LogWriter.write(
            "ERROR: No se pudo almacenar mensaje en la base de datos. Instruccion SQL no encontrada");
        e.printStackTrace();
      } catch (SQLBadArgumentsException e) {
        qRunner.rollback();
        LogWriter.write(
            "ERROR: No se pudo almacenar mensaje en la base de datos. Argumentos Invalidos");
        e.printStackTrace();
      } catch (SQLException e) {
        qRunner.rollback();
        LogWriter.write("ERROR: No se pudo almacenar mensaje en la base de datos. Excepcion SQL");
        e.printStackTrace();
      } finally {
        qRunner.closeStatement();
        qRunner.setAutoCommit(true);
      }
    }
  }