org.opennms.netmgt.config
Interface GroupDao

All Known Implementing Classes:
GroupManagerGroupDao

public interface GroupDao

GroupDao interface.

Version:
$Id: $
Author:
DJ Gregor

Method Summary
 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
 List<String> getGroupNames()
          getGroupNames
 Map<String,Group> getGroups()
          Get the groups
 Role getRole(String roleName)
          getRole
 String[] getRoleNames()
          getRoleNames
 Collection<Role> getRoles()
          getRoles
 OwnedIntervalSequence getRoleScheduleEntries(String roleid, Date start, Date end)
          getRoleScheduleEntries
 List<Schedule> getSchedulesForRoleAt(String roleId, Date time)
          getSchedulesForRoleAt
 List<Schedule> getUserSchedulesForRole(String userId, String roleid)
          getUserSchedulesForRole
 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)
          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 role)
          saveRole
 void setGroups(Map<String,Group> groups)
          Set the groups data
 boolean userHasRole(String userId, String roleid)
          userHasRole
 

Method Detail

setGroups

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

Parameters:
groups - a Map object.

getGroups

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

Returns:
a Map object.

hasGroup

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

Parameters:
groupName - a String object.
Returns:
true if the group exists in the xml file, false otherwise

getGroupNames

List<String> getGroupNames()

getGroupNames

Returns:
a List object.

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

Parameters:
name - a String object.
details - a Group object.

saveRole

void saveRole(Role role)

saveRole

Parameters:
role - a Role object.

deleteUser

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

Parameters:
name - a String object.

deleteGroup

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

Parameters:
name - a String object.

deleteRole

void deleteRole(String name)

deleteRole

Parameters:
name - a String object.

renameGroup

void renameGroup(String oldName,
                 String newName)
Renames the group from the list of groups. Then overwrites to the "groups.xml"

Parameters:
oldName - a String object.
newName - a String object.

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

Parameters:
oldName - a String object.
newName - a String object.

getRoleNames

String[] getRoleNames()

getRoleNames

Returns:
an array of String objects.

getRoles

Collection<Role> getRoles()

getRoles

Returns:
a Collection object.

getRole

Role getRole(String roleName)

getRole

Parameters:
roleName - a String object.
Returns:
a Role object.

userHasRole

boolean userHasRole(String userId,
                    String roleid)

userHasRole

Parameters:
userId - a String object.
roleid - a String object.
Returns:
a boolean.

getSchedulesForRoleAt

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

getSchedulesForRoleAt

Parameters:
roleId - a String object.
time - a Date object.
Returns:
a List object.

getUserSchedulesForRole

List<Schedule> getUserSchedulesForRole(String userId,
                                       String roleid)

getUserSchedulesForRole

Parameters:
userId - a String object.
roleid - a String object.
Returns:
a List object.

isUserScheduledForRole

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

isUserScheduledForRole

Parameters:
userId - a String object.
roleid - a String object.
time - a Date object.
Returns:
a boolean.

getRoleScheduleEntries

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

getRoleScheduleEntries

Parameters:
roleid - a String object.
start - a Date object.
end - a Date object.
Returns:
a OwnedIntervalSequence object.

findGroupsForUser

List<Group> findGroupsForUser(String user)

findGroupsForUser

Parameters:
user - a String object.
Returns:
a List object.

getDefaultMapForUser

String getDefaultMapForUser(String user)

getDefaultMapForUser

Parameters:
user - a String object.
Returns:
a String object.


Copyright © 2011. All Rights Reserved.