public abstract class GroupManager extends Object implements GroupConfig
Abstract GroupManager class.
| Modifier and Type | Class and Description |
|---|---|
static class |
GroupManager.OnmsGroupListMapper |
static class |
GroupManager.OnmsGroupMapper |
| Modifier and Type | Field and Description |
|---|---|
protected static Map<String,List<DutySchedule>> |
m_dutySchedules
The duty schedules for each group
|
| Constructor and Description |
|---|
GroupManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteGroup(String name)
Removes the group from the list of groups.
|
void |
deleteRole(String name)
deleteRole
|
void |
deleteUser(String name)
Removes the user from the list of groups.
|
List<Group> |
findGroupsForUser(String user)
findGroupsForUser
|
Group |
getGroup(String name)
Get a group using its name
|
List<String> |
getGroupNames()
getGroupNames
|
Map<String,Group> |
getGroups()
Get the groups
|
OnmsGroup |
getOnmsGroup(String groupName)
getOnmsGroup
|
OnmsGroupList |
getOnmsGroupList()
getOnmsGroupList
|
Role |
getRole(String roleName)
getRole
|
String[] |
getRoleNames()
getRoleNames
|
Collection<Role> |
getRoles()
getRoles
|
OwnedIntervalSequence |
getRoleScheduleEntries(String roleid,
Date start,
Date end)
getRoleScheduleEntries
|
List<Schedule> |
getSchedulesForRoleAt(String roleId,
Date time)
getSchedulesForRoleAt
|
List<Schedule> |
getUserSchedulesForRole(String userId,
String roleId)
getUserSchedulesForRole
|
long |
groupNextOnDuty(String group,
Calendar time)
Determines when a group is next on duty.
|
boolean |
hasGroup(String groupName)
Returns a boolean indicating if the group name appears in the xml file
|
boolean |
isGroupOnDuty(String group,
Calendar time)
Determines if a group is on duty at a given time.
|
boolean |
isUserScheduledForRole(String userId,
String roleId,
Date time)
isUserScheduledForRole
|
protected void |
parseXml(InputStream stream)
parseXml
|
void |
renameGroup(String oldName,
String newName)
Renames the group from the list of groups.
|
void |
renameUser(String oldName,
String newName)
When this method is called group name is changed, so also is the
group name belonging to the view.
|
void |
save(OnmsGroup group)
save
|
void |
saveGroup(String name,
Group details)
Adds a new user and overwrites the "groups.xml"
|
void |
saveGroups()
saveGroups
|
void |
saveRole(Role role)
saveRole
|
protected abstract void |
saveXml(String data)
saveXml
|
void |
setGroups(Map<String,Group> grp)
Set the groups data
|
abstract void |
update()
update
|
boolean |
userHasRole(String userId,
String roleid)
userHasRole
|
protected static Map<String,List<DutySchedule>> m_dutySchedules
protected void parseXml(InputStream stream) throws IOException
parseXml
stream - a InputStream object.IOExceptionpublic void setGroups(Map<String,Group> grp)
setGroups in interface GroupConfiggrp - a Map object.public Map<String,Group> getGroups() throws IOException
getGroups in interface GroupConfigMap object.IOException - if any.public OnmsGroupList getOnmsGroupList() throws IOException
GroupConfiggetOnmsGroupList
getOnmsGroupList in interface GroupConfigIOExceptionpublic OnmsGroup getOnmsGroup(String groupName) throws IOException
GroupConfiggetOnmsGroup
getOnmsGroup in interface GroupConfigIOExceptionpublic void save(OnmsGroup group) throws Exception
GroupConfigsave
save in interface GroupConfigExceptionpublic abstract void update()
throws IOException
update
IOException - if any.public boolean hasGroup(String groupName) throws IOException
hasGroup in interface GroupConfiggroupName - a String object.IOException - if any.public List<String> getGroupNames() throws IOException
getGroupNames
getGroupNames in interface GroupConfigList object.IOException - if any.public Group getGroup(String name) throws IOException
getGroup in interface GroupConfigname - the name of the group to returnIOException - if any.public void saveGroups()
throws Exception
saveGroups
saveGroups in interface GroupConfigException - if any.public boolean isGroupOnDuty(String group, Calendar time) throws IOException
isGroupOnDuty in interface GroupConfiggroup - the group whose duty schedule we wanttime - the time to check for a duty scheduleIOException - if any.public long groupNextOnDuty(String group, Calendar time) throws IOException
groupNextOnDuty in interface GroupConfiggroup - the group whose duty schedule we wanttime - the time to check for a duty scheduleIOException - if any.protected abstract void saveXml(String data) throws IOException
saveXml
data - a String object.IOException - if any.public void saveGroup(String name, Group details) throws Exception
saveGroup in interface GroupConfigname - a String object.details - a Group object.Exception - if any.public void saveRole(Role role) throws Exception
saveRole
saveRole in interface GroupConfigrole - a Role object.Exception - if any.public void deleteUser(String name) throws Exception
deleteUser in interface GroupConfigname - a String object.Exception - if any.public void deleteGroup(String name) throws Exception
deleteGroup in interface GroupConfigname - a String object.Exception - if any.public void deleteRole(String name) throws Exception
deleteRole
deleteRole in interface GroupConfigname - a String object.Exception - if any.public void renameGroup(String oldName, String newName) throws Exception
renameGroup in interface GroupConfigoldName - a String object.newName - a String object.Exception - if any.public void renameUser(String oldName, String newName) throws Exception
renameUser in interface GroupConfigoldName - a String object.newName - a String object.Exception - if any.public String[] getRoleNames()
getRoleNames
getRoleNames in interface GroupConfigString objects.public Collection<Role> getRoles()
getRoles
getRoles in interface GroupConfigCollection object.public Role getRole(String roleName)
getRole
getRole in interface GroupConfigroleName - a String object.Role object.public boolean userHasRole(String userId, String roleid) throws IOException
userHasRole
userHasRole in interface GroupConfiguserId - a String object.roleid - a String object.IOException - if any.public List<Schedule> getSchedulesForRoleAt(String roleId, Date time) throws IOException
getSchedulesForRoleAt
getSchedulesForRoleAt in interface GroupConfigroleId - a String object.time - a Date object.List object.IOException - if any.public List<Schedule> getUserSchedulesForRole(String userId, String roleId) throws IOException
getUserSchedulesForRole
getUserSchedulesForRole in interface GroupConfiguserId - a String object.roleId - a String object.List object.IOException - if any.public boolean isUserScheduledForRole(String userId, String roleId, Date time) throws IOException
isUserScheduledForRole
isUserScheduledForRole in interface GroupConfiguserId - a String object.roleId - a String object.time - a Date object.IOException - if any.public OwnedIntervalSequence getRoleScheduleEntries(String roleid, Date start, Date end) throws IOException
getRoleScheduleEntries
getRoleScheduleEntries in interface GroupConfigroleid - a String object.start - a Date object.end - a Date object.OwnedIntervalSequence object.IOException - if any.public List<Group> findGroupsForUser(String user)
findGroupsForUser
findGroupsForUser in interface GroupConfiguser - a String object.List object.Copyright © 2020. All rights reserved.