/** {@inheritDoc} */ @Override public long groupNextOnDuty(String group, Calendar time) { try { return m_groupManager.groupNextOnDuty(group, time); } catch (Throwable e) { throw CONFIG_OBJECT_EXCEPTION_TRANSLATOR.translate("getting next on duty time for group '" + group + "' after " + time, e); } }
NotificationTask[] makeGroupTasks(long startTime, Map<String, String> params, int noticeId, String targetName, String[] command, List<NotificationTask> targetSiblings, String autoNotify, long interval) throws IOException { Group group = getGroupManager().getGroup(targetName); Calendar startCal = Calendar.getInstance(); startCal.setTimeInMillis(startTime); long next = getGroupManager().groupNextOnDuty(group.getName(), startCal); // it the group is not on duty if (next < 0) { LOG.debug("The group {} is not scheduled to come back on duty. No notification will be sent to this group.", group.getName()); return null; } LOG.debug("The group {} is on duty in {} millisec.", group.getName(), next); String[] users = group.getUsers().toArray(new String[0]); // There are no users in the group if (users == null || users.length == 0) { LOG.debug("Not sending notice, no users specified for group {}", group.getName()); return null; } return constructTasksFromUserList(users, startTime, next, params, noticeId, command, targetSiblings, autoNotify, interval); }