use of org.alfresco.filesys.config.ServerConfigurationBean in project alfresco-repository by Alfresco.
the class MultiTenantShareMapper method createTenantShare.
/**
* Create a tenant domain specific share
*/
private final DiskSharedDevice createTenantShare(String tenantDomain) {
logger.debug("create tenant share for domain " + tenantDomain);
StoreRef storeRef = new StoreRef(getStoreName());
NodeRef rootNodeRef = new NodeRef(storeRef.getProtocol(), storeRef.getIdentifier(), "dummy");
// Root nodeRef is required for storeRef part
rootNodeRef = m_alfrescoConfig.getTenantService().getRootNode(m_alfrescoConfig.getNodeService(), m_alfrescoConfig.getSearchService(), m_alfrescoConfig.getNamespaceService(), getRootPath(), rootNodeRef);
// Create the disk driver and context
DiskInterface diskDrv = getRepoDiskInterface();
ContentContext diskCtx = new ContentContext(m_tenantShareName, getStoreName(), getRootPath(), rootNodeRef);
if (m_quotaManager != null) {
diskCtx.setQuotaManager(m_quotaManager);
}
if (m_config instanceof ServerConfigurationBean) {
ServerConfigurationBean config = (ServerConfigurationBean) m_config;
config.initialiseRuntimeContext("cifs.tenant." + tenantDomain, diskCtx);
} else {
throw new AlfrescoRuntimeException("configuration error, unknown configuration bean");
}
// Default the filesystem to look like an 80Gb sized disk with 90% free space
diskCtx.setDiskInformation(new SrvDiskInfo(2560, 64, 512, 2304));
return new DiskSharedDevice(m_tenantShareName, diskDrv, diskCtx);
}
Aggregations