Package org.encuestame.utils.json

Examples of org.encuestame.utils.json.NotificationResume


     * @throws Exception
     */
    @SubscribeMapping("/notifications")
  public NotificationResume getPositions() throws Exception {
    log.debug("/notifications-ws")
    final NotificationResume notificationResume = new NotificationResume();
    try {
            final String username = getUserPrincipalUsername();
           
            log.debug("notifications-ws User get by getUserPrincipalUsername ---> " + getUserPrincipalUsername());
            UserAccount userAccount;
            if (!username.isEmpty()) {
                userAccount = getByUsername(username);
                if (userAccount != null) {
                    final Long totalNot = getNotificationDao().retrieveTotalNotificationStatus(userAccount.getAccount());
                    log.debug("totalNot "+totalNot);
                    final Long totalNewNot = getNotificationDao().retrieveTotalNotReadedNotificationStatus(userAccount.getAccount());
                    log.debug("totalNewNot "+totalNewNot);
                    notificationResume.setTotalNot(totalNot);
                    notificationResume.setTotalNewNot(totalNewNot);
                    log.debug(totalNewNot + " NEW of "+totalNot+" total not");
                } else {
                  notificationResume.setTotalNot(0L);
                    notificationResume.setTotalNewNot(0L);
                }
            } else {
                throw new EnMeExpcetion("Auth object is not valid");
            }
        } catch (EnMeExpcetion e) {
          notificationResume.setTotalNot(0L);
            notificationResume.setTotalNewNot(0L);
             log.fatal("cometd: username invalid");
        }
    return notificationResume;
  }
View Full Code Here


   */
  @Scheduled(cron = "${cron.sendNotifications}")
  public void sendNotifications() {
    if (EnMePlaceHolderConfigurer.getSystemInstalled()) {
      String username = "demo10";
      final NotificationResume notificationResume = new NotificationResume();
      notificationResume.setTotalNewNot(RandomUtils.nextLong());
      notificationResume.setTotalNot(RandomUtils.nextLong());
      //this.messagingTemplate.convertAndSend("/topic/notification-updates." + username, notificationResume);
    }
  }
View Full Code Here

TOP

Related Classes of org.encuestame.utils.json.NotificationResume

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.