public void sendNotifcationToTags( String apiKey, String tag, String title, String message, String uri, boolean save) { Set<String> usernameSet = sessionManager.getUsernameSet(tag); if (usernameSet == null) { return; } Iterator<String> iterator = usernameSet.iterator(); while (iterator.hasNext()) { String username = (String) iterator.next(); System.out.println("sendNotifcationToTags--username:" + username); sendNotifcationToUser(apiKey, username, title, message, uri, save); } }
public ModelAndView send(HttpServletRequest request, HttpServletResponse response) throws Exception { String broadcast = ServletRequestUtils.getStringParameter(request, "broadcast", "Y"); String username = ServletRequestUtils.getStringParameter(request, "username"); String title = ServletRequestUtils.getStringParameter(request, "title"); String message = ServletRequestUtils.getStringParameter(request, "message"); String uri = ServletRequestUtils.getStringParameter(request, "uri"); String apiKey = Config.getString("apiKey", ""); logger.debug("apiKey=" + apiKey); if (broadcast.equalsIgnoreCase("Y")) { notificationManager.sendBroadcast(apiKey, title, message, uri); } else { notificationManager.sendNotifcationToUser(apiKey, username, title, message, uri); } ModelAndView mav = new ModelAndView(); mav.setViewName("redirect:notification.do"); return mav; }
public void send(HttpServletRequest request, HttpServletResponse response) throws Exception { System.out.println("-------------------------------------"); System.out.println("in api send"); String broadcast = ServletRequestUtils.getStringParameter(request, "broadcast", "Y"); String clientId = ServletRequestUtils.getStringParameter(request, "clientId"); String title = ServletRequestUtils.getStringParameter(request, "title"); String message = ServletRequestUtils.getStringParameter(request, "message"); if (broadcast.equalsIgnoreCase("Y")) { // notificationManager.sendBroadcast(title, message, "0", "AllUsers", "System"); } else { // notificationManager.sendNotifcationToUser( clientId, title, message, "0", "AllUsers", "System"); } response.getWriter().print("{\"result\":\"0\",\"description\":\"success\"}"); // ModelAndView mav = new ModelAndView(); // mav.setViewName("redirect:notification.do"); // return mav; }
public void sendNotifcationToAlias( String apiKey, String alias, String title, String message, String uri, boolean save) { String username = sessionManager.getUsernameByAlias(alias); System.out.println("sendNotifcationToAlias--username:" + username); sendNotifcationToUser(apiKey, username, title, message, uri, save); }