Modifier and Type | Class and Description |
---|---|
static class |
GroupManagerGroupDao.GroupManagerConfigObjectExceptionTranslator |
Constructor and Description |
---|
GroupManagerGroupDao() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
afterPropertiesSet
|
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
|
String |
getDefaultMapForUser(String user)
getDefaultMapForUser
|
Group |
getGroup(String name)
Get a group using its name
|
GroupManager |
getGroupManager()
getGroupManager
|
List<String> |
getGroupNames()
getGroupNames
|
Map<String,Group> |
getGroups()
getGroups
|
Role |
getRole(String name)
getRole
|
String[] |
getRoleNames()
getRoleNames
|
Collection<Role> |
getRoles()
getRoles
|
OwnedIntervalSequence |
getRoleScheduleEntries(String role,
Date start,
Date end)
getRoleScheduleEntries
|
List<Schedule> |
getSchedulesForRoleAt(String role,
Date time)
getSchedulesForRoleAt
|
List<Schedule> |
getUserSchedulesForRole(String user,
String role)
getUserSchedulesForRole
|
long |
groupNextOnDuty(String group,
Calendar time)
Determines when a group is next on duty.
|
boolean |
hasGroup(String name)
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 user,
String role,
Date time)
isUserScheduledForRole
|
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
groupname belonging to the view.
|
void |
saveGroup(String name,
Group details)
Adds a new user and overwrites the "groups.xml"
|
void |
saveGroups()
saveGroups
|
void |
saveRole(Role name)
saveRole
|
void |
setGroupManager(GroupManager groupManager)
setGroupManager
|
void |
setGroups(Map<String,Group> groups)
Set the groups data
|
boolean |
userHasRole(String user,
String role)
userHasRole
|
public void deleteGroup(String name)
deleteGroup
in interface GroupDao
name
- a String
object.public void deleteRole(String name)
deleteRole
deleteRole
in interface GroupDao
name
- a String
object.public void deleteUser(String name)
deleteUser
in interface GroupDao
name
- a String
object.public List<Group> findGroupsForUser(String user)
findGroupsForUser
findGroupsForUser
in interface GroupDao
user
- a String
object.List
object.public List<String> getGroupNames()
getGroupNames
getGroupNames
in interface GroupDao
List
object.public String[] getRoleNames()
getRoleNames
getRoleNames
in interface GroupDao
String
objects.public OwnedIntervalSequence getRoleScheduleEntries(String role, Date start, Date end)
getRoleScheduleEntries
getRoleScheduleEntries
in interface GroupDao
role
- a String
object.start
- a Date
object.end
- a Date
object.OwnedIntervalSequence
object.public Collection<Role> getRoles()
getRoles
getRoles
in interface GroupDao
Collection
object.public List<Schedule> getSchedulesForRoleAt(String role, Date time)
getSchedulesForRoleAt
getSchedulesForRoleAt
in interface GroupDao
role
- a String
object.time
- a Date
object.List
object.public List<Schedule> getUserSchedulesForRole(String user, String role)
getUserSchedulesForRole
getUserSchedulesForRole
in interface GroupDao
user
- a String
object.role
- a String
object.List
object.public long groupNextOnDuty(String group, Calendar time)
groupNextOnDuty
in interface GroupDao
group
- the group whose duty schedule we wanttime
- the time to check for a duty schedulepublic boolean hasGroup(String name)
public boolean isGroupOnDuty(String group, Calendar time)
isGroupOnDuty
in interface GroupDao
group
- the group whose duty schedule we wanttime
- the time to check for a duty schedulepublic boolean isUserScheduledForRole(String user, String role, Date time)
isUserScheduledForRole
isUserScheduledForRole
in interface GroupDao
user
- a String
object.role
- a String
object.time
- a Date
object.public void renameGroup(String oldName, String newName)
renameGroup
in interface GroupDao
oldName
- a String
object.newName
- a String
object.public void renameUser(String oldName, String newName)
renameUser
in interface GroupDao
oldName
- a String
object.newName
- a String
object.public void saveGroup(String name, Group details)
public void saveGroups()
saveGroups
saveGroups
in interface GroupDao
public void saveRole(Role name)
saveRole
public boolean userHasRole(String user, String role)
userHasRole
userHasRole
in interface GroupDao
user
- a String
object.role
- a String
object.public void afterPropertiesSet()
afterPropertiesSet
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public GroupManager getGroupManager()
getGroupManager
GroupManager
object.public void setGroupManager(GroupManager groupManager)
setGroupManager
groupManager
- a GroupManager
object.Copyright © 2021. All rights reserved.