mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V4.0-BUG-FIX to HEAD
35394: ALF-13394: Allow administrators to gain SiteManager role 35407: ALF-12740: Updated XHR request processing for IE to ensure no caching (had previously thought IE9 was not affected but apparently it is) 35408: Fix for ALF-13286 who_can_create_site mention and bad error message - explicitly declare public interface on SiteService 35412: Merged DEV to V4.0-BUG-FIX 35153: ALF-1834: Renaming folders breaks web form content Original solution by Ivan has been reimplemented as per Derek's requirements and against 4.0. [DH: Did some minor legibility changes and fixed LF for AVMDiskDriver] 35414: Incremented version.revision for 4.0.2 35417: Merged BRANCHES/DEV/THOR0 to BRANCHES/DEV/V4.0-BUG-FIX: (THOR-6 / ALF-13755) 29356: THOR-6: MT is configured (but not enabled) by default - will be auto-enabled when first tenant is created 29455: THOR-6: build test/fix 29471: THOR-6: build test/fix 35423: Merged BRANCHES/DEV/THOR0 to BRANCHES/DEV/V4.0-BUG-FIX: (THOR-4 / ALF-13756) 29500: THOR-4: Replace Tenant attributes with Tenant table (alf_tenant) 29501: THOR-4: Replace Tenant attributes with Tenant table (alf_tenant) 29503: THOR-4: Replace Tenant attributes with Tenant table (alf_tenant) TODO: ALF-13757 - patch to migrate Tenant attributes to Tenant table (for existing customers) 35431: Merged V3.4-BUG-FIX to V4.0-BUG-FIX 35367: ALF-13382: WorkflowService Returning Incorrect Values When Using Native jBPM API to set Local Task Variables - Fix by Alex Bykov 35400: Fix for ALF-13557 - Share forms selectmany.ftl template does not work with Share search query parser; should do a logical OR or AND but does a concatenation 35416: Incremented version.revision for 3.4.10 35429: Merged V4.0-BUG-FIX to V3.4-BUG-FIX (partial) 35328: ALF-13409: Avoid concurrency issues in unit test tear downs by deleting users before sites. User deletion deletes invitations synchronously. Site deletion deletes invitations concurrently to avoid UI timeouts. The potential to access invitations that are being concurrently deleted still exists, but always did! 35430: ALF-13409: Avoid concurrency issues in unit test tear downs by deleting users before sites - another instance. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@35434 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -21,7 +21,8 @@ package org.alfresco.repo.tenant;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.repo.cache.SimpleCache;
|
||||
import org.alfresco.repo.domain.tenant.TenantAdminDAO;
|
||||
import org.alfresco.repo.domain.tenant.TenantEntity;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.service.cmr.repository.AssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
@@ -31,8 +32,6 @@ import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
import org.springframework.extensions.surf.util.ParameterCheck;
|
||||
|
||||
@@ -42,18 +41,12 @@ import org.springframework.extensions.surf.util.ParameterCheck;
|
||||
* Adapts names to be tenant specific or vice-versa.
|
||||
*/
|
||||
public class MultiTServiceImpl implements TenantService
|
||||
{
|
||||
private static Log logger = LogFactory.getLog(MultiTServiceImpl.class);
|
||||
{
|
||||
private TenantAdminDAO tenantAdminDAO;
|
||||
|
||||
// clusterable cache of enabled/disabled tenants - managed via TenantAdmin Service
|
||||
private SimpleCache<String, Tenant> tenantsCache;
|
||||
|
||||
private MultiTAdminServiceImpl tenantAdminService = null; // registered (rather than injected) - to avoid circular dependency
|
||||
|
||||
|
||||
public void setTenantsCache(SimpleCache<String, Tenant> tenantsCache)
|
||||
public void setTenantAdminDAO(TenantAdminDAO tenantAdminDAO)
|
||||
{
|
||||
this.tenantsCache = tenantsCache;
|
||||
this.tenantAdminDAO = tenantAdminDAO;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@@ -674,31 +667,18 @@ public class MultiTServiceImpl implements TenantService
|
||||
throw new TenantDisabledException(tenantDomain);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.tenant.TenantService#getTenant(java.lang.String)
|
||||
*/
|
||||
public Tenant getTenant(String tenantDomain)
|
||||
{
|
||||
tenantDomain = getTenantDomain(tenantDomain);
|
||||
Tenant tenant = tenantsCache.get(tenantDomain);
|
||||
if (tenant == null)
|
||||
TenantEntity tenantEntity = tenantAdminDAO.getTenant(tenantDomain);
|
||||
Tenant tenant = null;
|
||||
if (tenantEntity != null)
|
||||
{
|
||||
// backed by TenantAdminService - update this cache, e.g. could have been invalidated and/or expired
|
||||
if (tenantAdminService != null)
|
||||
{
|
||||
tenant = tenantAdminService.getTenant(tenantDomain);
|
||||
if (tenant == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("No such tenant " + tenantDomain);
|
||||
}
|
||||
else
|
||||
{
|
||||
putTenant(tenantDomain, tenant);
|
||||
}
|
||||
}
|
||||
tenant = new Tenant(tenantEntity.getTenantDomain(), tenantEntity.getEnabled(), tenantEntity.getContentRoot());
|
||||
}
|
||||
|
||||
return tenant;
|
||||
}
|
||||
|
||||
@@ -710,32 +690,6 @@ public class MultiTServiceImpl implements TenantService
|
||||
return true;
|
||||
}
|
||||
|
||||
// should only be called by Tenant Admin Service
|
||||
protected void register(MultiTAdminServiceImpl tenantAdminService)
|
||||
{
|
||||
this.tenantAdminService = tenantAdminService;
|
||||
}
|
||||
|
||||
// should only be called by Tenant Admin Service
|
||||
protected void putTenant(String tenantDomain, Tenant tenant)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("putTenant " + tenantDomain);
|
||||
}
|
||||
tenantsCache.put(tenantDomain, tenant);
|
||||
}
|
||||
|
||||
// should only be called by Tenant Admin Service
|
||||
protected void removeTenant(String tenantDomain)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("removeTenant " + tenantDomain);
|
||||
}
|
||||
tenantsCache.remove(tenantDomain);
|
||||
}
|
||||
|
||||
private String getTenantDomain(String tenantDomain)
|
||||
{
|
||||
return tenantDomain.toLowerCase(I18NUtil.getLocale());
|
||||
|
Reference in New Issue
Block a user