Package org.opennms.netmgt.config
Interface GroupDao
-
- All Known Implementing Classes:
GroupManagerGroupDao
public interface GroupDao
GroupDao interface.
- Version:
- $Id: $
- Author:
- DJ Gregor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deleteGroup(String name)
Removes the group from the list of groups.void
deleteRole(String name)
deleteRolevoid
deleteUser(String name)
Removes the user from the list of groups.List<Group>
findGroupsForUser(String user)
findGroupsForUserString
getDefaultMapForUser(String user)
getDefaultMapForUserGroup
getGroup(String name)
Get a group using its nameList<String>
getGroupNames()
getGroupNamesMap<String,Group>
getGroups()
Get the groupsRole
getRole(String roleName)
getRoleString[]
getRoleNames()
getRoleNamesCollection<Role>
getRoles()
getRolesOwnedIntervalSequence
getRoleScheduleEntries(String roleid, Date start, Date end)
getRoleScheduleEntriesList<Schedule>
getSchedulesForRoleAt(String roleId, Date time)
getSchedulesForRoleAtList<Schedule>
getUserSchedulesForRole(String userId, String roleid)
getUserSchedulesForRolelong
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 fileboolean
isGroupOnDuty(String group, Calendar time)
Determines if a group is on duty at a given time.boolean
isUserScheduledForRole(String userId, String roleid, Date time)
isUserScheduledForRolevoid
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()
saveGroupsvoid
saveRole(Role role)
saveRolevoid
setGroups(Map<String,Group> groups)
Set the groups databoolean
userHasRole(String userId, String roleid)
userHasRole
-
-
-
Method Detail
-
setGroups
void setGroups(Map<String,Group> groups)
Set the groups data- Parameters:
groups
- aMap
object.
-
hasGroup
boolean hasGroup(String groupName)
Returns a boolean indicating if the group name appears in the xml file- Parameters:
groupName
- aString
object.- Returns:
- true if the group exists in the xml file, false otherwise
-
getGroup
Group getGroup(String name)
Get a group using its name- Parameters:
name
- the name of the group to return- Returns:
- Group, the group specified by name
-
saveGroups
void saveGroups()
saveGroups
-
isGroupOnDuty
boolean isGroupOnDuty(String group, Calendar time)
Determines if a group is on duty at a given time. If a group has no duty schedules listed in the config file, that group is assumed to always be on duty.- Parameters:
group
- the group whose duty schedule we wanttime
- the time to check for a duty schedule- Returns:
- boolean, true if the group is on duty, false otherwise.
-
groupNextOnDuty
long groupNextOnDuty(String group, Calendar time)
Determines when a group is next on duty. If a group has no duty schedules listed in the config file, that group is assumed to always be on duty.- Parameters:
group
- the group whose duty schedule we wanttime
- the time to check for a duty schedule- Returns:
- long, the time in millisec until the group is next on duty
-
saveGroup
void saveGroup(String name, Group details)
Adds a new user and overwrites the "groups.xml"
-
deleteUser
void deleteUser(String name)
Removes the user from the list of groups. Then overwrites to the "groups.xml"- Parameters:
name
- aString
object.
-
deleteGroup
void deleteGroup(String name)
Removes the group from the list of groups. Then overwrites to the "groups.xml"- Parameters:
name
- aString
object.
-
renameGroup
void renameGroup(String oldName, String newName)
Renames the group from the list of groups. Then overwrites to the "groups.xml"
-
renameUser
void renameUser(String oldName, String newName)
When this method is called group name is changed, so also is the groupname belonging to the view. Also overwrites the "groups.xml" file
-
getRoles
Collection<Role> getRoles()
getRoles
- Returns:
- a
Collection
object.
-
getSchedulesForRoleAt
List<Schedule> getSchedulesForRoleAt(String roleId, Date time)
getSchedulesForRoleAt
-
getUserSchedulesForRole
List<Schedule> getUserSchedulesForRole(String userId, String roleid)
getUserSchedulesForRole
-
isUserScheduledForRole
boolean isUserScheduledForRole(String userId, String roleid, Date time)
isUserScheduledForRole
-
getRoleScheduleEntries
OwnedIntervalSequence getRoleScheduleEntries(String roleid, Date start, Date end)
getRoleScheduleEntries
- Parameters:
roleid
- aString
object.start
- aDate
object.end
- aDate
object.- Returns:
- a
OwnedIntervalSequence
object.
-
-