mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Multi-Tenant node interceptor
- Actually less happening here than it would first appear - Some MT bean and interface consolidation - The unit test has no meat to it, yet... coming soon! git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10781 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -41,7 +41,7 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.model.filefolder.FileFolderServiceImpl;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.tenant.TenantDeployer;
|
||||
import org.alfresco.repo.tenant.TenantDeployerService;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.model.FileFolderService;
|
||||
@@ -86,7 +86,7 @@ public class RepoStore implements Store, TenantDeployer
|
||||
protected FileFolderService fileService;
|
||||
protected NamespaceService namespaceService;
|
||||
protected PermissionService permissionService;
|
||||
protected TenantDeployerService tenantDeployerService;
|
||||
protected TenantService tenantService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -148,9 +148,9 @@ public class RepoStore implements Store, TenantDeployer
|
||||
/**
|
||||
* Sets the tenant deployer service
|
||||
*/
|
||||
public void setTenantDeployerService(TenantDeployerService tenantDeployerService)
|
||||
public void setTenantService(TenantService tenantService)
|
||||
{
|
||||
this.tenantDeployerService = tenantDeployerService;
|
||||
this.tenantService = tenantService;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -200,12 +200,12 @@ public class RepoStore implements Store, TenantDeployer
|
||||
*/
|
||||
public void destroy()
|
||||
{
|
||||
baseNodeRefs.remove(tenantDeployerService.getCurrentUserDomain());
|
||||
baseNodeRefs.remove(tenantService.getCurrentUserDomain());
|
||||
}
|
||||
|
||||
private NodeRef getBaseNodeRef()
|
||||
{
|
||||
String tenantDomain = tenantDeployerService.getCurrentUserDomain();
|
||||
String tenantDomain = tenantService.getCurrentUserDomain();
|
||||
NodeRef baseNodeRef = baseNodeRefs.get(tenantDomain);
|
||||
if (baseNodeRef == null)
|
||||
{
|
||||
|
@@ -33,9 +33,9 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.alfresco.repo.cache.SimpleCache;
|
||||
import org.alfresco.repo.model.Repository;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.template.CropContentMethod;
|
||||
import org.alfresco.repo.tenant.TenantAdminService;
|
||||
import org.alfresco.repo.tenant.TenantDeployer;
|
||||
import org.alfresco.repo.tenant.TenantDeployerService;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
@@ -78,7 +78,8 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
|
||||
private AuthorityService authorityService;
|
||||
private PermissionService permissionService;
|
||||
private DescriptorService descriptorService;
|
||||
private TenantDeployerService tenantDeployerService;
|
||||
private TenantService tenantService;
|
||||
private TenantAdminService tenantAdminService;
|
||||
private ObjectFactory registryFactory;
|
||||
private SimpleCache<String, Registry> webScriptsRegistryCache;
|
||||
|
||||
@@ -146,13 +147,18 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
|
||||
}
|
||||
|
||||
/**
|
||||
* @param tenantDeployerService
|
||||
* @param tenantAdminService
|
||||
*/
|
||||
public void setTenantDeployerService(TenantDeployerService tenantDeployerService)
|
||||
public void setTenantService(TenantService tenantService)
|
||||
{
|
||||
this.tenantDeployerService = tenantDeployerService;
|
||||
this.tenantService = tenantService;
|
||||
}
|
||||
|
||||
public void setTenantAdminService(TenantAdminService tenantAdminService)
|
||||
{
|
||||
this.tenantAdminService = tenantAdminService;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.scripts.Container#getDescription()
|
||||
*/
|
||||
@@ -336,7 +342,7 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
|
||||
@Override
|
||||
public Registry getRegistry()
|
||||
{
|
||||
String tenantDomain = tenantDeployerService.getCurrentUserDomain();
|
||||
String tenantDomain = tenantService.getCurrentUserDomain();
|
||||
Registry registry = webScriptsRegistryCache.get(tenantDomain);
|
||||
if (registry == null)
|
||||
{
|
||||
@@ -377,10 +383,10 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
|
||||
*/
|
||||
public void init()
|
||||
{
|
||||
tenantDeployerService.register(this);
|
||||
tenantAdminService.register(this);
|
||||
|
||||
Registry registry = (Registry)registryFactory.getObject();
|
||||
webScriptsRegistryCache.put(tenantDeployerService.getCurrentUserDomain(), registry);
|
||||
webScriptsRegistryCache.put(tenantService.getCurrentUserDomain(), registry);
|
||||
|
||||
super.reset();
|
||||
}
|
||||
@@ -390,6 +396,6 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
|
||||
*/
|
||||
public void destroy()
|
||||
{
|
||||
webScriptsRegistryCache.remove(tenantDeployerService.getCurrentUserDomain());
|
||||
webScriptsRegistryCache.remove(tenantService.getCurrentUserDomain());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user