mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user