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:
Derek Hulley
2008-09-05 13:04:46 +00:00
parent 4bfa120a9c
commit 6bb620a57b
3 changed files with 24 additions and 19 deletions

View File

@@ -37,7 +37,7 @@
<property name="fileFolderService" ref="fileFolderService" /> <property name="fileFolderService" ref="fileFolderService" />
<property name="searchService" ref="SearchService" /> <property name="searchService" ref="SearchService" />
<property name="permissionService" ref="PermissionService" /> <property name="permissionService" ref="PermissionService" />
<property name="tenantDeployerService" ref="tenantAdminService" /> <property name="tenantAdminService" ref="tenantAdminService" />
</bean> </bean>
<bean name="webscripts.store.repo.extension" parent="webscripts.repostore"> <bean name="webscripts.store.repo.extension" parent="webscripts.repostore">
@@ -140,7 +140,7 @@
<property name="templateProcessor" ref="webscripts.repo.templateprocessor" /> <property name="templateProcessor" ref="webscripts.repo.templateprocessor" />
<property name="scriptProcessor" ref="webscripts.repo.scriptprocessor" /> <property name="scriptProcessor" ref="webscripts.repo.scriptprocessor" />
<property name="descriptorService" ref="DescriptorService" /> <property name="descriptorService" ref="DescriptorService" />
<property name="tenantDeployerService" ref="tenantAdminService" /> <property name="tenantAdminService" ref="tenantAdminService" />
<property name="webScriptsRegistryCache" ref="webScriptsRegistryCache"/> <property name="webScriptsRegistryCache" ref="webScriptsRegistryCache"/>
</bean> </bean>
@@ -339,7 +339,6 @@
<property name="nodeService" ref="NodeService"/> <property name="nodeService" ref="NodeService"/>
<property name="userNameGenerator" ref="userNameGenerator"/> <property name="userNameGenerator" ref="userNameGenerator"/>
<property name="passwordGenerator" ref="passwordGenerator"/> <property name="passwordGenerator" ref="passwordGenerator"/>
<property name="namespaceService" ref="NamespaceService" />
</bean> </bean>
<!-- --> <!-- -->

View File

@@ -41,7 +41,7 @@ import org.alfresco.model.ContentModel;
import org.alfresco.repo.model.filefolder.FileFolderServiceImpl; import org.alfresco.repo.model.filefolder.FileFolderServiceImpl;
import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.tenant.TenantDeployer; 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;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.cmr.model.FileFolderService; import org.alfresco.service.cmr.model.FileFolderService;
@@ -86,7 +86,7 @@ public class RepoStore implements Store, TenantDeployer
protected FileFolderService fileService; protected FileFolderService fileService;
protected NamespaceService namespaceService; protected NamespaceService namespaceService;
protected PermissionService permissionService; protected PermissionService permissionService;
protected TenantDeployerService tenantDeployerService; protected TenantService tenantService;
/** /**
@@ -148,9 +148,9 @@ public class RepoStore implements Store, TenantDeployer
/** /**
* Sets the tenant deployer service * 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() public void destroy()
{ {
baseNodeRefs.remove(tenantDeployerService.getCurrentUserDomain()); baseNodeRefs.remove(tenantService.getCurrentUserDomain());
} }
private NodeRef getBaseNodeRef() private NodeRef getBaseNodeRef()
{ {
String tenantDomain = tenantDeployerService.getCurrentUserDomain(); String tenantDomain = tenantService.getCurrentUserDomain();
NodeRef baseNodeRef = baseNodeRefs.get(tenantDomain); NodeRef baseNodeRef = baseNodeRefs.get(tenantDomain);
if (baseNodeRef == null) if (baseNodeRef == null)
{ {

View File

@@ -33,9 +33,9 @@ import javax.servlet.http.HttpServletResponse;
import org.alfresco.repo.cache.SimpleCache; import org.alfresco.repo.cache.SimpleCache;
import org.alfresco.repo.model.Repository; import org.alfresco.repo.model.Repository;
import org.alfresco.repo.security.authentication.AuthenticationUtil; 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.TenantDeployer;
import org.alfresco.repo.tenant.TenantDeployerService; import org.alfresco.repo.tenant.TenantService;
import org.alfresco.repo.transaction.AlfrescoTransactionSupport; import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
import org.alfresco.repo.transaction.RetryingTransactionHelper; import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
@@ -78,7 +78,8 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
private AuthorityService authorityService; private AuthorityService authorityService;
private PermissionService permissionService; private PermissionService permissionService;
private DescriptorService descriptorService; private DescriptorService descriptorService;
private TenantDeployerService tenantDeployerService; private TenantService tenantService;
private TenantAdminService tenantAdminService;
private ObjectFactory registryFactory; private ObjectFactory registryFactory;
private SimpleCache<String, Registry> webScriptsRegistryCache; private SimpleCache<String, Registry> webScriptsRegistryCache;
@@ -146,11 +147,16 @@ 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) /* (non-Javadoc)
@@ -336,7 +342,7 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
@Override @Override
public Registry getRegistry() public Registry getRegistry()
{ {
String tenantDomain = tenantDeployerService.getCurrentUserDomain(); String tenantDomain = tenantService.getCurrentUserDomain();
Registry registry = webScriptsRegistryCache.get(tenantDomain); Registry registry = webScriptsRegistryCache.get(tenantDomain);
if (registry == null) if (registry == null)
{ {
@@ -377,10 +383,10 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
*/ */
public void init() public void init()
{ {
tenantDeployerService.register(this); tenantAdminService.register(this);
Registry registry = (Registry)registryFactory.getObject(); Registry registry = (Registry)registryFactory.getObject();
webScriptsRegistryCache.put(tenantDeployerService.getCurrentUserDomain(), registry); webScriptsRegistryCache.put(tenantService.getCurrentUserDomain(), registry);
super.reset(); super.reset();
} }
@@ -390,6 +396,6 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
*/ */
public void destroy() public void destroy()
{ {
webScriptsRegistryCache.remove(tenantDeployerService.getCurrentUserDomain()); webScriptsRegistryCache.remove(tenantService.getCurrentUserDomain());
} }
} }