Performance tweaks after profiling HEAD code. Audit interceptor shortcut to avoid calling auditImpl at all when auditing disabled in config.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6700 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-09-07 14:27:17 +00:00
parent a03df08f5e
commit e22575b74e
4 changed files with 76 additions and 63 deletions

View File

@@ -222,12 +222,16 @@ public abstract class AuthenticationUtil
*/
private static String getUserName(Authentication authentication)
{
String username = authentication.getPrincipal().toString();
String username;
if (authentication.getPrincipal() instanceof UserDetails)
{
username = ((UserDetails) authentication.getPrincipal()).getUsername();
}
else
{
username = authentication.getPrincipal().toString();
}
return username;
}