mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
MOB-412: Decouple thread local authentication methods from AuthenticationComponent into new AuthenticationContext super-interface. The AuthenticationContext is a delegate of AbstractAuthenticationComponent and can be accessed directly by low-level classes (e.g. schema bootstrap) before the authentication subsystem is available.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13721 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -34,7 +34,7 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.node.NodeServicePolicies;
|
||||
import org.alfresco.repo.policy.JavaBehaviour;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationContext;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.service.cmr.repository.ContentData;
|
||||
@@ -73,7 +73,7 @@ public class ContentUsageImpl implements ContentUsageService,
|
||||
private PersonService personService;
|
||||
private PolicyComponent policyComponent;
|
||||
private UsageService usageService;
|
||||
private AuthenticationComponent authenticationComponent;
|
||||
private AuthenticationContext authenticationContext;
|
||||
private TenantService tenantService;
|
||||
|
||||
private boolean enabled = true;
|
||||
@@ -100,9 +100,9 @@ public class ContentUsageImpl implements ContentUsageService,
|
||||
this.policyComponent = policyComponent;
|
||||
}
|
||||
|
||||
public void setAuthenticationComponent(AuthenticationComponent authenticationComponent)
|
||||
public void setAuthenticationContext(AuthenticationContext authenticationContext)
|
||||
{
|
||||
this.authenticationComponent = authenticationComponent;
|
||||
this.authenticationContext = authenticationContext;
|
||||
}
|
||||
|
||||
public void setTenantService(TenantService tenantService)
|
||||
@@ -344,7 +344,7 @@ public class ContentUsageImpl implements ContentUsageService,
|
||||
|
||||
private void incrementUserUsage(String userName, long contentSize, NodeRef contentNodeRef)
|
||||
{
|
||||
if (! authenticationComponent.isSystemUserName(userName))
|
||||
if (! authenticationContext.isSystemUserName(userName))
|
||||
{
|
||||
// increment usage - add positive delta
|
||||
if (logger.isDebugEnabled()) logger.debug("incrementUserUsage: username="+userName+", contentSize="+contentSize+", contentNodeRef="+contentNodeRef);
|
||||
@@ -376,7 +376,7 @@ public class ContentUsageImpl implements ContentUsageService,
|
||||
|
||||
private void decrementUserUsage(String userName, long contentSize, NodeRef contentNodeRef)
|
||||
{
|
||||
if (! authenticationComponent.isSystemUserName(userName))
|
||||
if (! authenticationContext.isSystemUserName(userName))
|
||||
{
|
||||
// decrement usage - add negative delta
|
||||
if (logger.isDebugEnabled()) logger.debug("decrementUserUsage: username="+userName+", contentSize="+contentSize+", contentNodeRef="+contentNodeRef);
|
||||
|
Reference in New Issue
Block a user