return (null);
}
- ArrayList list = getRoles(dbConnection, username);
+ ArrayList<String> list = getRoles(dbConnection, username);
// Create and return a suitable Principal for this user
return (new GenericPrincipal(this, username, credentials, list));
* @param dbConnection The database connection to be used
* @param username Username for which roles should be retrieved
*/
- protected ArrayList getRoles(Connection dbConnection,
+ protected ArrayList<String> getRoles(Connection dbConnection,
String username) {
ResultSet rs = null;
PreparedStatement stmt = null;
- ArrayList list = null;
+ ArrayList<String> list = null;
try {
stmt = roles(dbConnection, username);
rs = stmt.executeQuery();
- list = new ArrayList();
+ list = new ArrayList<String>();
while (rs.next()) {
String role = rs.getString(1);
// Check the user's credentials
if (checkCredentials(context, user, credentials)) {
// Search for additional roles
- List roles = getRoles(context, user);
+ List<String> roles = getRoles(context, user);
return (new GenericPrincipal(this,
username,
credentials,
return (null);
// Search for additional roles
- List roles = getRoles(context, user);
+ List<String> roles = getRoles(context, user);
// Create and return a suitable Principal for this user
return (new GenericPrincipal(this, username, credentials, roles));
User user = null;
// Get attributes to retrieve from user entry
- ArrayList list = new ArrayList();
+ ArrayList<String> list = new ArrayList<String>();
if (userPassword != null)
list.add(userPassword);
if (userRoleName != null)
password = getAttributeValue(userPassword, attrs);
// Retrieve values of userRoleName attribute
- ArrayList roles = null;
+ ArrayList<String> roles = null;
if (userRoleName != null)
roles = addAttributeValues(userRoleName, attrs, roles);
password = getAttributeValue(userPassword, attrs);
// Retrieve values of userRoleName attribute
- ArrayList roles = null;
+ ArrayList<String> roles = null;
if (userRoleName != null)
roles = addAttributeValues(userRoleName, attrs, roles);
User user,
String credentials)
throws NamingException {
- Attributes attr;
if (credentials == null || user == null)
return (false);
if (containerLog.isTraceEnabled()) {
containerLog.trace(" binding as " + dn);
}
- attr = context.getAttributes("", null);
+ context.getAttributes("", null);
validated = true;
}
catch (AuthenticationException e) {
*
* @exception NamingException if a directory server error occurs
*/
- protected List getRoles(DirContext context, User user)
+ protected List<String> getRoles(DirContext context, User user)
throws NamingException {
if (user == null)
containerLog.trace(" getRoles(" + dn + ")");
// Start with roles retrieved from the user entry
- ArrayList list = user.roles;
+ ArrayList<String> list = user.roles;
if (list == null) {
- list = new ArrayList();
+ list = new ArrayList<String>();
}
// Are we configured to do role searches?
*
* @exception NamingException if a directory server error occurs
*/
- private ArrayList addAttributeValues(String attrId,
+ private ArrayList<String> addAttributeValues(String attrId,
Attributes attrs,
- ArrayList values)
+ ArrayList<String> values)
throws NamingException{
if (containerLog.isTraceEnabled())
if (attrId == null || attrs == null)
return values;
if (values == null)
- values = new ArrayList();
+ values = new ArrayList<String>();
Attribute attr = attrs.get(attrId);
if (attr == null)
return (values);
*/
protected Hashtable getDirectoryContextEnvironment() {
- Hashtable env = new Hashtable();
+ Hashtable<String,String> env = new Hashtable<String,String>();
// Configure our directory context environment.
if (containerLog.isDebugEnabled() && connectionAttempt == 0)
protected String[] parseUserPatternString(String userPatternString) {
if (userPatternString != null) {
- ArrayList pathList = new ArrayList();
+ ArrayList<String> pathList = new ArrayList<String>();
int startParenLoc = userPatternString.indexOf('(');
if (startParenLoc == -1) {
// no parens here; return whole thing
String username = null;
String dn = null;
String password = null;
- ArrayList roles = null;
+ ArrayList<String> roles = null;
- User(String username, String dn, String password, ArrayList roles) {
+ User(String username, String dn, String password,
+ ArrayList<String> roles) {
this.username = username;
this.dn = dn;
this.password = password;