|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.locomotive.loco.perm.GroupManager
Maintains all database transactions dealing with groups.
Constructor Summary | |
GroupManager()
|
Method Summary | |
static void |
addGroup(Group group,
java.sql.Connection conn)
Adds a new group to the database. |
static void |
addUserToGroup(int groupId,
int userId,
java.sql.Connection conn)
Adds a user to a group. |
static int |
convertToGroupId(java.lang.String groupName,
java.sql.Connection conn)
Converts a group name into a group id. |
static java.util.Vector |
convertToGroupIds(java.util.Vector groupNames,
java.sql.Connection conn)
Converts a Vector of group names into a Vector of group ids. |
static java.lang.String |
convertToGroupName(int groupId,
java.sql.Connection conn)
Converts a group id into a group name. |
static java.util.Vector |
convertToGroupNames(java.util.Vector groupIds,
java.sql.Connection conn)
Converts a Vector of group ids into a Vector of group names. |
static boolean |
exists(java.lang.String groupName,
java.sql.Connection conn)
Verifies that a group exists in the DB. |
static Group |
getGroup(java.lang.String groupName,
java.sql.Connection conn)
Returns a group object from the database via its name. |
static java.util.Vector |
getGroupNames(java.sql.Connection conn)
Returns an enumeration of all the group names in the database. |
static int |
getNextId(java.sql.Connection conn)
Returns a unique id for a new group. |
static java.util.Vector |
getUserIdsFromGroup(int groupId,
java.sql.Connection conn)
Lists all the user ids contained in a group. |
static void |
removeGroup(java.lang.String groupName,
java.sql.Connection conn)
Removes an existing group from the database. |
static void |
removeUserFromGroup(int groupId,
int userId,
java.sql.Connection conn)
Removes an existing user from a group. |
static void |
updateGroup(Group group,
java.sql.Connection conn)
Updates an existing group in the database with new information. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public GroupManager()
Method Detail |
public static int getNextId(java.sql.Connection conn) throws java.sql.SQLException
public static void addGroup(Group group, java.sql.Connection conn) throws java.sql.SQLException
group
- group to be added to the databaseconn
- database connectionpublic static void removeGroup(java.lang.String groupName, java.sql.Connection conn) throws java.sql.SQLException
groupName
- name of group to be removed from the databaseconn
- database connectionpublic static void updateGroup(Group group, java.sql.Connection conn) throws java.sql.SQLException, LoadUserException, UserNotFoundException
group
- updated groupconn
- database connectionpublic static Group getGroup(java.lang.String groupName, java.sql.Connection conn) throws java.sql.SQLException
groupName
- name of group being retrieved from the databaseconn
- database connectionnull
if group does not exist)public static void addUserToGroup(int groupId, int userId, java.sql.Connection conn) throws java.sql.SQLException
groupId
- id of the groupuserId
- id of the user being added to the groupconn
- database connectionpublic static void removeUserFromGroup(int groupId, int userId, java.sql.Connection conn) throws java.sql.SQLException
groupId
- id of the groupuserId
- id of the user being removed from the groupconn
- database connectionpublic static java.util.Vector getUserIdsFromGroup(int groupId, java.sql.Connection conn) throws java.sql.SQLException
groupId
- id of the groupconn
- database connectionpublic static java.util.Vector getGroupNames(java.sql.Connection conn) throws java.sql.SQLException
conn
- database connectionpublic static boolean exists(java.lang.String groupName, java.sql.Connection conn) throws java.sql.SQLException
groupName
- name of group in questionconn
- database connectiontrue
if the group exists in the databasepublic static int convertToGroupId(java.lang.String groupName, java.sql.Connection conn) throws java.sql.SQLException
groupName
- name of groupconn
- database connectionpublic static java.util.Vector convertToGroupIds(java.util.Vector groupNames, java.sql.Connection conn) throws java.sql.SQLException
groupNames
- Vector containing the names of groupsconn
- database connectionpublic static java.lang.String convertToGroupName(int groupId, java.sql.Connection conn) throws java.sql.SQLException
groupId
- id of groupconn
- database connectionnull
if group does not exist)public static java.util.Vector convertToGroupNames(java.util.Vector groupIds, java.sql.Connection conn) throws java.sql.SQLException
groupIds
- Vector containing the ids of groupsconn
- database connection
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |