Package org.opennms.netmgt.config
Interface GroupDao
-
- All Known Implementing Classes:
GroupManagerGroupDao
public interface GroupDaoGroupDao interface.
- Version:
- $Id: $
- Author:
- DJ Gregor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeleteGroup(String name)Removes the group from the list of groups.voiddeleteRole(String name)deleteRolevoiddeleteUser(String name)Removes the user from the list of groups.List<Group>findGroupsForUser(String user)findGroupsForUserStringgetDefaultMapForUser(String user)getDefaultMapForUserGroupgetGroup(String name)Get a group using its nameList<String>getGroupNames()getGroupNamesMap<String,Group>getGroups()Get the groupsRolegetRole(String roleName)getRoleString[]getRoleNames()getRoleNamesCollection<Role>getRoles()getRolesOwnedIntervalSequencegetRoleScheduleEntries(String roleid, Date start, Date end)getRoleScheduleEntriesList<Schedule>getSchedulesForRoleAt(String roleId, Date time)getSchedulesForRoleAtList<Schedule>getUserSchedulesForRole(String userId, String roleid)getUserSchedulesForRolelonggroupNextOnDuty(String group, Calendar time)Determines when a group is next on duty.booleanhasGroup(String groupName)Returns a boolean indicating if the group name appears in the xml filebooleanisGroupOnDuty(String group, Calendar time)Determines if a group is on duty at a given time.booleanisUserScheduledForRole(String userId, String roleid, Date time)isUserScheduledForRolevoidrenameGroup(String oldName, String newName)Renames the group from the list of groups.voidrenameUser(String oldName, String newName)When this method is called group name is changed, so also is the groupname belonging to the view.voidsaveGroup(String name, Group details)Adds a new user and overwrites the "groups.xml"voidsaveGroups()saveGroupsvoidsaveRole(Role role)saveRolevoidsetGroups(Map<String,Group> groups)Set the groups databooleanuserHasRole(String userId, String roleid)userHasRole
-
-
-
Method Detail
-
setGroups
void setGroups(Map<String,Group> groups)
Set the groups data- Parameters:
groups- aMapobject.
-
hasGroup
boolean hasGroup(String groupName)
Returns a boolean indicating if the group name appears in the xml file- Parameters:
groupName- aStringobject.- 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- aStringobject.
-
deleteGroup
void deleteGroup(String name)
Removes the group from the list of groups. Then overwrites to the "groups.xml"- Parameters:
name- aStringobject.
-
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
Collectionobject.
-
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- aStringobject.start- aDateobject.end- aDateobject.- Returns:
- a
OwnedIntervalSequenceobject.
-
-