directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szoer...@apache.org
Subject svn commit: r777273 - /directory/sandbox/szoerner/apacheds-tomcatrealm/src/main/java/org/apache/directory/tomcatrealm/EmbeddedApacheDsRealm.java
Date Thu, 21 May 2009 21:35:43 GMT
Author: szoerner
Date: Thu May 21 21:35:42 2009
New Revision: 777273

URL: http://svn.apache.org/viewvc?rev=777273&view=rev
Log:
Enhanced logging and comments

Modified:
    directory/sandbox/szoerner/apacheds-tomcatrealm/src/main/java/org/apache/directory/tomcatrealm/EmbeddedApacheDsRealm.java

Modified: directory/sandbox/szoerner/apacheds-tomcatrealm/src/main/java/org/apache/directory/tomcatrealm/EmbeddedApacheDsRealm.java
URL: http://svn.apache.org/viewvc/directory/sandbox/szoerner/apacheds-tomcatrealm/src/main/java/org/apache/directory/tomcatrealm/EmbeddedApacheDsRealm.java?rev=777273&r1=777272&r2=777273&view=diff
==============================================================================
--- directory/sandbox/szoerner/apacheds-tomcatrealm/src/main/java/org/apache/directory/tomcatrealm/EmbeddedApacheDsRealm.java
(original)
+++ directory/sandbox/szoerner/apacheds-tomcatrealm/src/main/java/org/apache/directory/tomcatrealm/EmbeddedApacheDsRealm.java
Thu May 21 21:35:42 2009
@@ -144,19 +144,21 @@
 		Principal principal = null;
 
 		if (log.isDebugEnabled()) {
-			log.debug("try to authenticat user " + username);
+			log.debug("Try to authenticate user [" + username + "]");
 		}
 
 		LdapDN userDN = this.searchEntryByUsername(username);
 		if (userDN != null) {
 
 			if (log.isDebugEnabled()) {
-				log.debug("Found user with DN " + userDN.getUpName());
+				log.debug("Found user [" + username + "] with DN ["
+						+ userDN.getUpName() + "]");
 			}
 
 			if (this.authenticate(userDN, credentials)) {
 
-				log.debug("Authentication succesful for user " + username);
+				log.debug("Authentication succesful for user [" + username
+						+ "]");
 
 				List<String> roles = this.searchRolesForUserDn(userDN);
 				principal = new GenericPrincipal(this, username, credentials,
@@ -212,7 +214,7 @@
 			adminSession.unbind();
 
 		} catch (Exception e) {
-			e.printStackTrace();
+			log.error(e);
 			throw new RuntimeException(e);
 		}
 		return dn;
@@ -232,6 +234,11 @@
 	protected List<String> searchRolesForUserDn(LdapDN userDn) {
 		List<String> roles = new ArrayList<String>();
 
+		if (log.isDebugEnabled()) {
+			log.debug("search roles for user with DN [" + userDn.getUpName()
+					+ "]");
+		}
+
 		try {
 			CoreSession adminSession = directoryService.getAdminSession();
 
@@ -254,9 +261,15 @@
 			adminSession.unbind();
 
 		} catch (Exception e) {
-			e.printStackTrace();
+			log.error(e);
 			throw new RuntimeException(e);
 		}
+
+		if (log.isDebugEnabled()) {
+			log.debug(roles.size() + " roles found for user with DN ["
+					+ userDn.getUpName() + "]:" + roles);
+		}
+
 		return roles;
 	}
 



Mime
View raw message