Examples of Inbox


Examples of com.m4f.business.domain.Inbox

  @ResponseStatus(HttpStatus.OK)
  public void sendInboxResponseEmail(
      @RequestParam(required=true) Long inboxId) {
    try {
      Locale locale = this.getAvailableLanguages().get(0);
      Inbox messageRes =
          this.serviceLocator.getInboxService().getInbox(inboxId, locale);
      Inbox messageReq = null;
      if(messageRes != null) {
        messageReq =
            this.serviceLocator.getInboxService().getInbox(messageRes.getRelatedId(), locale);
      }
      Properties props = new Properties();
      Session session = Session.getDefaultInstance(props, null);   
      try {
        Message msg = new MimeMessage(session);
        msg.setFrom(new InternetAddress(new StringBuffer("admin").append(EMAIL_DOMAIN_SUFFIX).toString(),
            this.getMessage("suggestion.problem.response.from")));
        msg.addRecipient(Message.RecipientType.TO,
                         new InternetAddress(messageReq.getFrom(), messageReq.getName()));
        msg.setSubject(this.getMessage("suggestion.problem.response.subject", messageReq.getId()));
        msg.setText(new StringBuffer(messageRes.getContent()).append("\n\n\n").append(
            this.getMessage("suggestion.problem.response.advice")).toString());
            Transport.send(msg);
      } catch (AddressException e) {
        LOGGER.log(Level.SEVERE, StackTraceUtil.getStackTrace(e));
          } catch (MessagingException e) {
            LOGGER.log(Level.SEVERE, StackTraceUtil.getStackTrace(e));
          }
         
      LOGGER.info("SENDING SEARCH RESULT TO EMAIL -> " + messageReq.getFrom());
    } catch(Exception e) {
      LOGGER.severe(StackTraceUtil.getStackTrace(e));
    }
  }
View Full Code Here

Examples of es.emergya.bbdd.bean.Inbox

  }

  @Test
  @Transactional
  public void testGetAll() throws Exception {
    Inbox be = this.bandejaEntradaDAO.get(0l);
    assertNotNull(be);
    List<Inbox> bandejaEntrada = this.bandejaEntradaDAO.getAll();
    assertTrue(bandejaEntrada.size() >= 1);
  }
View Full Code Here

Examples of es.emergya.bbdd.bean.Inbox

  public void testProcessingMessagePosicion()
      throws MessageProcessingException {
    final Double y = new Double(42.349167);
    final Double x = new Double(3.684722);
    MessageProcessor mp = new MessageProcessor();
    Inbox entrada = new Inbox();
    entrada.setDatagramaTetra("|16|" + y + ",N|" + x + ",W|1|");
    entrada.setMarcaTemporal(Calendar.getInstance().getTime());
    entrada.setOrigen("08000002");
    entrada.setProcesado(false);
    mp.processingMessage(entrada);

    final Recurso getbyDispositivo = RecursoConsultas
        .getbyDispositivo("08000002");
    if (getbyDispositivo != null) {
      HistoricoGPS historico = getbyDispositivo.getHistoricoGps();

      assertEquals(historico.getGeom().getSRID(), 4326);
      assertEquals((Double) (-x), (Double) historico.getPosX());
      assertEquals(y, (Double) historico.getPosY());
    }
    assertTrue(entrada.isProcesado());
  }
View Full Code Here

Examples of es.emergya.bbdd.bean.Inbox

      throws MessageProcessingException {
    List<Patrulla> patrullas = PatrullaConsultas.getAll();
    if (patrullas.size() > 0) {
      String patrulla = patrullas.get(0).getNombre();
      MessageProcessor mp = new MessageProcessor();
      Inbox entrada = new Inbox();
      entrada.setDatagramaTetra("|30|" + patrulla + "|");
      entrada.setMarcaTemporal(Calendar.getInstance().getTime());
      entrada.setOrigen("08000002");
      entrada.setProcesado(false);
      mp.processingMessage(entrada);
      assertTrue(entrada.isProcesado());
    }
  }
View Full Code Here

Examples of es.emergya.bbdd.bean.Inbox

  @Test
  public void testProcessingMessagePatrullaInexistente()
      throws MessageProcessingException {
    String patrulla = "avkclf";
    MessageProcessor mp = new MessageProcessor();
    Inbox entrada = new Inbox();
    entrada.setDatagramaTetra("|30|" + patrulla + "|");
    entrada.setMarcaTemporal(Calendar.getInstance().getTime());
    entrada.setOrigen("08000002");
    entrada.setProcesado(false);
    mp.processingMessage(entrada);
    assertTrue(entrada.isProcesado());
  }
View Full Code Here

Examples of org.apache.lenya.inbox.Inbox

        RepositoryEvent event = RepositoryEventFactory.createEvent(getManager(), session,
                getLogger(), descr);

        session.enqueueEvent(event);
       
        Inbox inbox = getInbox(alice);
        cleanUp(inbox, SUBJECT);
       
        assertFalse(containsMessage(inbox, SUBJECT));
        session.commit();
        Thread.sleep(100);
View Full Code Here

Examples of org.apache.lenya.inbox.Inbox

        event.setNodeUri(getFactory().getPublication("test").getArea("authoring").getSite()
                .getNode("/index").getLink("en").getDocument().getRepositoryNode().getSourceURI());

        session.enqueueEvent(event);

        Inbox inbox = getInbox(alice);
        cleanUp(inbox, SUBJECT);

        assertFalse(containsMessage(inbox, SUBJECT));
        session.commit();
        Thread.sleep(100);
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.