/** * @see org.geoserver.security.GeoServerUserGroupService#getUserGroups() */ public SortedSet<GeoServerUserGroup> getUserGroups() throws IOException{ Connection con=null; PreparedStatement ps = null; ResultSet rs = null; Collection<GeoServerUserGroup> tmp = new ArrayList<GeoServerUserGroup>(); try { con = getConnection(); ps = getDMLStatement("groups.all",con); rs = ps.executeQuery(); while (rs.next()) { String groupname = rs.getString(1); String enabledString = rs.getString(2); boolean isEnabled= convertFromString(enabledString); GeoServerUserGroup g = createGroupObject(groupname, isEnabled); tmp.add(g); } } catch (SQLException ex) { throw new IOException(ex); } finally { closeFinally(con, ps, rs); } SortedSet<GeoServerUserGroup> groups = new TreeSet<GeoServerUserGroup>(); groups.addAll(tmp); return Collections.unmodifiableSortedSet(groups); }
String password = rs.getString(2); String enabledString = rs.getString(3); boolean isEnabled= convertFromString(enabledString); GeoServerUser u = createUserObject(username,password, isEnabled); map.put(username, u);
String groupname = rs.getString(1); String enabledString = rs.getString(2); boolean isEnabled= convertFromString(enabledString); GeoServerUserGroup g = createGroupObject(groupname, isEnabled); tmp.add(g);
/** * @see org.geoserver.security.GeoServerUserGroupService#getGroupByGroupname(java.lang.String) */ public GeoServerUserGroup getGroupByGroupname(String groupname) throws IOException { Connection con=null; PreparedStatement ps = null; ResultSet rs = null; GeoServerUserGroup g =null; try { con = getConnection(); ps = getDMLStatement("groups.keyed",con); ps.setString(1, groupname); rs = ps.executeQuery(); if (rs.next()) { String enabledString = rs.getString(1); boolean isEnabled= convertFromString(enabledString); g = createGroupObject(groupname, isEnabled); } } catch (SQLException ex) { throw new IOException(ex); } finally { closeFinally(con, ps, rs); } return g; }
String password = rs.getString(2); String enabledString = rs.getString(3); boolean isEnabled= convertFromString(enabledString); GeoServerUser u = createUserObject(username,password, isEnabled); map.put(username,u);
String password = rs.getString(1); String enabledString = rs.getString(2); boolean isEnabled = convertFromString(enabledString); u = createUserObject(username,password, isEnabled); ps2 = getDMLStatement("userprops.selectForUser",con);