org.opennms.netmgt.config
Interface GroupDao

All Known Implementing Classes:
GroupManagerGroupDao

public interface GroupDao

Author:
DJ Gregor

Method Summary
 void deleteGroup(String name)
          Removes the group from the list of groups.
 void deleteRole(String name)
           
 void deleteUser(String name)
          Removes the user from the list of groups.
 List<Group> findGroupsForUser(String user)
           
 Group getGroup(String name)
          Get a group using its name
 List<String> getGroupNames()
           
 Map<String,Group> getGroups()
          Get the groups
 Role getRole(String roleName)
           
 String[] getRoleNames()
           
 Collection getRoles()
           
 OwnedIntervalSequence getRoleScheduleEntries(String roleid, Date start, Date end)
           
 List<Schedule> getSchedulesForRoleAt(String roleId, Date time)
           
 List getUserSchedulesForRole(String userId, String roleid)
           
 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)
           
 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()
           
 void saveRole(Role role)
           
 void setGroups(Map<String,Group> groups)
          Set the groups data
 boolean userHasRole(String userId, String roleid)
           
 

Method Detail

setGroups

void setGroups(Map<String,Group> groups)
Set the groups data


getGroups

Map<String,Group> getGroups()
Get the groups


hasGroup

boolean hasGroup(String groupName)
Returns a boolean indicating if the group name appears in the xml file

Returns:
true if the group exists in the xml file, false otherwise

getGroupNames

List<String> getGroupNames()

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()

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 want
time - 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 want
time - 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"


saveRole

void saveRole(Role role)

deleteUser

void deleteUser(String name)
Removes the user from the list of groups. Then overwrites to the "groups.xml"


deleteGroup

void deleteGroup(String name)
Removes the group from the list of groups. Then overwrites to the "groups.xml"


deleteRole

void deleteRole(String name)

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


getRoleNames

String[] getRoleNames()

getRoles

Collection getRoles()

getRole

Role getRole(String roleName)

userHasRole

boolean userHasRole(String userId,
                    String roleid)

getSchedulesForRoleAt

List<Schedule> getSchedulesForRoleAt(String roleId,
                                     Date time)

getUserSchedulesForRole

List getUserSchedulesForRole(String userId,
                             String roleid)

isUserScheduledForRole

boolean isUserScheduledForRole(String userId,
                               String roleid,
                               Date time)

getRoleScheduleEntries

OwnedIntervalSequence getRoleScheduleEntries(String roleid,
                                             Date start,
                                             Date end)

findGroupsForUser

List<Group> findGroupsForUser(String user)


Copyright © 2009. All Rights Reserved.