private Role getBackingRole(String roleName) { return m_groupManager.getRole(roleName); }
/** {@inheritDoc} */ @Override public Role getRole(String name) { try { return m_groupManager.getRole(name); } catch (Throwable e) { throw CONFIG_OBJECT_EXCEPTION_TRANSLATOR.translate("getting role '" + name + "'", e); } }
/** * <p>hasOnCallRole</p> * * @param roleid a {@link java.lang.String} object. * @return a boolean. * @throws java.io.IOException if any. */ public boolean hasOnCallRole(final String roleid) throws IOException { update(); m_readLock.lock(); try { return m_groupManager.getRole(roleid) != null; } finally { m_readLock.unlock(); } }
/** * <p>getUserSchedulesForRole</p> * * @param userId a {@link java.lang.String} object. * @param roleId a {@link java.lang.String} object. * @return a {@link java.util.List} object. * @throws java.io.IOException if any. */ public List<Schedule> getUserSchedulesForRole(String userId, String roleId) throws IOException { update(); List<Schedule> scheds = new ArrayList<Schedule>(); for (Schedule sched : getRole(roleId).getSchedules()) { if (userId.equals(sched.getName())) { scheds.add(sched); } } return scheds; }
/** * <p>userHasRole</p> * * @param userId a {@link java.lang.String} object. * @param roleid a {@link java.lang.String} object. * @return a boolean. * @throws java.io.IOException if any. */ public boolean userHasRole(String userId, String roleid) throws IOException { update(); for (Schedule sched : getRole(roleid).getSchedules()) { if (userId.equals(sched.getName())) { return true; } } return false; }
/** * <p>getSchedulesForRoleAt</p> * * @param roleId a {@link java.lang.String} object. * @param time a {@link java.util.Date} object. * @return a {@link java.util.List} object. * @throws java.io.IOException if any. */ public List<Schedule> getSchedulesForRoleAt(String roleId, Date time) throws IOException { update(); List<Schedule> schedules = new ArrayList<Schedule>(); for (Schedule sched : getRole(roleId).getSchedules()) { if (BasicScheduleUtils.isTimeInSchedule(time, BasicScheduleUtils.getGroupSchedule(sched))) { schedules.add(sched); } } return schedules; }
/** * <p>isUserScheduledForRole</p> * * @param userId a {@link java.lang.String} object. * @param roleId a {@link java.lang.String} object. * @param time a {@link java.util.Date} object. * @return a boolean. * @throws java.io.IOException if any. */ public boolean isUserScheduledForRole(String userId, String roleId, Date time) throws IOException { update(); for (Schedule sched : getUserSchedulesForRole(userId, roleId)) { if (BasicScheduleUtils.isTimeInSchedule(time, BasicScheduleUtils.getGroupSchedule(sched))) { return true; } } // if no user is scheduled then the supervisor is schedule by default Role role = getRole(roleId); if (userId.equals(role.getSupervisor())) { for (Schedule sched : role.getSchedules()) { if (BasicScheduleUtils.isTimeInSchedule(time, BasicScheduleUtils.getGroupSchedule(sched))) { // we found another scheduled user return false; } } return true; } return false; }
Role role = getRole(roleid); for (int i = 0; i < role.getSchedules().size(); i++) { final int index = i;