Merge of BRANCHES/DEV/4.2_ENT_DEV/ADMIN_CONSOLE - Admin Console 46247-46672

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@46677 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2013-02-15 11:44:53 +00:00
parent dc60a53187
commit a625d87120
27 changed files with 930 additions and 51 deletions

View File

@@ -22,6 +22,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.atomic.AtomicInteger;
import net.sf.acegisecurity.Authentication;
import net.sf.acegisecurity.GrantedAuthority;
@@ -160,9 +161,11 @@ public abstract class AbstractAuthenticationComponent implements AuthenticationC
try
{
authenticateImpl(userName, password);
onAuthenticate();
}
catch (RuntimeException e)
{
onFail();
if (logger.isDebugEnabled())
{
logger.debug("Failed to authenticate user \"" + userName + '"', e);
@@ -661,4 +664,26 @@ public abstract class AbstractAuthenticationComponent implements AuthenticationC
{
return authenticationContext.setUserDetails(ud);
}
AtomicInteger numberSuccessfulAuthentications = new AtomicInteger(0);
AtomicInteger numberFailedAuthentications = new AtomicInteger(0);
protected void onAuthenticate()
{
numberSuccessfulAuthentications.getAndIncrement();
}
protected void onFail()
{
numberFailedAuthentications.getAndIncrement();
}
public int getNumberSuccessfulAuthentications()
{
return numberSuccessfulAuthentications.get();
}
public int getNumberFailedAuthentications()
{
return numberFailedAuthentications.get();
}
}