Search in sources :

Example 1 with SrvDiskInfo

use of org.alfresco.jlan.server.filesys.SrvDiskInfo 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);
}
Also used : StoreRef(org.alfresco.service.cmr.repository.StoreRef) NodeRef(org.alfresco.service.cmr.repository.NodeRef) SrvDiskInfo(org.alfresco.jlan.server.filesys.SrvDiskInfo) ServerConfigurationBean(org.alfresco.filesys.config.ServerConfigurationBean) AlfrescoRuntimeException(org.alfresco.error.AlfrescoRuntimeException) DiskInterface(org.alfresco.jlan.server.filesys.DiskInterface) ContentContext(org.alfresco.filesys.repo.ContentContext) DiskSharedDevice(org.alfresco.jlan.server.filesys.DiskSharedDevice)

Aggregations

AlfrescoRuntimeException (org.alfresco.error.AlfrescoRuntimeException)1 ServerConfigurationBean (org.alfresco.filesys.config.ServerConfigurationBean)1 ContentContext (org.alfresco.filesys.repo.ContentContext)1 DiskInterface (org.alfresco.jlan.server.filesys.DiskInterface)1 DiskSharedDevice (org.alfresco.jlan.server.filesys.DiskSharedDevice)1 SrvDiskInfo (org.alfresco.jlan.server.filesys.SrvDiskInfo)1 NodeRef (org.alfresco.service.cmr.repository.NodeRef)1 StoreRef (org.alfresco.service.cmr.repository.StoreRef)1