class DBUserGroupCallbackImpl extends AbstractUserGroupInfo implements UserGroupCallback {

	public List<String> getGroupsForUser(String userId) {
		
		if (userId == null) {
			throw new IllegalArgumentException("UserId cannot be null");
		}
		
		List<String> roles = new ArrayList<String>();
		Connection conn = null;
		PreparedStatement ps = null;
		ResultSet rs = null;

		try {
			conn = ds.getConnection();

			ps = conn.prepareStatement(this.config.getProperty(USER_ROLES_QUERY));
			try {
				ps.setString(1, userId);
			} catch (ArrayIndexOutOfBoundsException ignore) {

			}
			rs = ps.executeQuery();
			while (rs.next()) {
				roles.add(rs.getString(1));
			}
		} catch (Exception e) {
			logger.error("Error when checking roles in db, parameter: " + userId, e);
		} finally {
			if (rs != null) {
				try {
					rs.close();
				} catch (SQLException e) {
				}
			}
			if (ps != null) {
				try {
					ps.close();
				} catch (SQLException e) {
				}
			}
			if (conn != null) {
				try {
					conn.close();
				} catch (Exception ex) {
				}
			}
		}
		
		return roles;
	}

	public  DBUserGroupCallbackImpl(boolean activate);
	public  DBUserGroupCallbackImpl(Properties config);

}