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(java.lang.String name)
Removes the group from the list of groups.void
deleteRole(java.lang.String name)
deleteRolevoid
deleteUser(java.lang.String name)
Removes the user from the list of groups.java.util.List<Group>
findGroupsForUser(java.lang.String user)
findGroupsForUserjava.lang.String
getDefaultMapForUser(java.lang.String user)
getDefaultMapForUserGroup
getGroup(java.lang.String name)
Get a group using its namejava.util.List<java.lang.String>
getGroupNames()
getGroupNamesjava.util.Map<java.lang.String,Group>
getGroups()
Get the groupsRole
getRole(java.lang.String roleName)
getRolejava.lang.String[]
getRoleNames()
getRoleNamesjava.util.Collection<Role>
getRoles()
getRolesOwnedIntervalSequence
getRoleScheduleEntries(java.lang.String roleid, java.util.Date start, java.util.Date end)
getRoleScheduleEntriesjava.util.List<Schedule>
getSchedulesForRoleAt(java.lang.String roleId, java.util.Date time)
getSchedulesForRoleAtjava.util.List<Schedule>
getUserSchedulesForRole(java.lang.String userId, java.lang.String roleid)
getUserSchedulesForRolelong
groupNextOnDuty(java.lang.String group, java.util.Calendar time)
Determines when a group is next on duty.boolean
hasGroup(java.lang.String groupName)
Returns a boolean indicating if the group name appears in the xml fileboolean
isGroupOnDuty(java.lang.String group, java.util.Calendar time)
Determines if a group is on duty at a given time.boolean
isUserScheduledForRole(java.lang.String userId, java.lang.String roleid, java.util.Date time)
isUserScheduledForRolevoid
renameGroup(java.lang.String oldName, java.lang.String newName)
Renames the group from the list of groups.void
renameUser(java.lang.String oldName, java.lang.String newName)
When this method is called group name is changed, so also is the groupname belonging to the view.void
saveGroup(java.lang.String name, Group details)
Adds a new user and overwrites the "groups.xml"void
saveGroups()
saveGroupsvoid
saveRole(Role role)
saveRolevoid
setGroups(java.util.Map<java.lang.String,Group> groups)
Set the groups databoolean
userHasRole(java.lang.String userId, java.lang.String roleid)
userHasRole
-
-
-
Method Detail
-
setGroups
void setGroups(java.util.Map<java.lang.String,Group> groups)
Set the groups data- Parameters:
groups
- aMap
object.
-
getGroups
java.util.Map<java.lang.String,Group> getGroups()
Get the groups- Returns:
- a
Map
object.
-
hasGroup
boolean hasGroup(java.lang.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
-
getGroupNames
java.util.List<java.lang.String> getGroupNames()
getGroupNames
- Returns:
- a
List
object.
-
getGroup
Group getGroup(java.lang.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(java.lang.String group, java.util.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(java.lang.String group, java.util.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(java.lang.String name, Group details)
Adds a new user and overwrites the "groups.xml"- Parameters:
name
- aString
object.details
- aGroup
object.
-
deleteUser
void deleteUser(java.lang.String name)
Removes the user from the list of groups. Then overwrites to the "groups.xml"- Parameters:
name
- aString
object.
-
deleteGroup
void deleteGroup(java.lang.String name)
Removes the group from the list of groups. Then overwrites to the "groups.xml"- Parameters:
name
- aString
object.
-
deleteRole
void deleteRole(java.lang.String name)
deleteRole
- Parameters:
name
- aString
object.
-
renameGroup
void renameGroup(java.lang.String oldName, java.lang.String newName)
Renames the group from the list of groups. Then overwrites to the "groups.xml"- Parameters:
oldName
- aString
object.newName
- aString
object.
-
renameUser
void renameUser(java.lang.String oldName, java.lang.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- Parameters:
oldName
- aString
object.newName
- aString
object.
-
getRoleNames
java.lang.String[] getRoleNames()
getRoleNames
- Returns:
- an array of
String
objects.
-
getRoles
java.util.Collection<Role> getRoles()
getRoles
- Returns:
- a
Collection
object.
-
getRole
Role getRole(java.lang.String roleName)
getRole
- Parameters:
roleName
- aString
object.- Returns:
- a
Role
object.
-
userHasRole
boolean userHasRole(java.lang.String userId, java.lang.String roleid)
userHasRole
- Parameters:
userId
- aString
object.roleid
- aString
object.- Returns:
- a boolean.
-
getSchedulesForRoleAt
java.util.List<Schedule> getSchedulesForRoleAt(java.lang.String roleId, java.util.Date time)
getSchedulesForRoleAt
- Parameters:
roleId
- aString
object.time
- aDate
object.- Returns:
- a
List
object.
-
getUserSchedulesForRole
java.util.List<Schedule> getUserSchedulesForRole(java.lang.String userId, java.lang.String roleid)
getUserSchedulesForRole
- Parameters:
userId
- aString
object.roleid
- aString
object.- Returns:
- a
List
object.
-
isUserScheduledForRole
boolean isUserScheduledForRole(java.lang.String userId, java.lang.String roleid, java.util.Date time)
isUserScheduledForRole
- Parameters:
userId
- aString
object.roleid
- aString
object.time
- aDate
object.- Returns:
- a boolean.
-
getRoleScheduleEntries
OwnedIntervalSequence getRoleScheduleEntries(java.lang.String roleid, java.util.Date start, java.util.Date end)
getRoleScheduleEntries
- Parameters:
roleid
- aString
object.start
- aDate
object.end
- aDate
object.- Returns:
- a
OwnedIntervalSequence
object.
-
findGroupsForUser
java.util.List<Group> findGroupsForUser(java.lang.String user)
findGroupsForUser
- Parameters:
user
- aString
object.- Returns:
- a
List
object.
-
getDefaultMapForUser
java.lang.String getDefaultMapForUser(java.lang.String user)
getDefaultMapForUser
- Parameters:
user
- aString
object.- Returns:
- a
String
object.
-
-