Package domain

Examples of domain.Message


            errors.rejectValue("client", "message.emptyclient");
            return showForm(request, errors, getFormView());
        }
        //end check DTO

        Message mss = new Message();
        mss.setClient(dto.getClient());
        mss.setDate(new Date());
        Client sender = getDao().getById(Collaborator.class, getUserInfo().getCurrentCollaboratorId()).getClient();
        mss.setSender(sender);
        mss.setSubject(dto.getSubject());
        mss.setText(dto.getText());
        getDao().save(mss);
        return new ModelAndView("redirect:/operator/message/outbox.htm");
    }
View Full Code Here


        String requestStr = hsr.getParameter("request");
        if (requestStr == null || requestStr.isEmpty()) {
            return new ModelAndView("redirect:/operator/message/messagelist.htm");
        }
       
        Message request = null;
        try {
            request = CH.get(getDao(), Message.class, hsr.getParameter("request"));
        } catch (Exception ex) {
        }
        if (request != null) {
View Full Code Here

        String requestStr = hsr.getParameter("request");
        if (requestStr == null || requestStr.isEmpty()) {
            return new ModelAndView("redirect:/operator/message/messagelist.htm");
        }
       
        Message request = null;
        try {
            request = CH.get(getDao(), Message.class, hsr.getParameter("request"));
        } catch (Exception ex) {
        }
        if (request != null) {
            request.setDelivered(true);
            getDao().save(request);
        }
        return new ModelAndView("redirect:/operator/message/messagelist.htm");
    }
View Full Code Here

        String requestStr = hsr.getParameter("request");
        if (requestStr == null || requestStr.isEmpty()) {
            return new ModelAndView("redirect:/users/messagelist.htm");
        }
       
        Message request = null;
        try {
            request = CH.get(getDao(), Message.class, hsr.getParameter("request"));
        } catch (Exception ex) {
        }
        if (request != null) {
View Full Code Here

        String requestStr = hsr.getParameter("request");
        if (requestStr == null || requestStr.isEmpty()) {
            return new ModelAndView("redirect:/users/messagelist.htm");
        }
       
        Message request = null;
        try {
            request = CH.get(getDao(), Message.class, hsr.getParameter("request"));
        } catch (Exception ex) {
        }
        if (request != null) {
            request.setDelivered(true);
            getDao().save(request);
        }
        return new ModelAndView("redirect:/users/messagelist.htm");
    }
View Full Code Here

   @Test(dependsOnMethods = { "listMessagesByIds" })
   public void getMessage() throws Exception {
      for (String zoneId : zones) {
         MessageApi messageApi = api.getMessageApiForZoneAndClientAndQueue(zoneId, CLIENT_ID, "jclouds-test");

         Message message = messageApi.get(getLast(messageIds.get(zoneId)));

         assertNotNull(message.getId());
         assertNotNull(message.getBody());
      }
   }
View Full Code Here

   public void deleteMessagesByClaimId() throws Exception {
      for (String zoneId : zones) {
         UUID clientId = UUID.fromString("3381af92-2b9e-11e3-b191-71861300734c");
         MessageApi messageApi = api.getMessageApiForZoneAndClientAndQueue(zoneId, CLIENT_ID, "jclouds-test");
         ClaimApi claimApi = api.getClaimApiForZoneAndClientAndQueue(zoneId, clientId, "jclouds-test");
         Message message = getOnlyElement(claimApi.claim(300, 100, 1));

         boolean success = messageApi.deleteByClaim(message.getId(), message.getClaimId().get());

         assertTrue(success);
      }
   }
View Full Code Here

      try {
         MarconiApi api = api(server.getUrl("/").toString(), "openstack-marconi");
         MessageApi messageApi = api.getMessageApiForZoneAndClientAndQueue("DFW", CLIENT_ID, "jclouds-test");

         Message message = messageApi.get("5292b30cef913e6d026f4dec");

         assertEquals(message.getId(), "5292b30cef913e6d026f4dec");
         assertEquals(message.getBody(), "{\"event\":{\"name\":\"Edmonton Java User Group\",\"attendees\":[\"bob\",\"jim\",\"sally\"]}}");
         assertEquals(message.getAge(), 266);
         assertEquals(message.getTTL(), 86400);

         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         assertEquals(server.takeRequest().getRequestLine(), "GET /v1/123123/queues/jclouds-test/messages/5292b30cef913e6d026f4dec HTTP/1.1");
      }
View Full Code Here

   @Test(dependsOnMethods = { "listMessagesByIds" })
   public void getMessage() throws Exception {
      for (String zoneId : zones) {
         MessageApi messageApi = api.getMessageApiForZoneAndClientAndQueue(zoneId, CLIENT_ID, "jclouds-test");

         Message message = messageApi.get(getLast(messageIds.get(zoneId)));

         assertNotNull(message.getId());
         assertNotNull(message.getBody());
      }
   }
View Full Code Here

   public void deleteMessagesByClaimId() throws Exception {
      for (String zoneId : zones) {
         UUID clientId = UUID.fromString("3381af92-2b9e-11e3-b191-71861300734c");
         MessageApi messageApi = api.getMessageApiForZoneAndClientAndQueue(zoneId, CLIENT_ID, "jclouds-test");
         ClaimApi claimApi = api.getClaimApiForZoneAndClientAndQueue(zoneId, clientId, "jclouds-test");
         Message message = getOnlyElement(claimApi.claim(300, 100, 1));

         boolean success = messageApi.deleteByClaim(message.getId(), message.getClaimId().get());

         assertTrue(success);
      }
   }
View Full Code Here

TOP

Related Classes of domain.Message

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.