private WebUser getWebUser(String userName) { User u = getBackingUser(userName); if (u == null) { return new InvalidUser(userName); } else { return new ManagedUser(u); } }
/** * Reload the config from the default config file * * @exception java.io.IOException * Thrown if the specified config file cannot be read/loaded * @throws java.io.IOException if any. */ public static synchronized void reload() throws IOException { init(); getInstance().update(); }
/** * Reload the config from the default config file * * @exception java.io.IOException * Thrown if the specified config file cannot be read/loaded * @throws java.io.IOException if any. */ public static synchronized void reload() throws IOException { init(); getInstance().update(); }
private static WebRoleManagerImpl getManager() { if (s_manager == null) { s_manager = new WebRoleManagerImpl(GroupFactory.getInstance(), UserFactory.getInstance()); } return s_manager; }
private WebGroup getWebGroup(String groupName) { Group g = getBackingGroup(groupName); if (g == null) { return new InvalidGroup(groupName); } else { return new ManagedGroup(g); } }
private Group getBackingGroup(String groupName) { try { return m_groupManager.getGroup(groupName); } catch (IOException e) { throw new WebRolesException("Error reading groups.xml config file", e); } }
/** {@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); } }
/** {@inheritDoc} */ @Override public void deleteGroup(String name) { try { m_groupManager.deleteGroup(name); } catch (Throwable e) { throw CONFIG_OBJECT_EXCEPTION_TRANSLATOR.translate("deleting group '" + name + "'", e); } }
/** * <p>saveGroups</p> */ @Override public void saveGroups() { try { m_groupManager.saveGroups(); } catch (Throwable e) { throw CONFIG_OBJECT_EXCEPTION_TRANSLATOR.translate("saving groups", e); } }
/** * This method wraps the call to the database to get a sequence notice ID * from the database. * * @return int, the sequence id from the database, 0 by default if there is * database trouble * @throws java.sql.SQLException if any. * @throws java.io.IOException if any. */ public int getNoticeId() throws SQLException, IOException { return getNxtId(m_configManager.getNextNotifIdSql()); }
/** {@inheritDoc} */ @Override public List<Schedule> getSchedulesForRoleAt(String role, Date time) { try { return m_groupManager.getSchedulesForRoleAt(role, time); } catch (Throwable e) { throw CONFIG_OBJECT_EXCEPTION_TRANSLATOR.translate("getting schedules for role '" + role + "' at " + time, e); } }
/** {@inheritDoc} */ @Override public List<Schedule> getUserSchedulesForRole(String user, String role) { try { return m_groupManager.getUserSchedulesForRole(user, role); } catch (Throwable e) { throw CONFIG_OBJECT_EXCEPTION_TRANSLATOR.translate("getting user schedules for user '" + user + "' for role '" + role + "'", e); } }
/** {@inheritDoc} */ @Override public boolean isUserScheduledForRole(String user, String role, Date time) { try { return m_groupManager.isUserScheduledForRole(user, role, time); } catch (Throwable e) { throw CONFIG_OBJECT_EXCEPTION_TRANSLATOR.translate("checking to see if user '" + user + "' is schedule for role '" + role + "' at " + time, e); } }
/** {@inheritDoc} */ @Override public void renameUser(String oldName, String newName) { try { m_groupManager.renameUser(oldName, newName); } catch (Throwable e) { throw CONFIG_OBJECT_EXCEPTION_TRANSLATOR.translate("renaming user from '" + oldName + "' to '" + newName + "'", e); } }
/** {@inheritDoc} */ @Override public void deleteUser(String name) { try { m_groupManager.deleteUser(name); } catch (Throwable e) { throw CONFIG_OBJECT_EXCEPTION_TRANSLATOR.translate("deleting user '" + name + "'", e); } }
/** {@inheritDoc} */ @Override public boolean isGroupOnDuty(String group, Calendar time) { try { return m_groupManager.isGroupOnDuty(group, time); } catch (Throwable e) { throw CONFIG_OBJECT_EXCEPTION_TRANSLATOR.translate("getting group '" + group + "' to see if it is on duty at " + time, e); } }
/** {@inheritDoc} */ @Override public void renameGroup(String oldName, String newName) { try { m_groupManager.renameGroup(oldName, newName); } catch (Throwable e) { throw CONFIG_OBJECT_EXCEPTION_TRANSLATOR.translate("renaming group from '" + oldName + "' to '" + newName + "'", e); } }
/** * <p>getUserNotifId</p> * * @return a int. * @throws java.sql.SQLException if any. * @throws java.io.IOException if any. */ public int getUserNotifId() throws SQLException, IOException { return getNxtId(m_configManager.getNextUserNotifIdSql()); }