Search in sources :

Example 1 with SharedDeviceList

use of org.alfresco.jlan.server.core.SharedDeviceList in project alfresco-repository by Alfresco.

the class MultiTenantShareMapper method getTenantShareList.

/**
 * Return the list of available shares for a particular tenant
 *
 * @param host String
 * @param sess SrvSession
 * @param allShares boolean
 * @return SharedDeviceList
 */
private final SharedDeviceList getTenantShareList(String host, SrvSession sess, boolean allShares) {
    // Get the tenant user domain
    String tenantDomain = m_alfrescoConfig.getTenantService().getCurrentUserDomain();
    // Get the share list for the current domain
    SharedDeviceList shareList = null;
    if (m_tenantShareLists.containsKey(tenantDomain)) {
        shareList = m_tenantShareLists.get(tenantDomain);
    }
    synchronized (m_tenantShareLists) {
        // Get the tenant specific share list
        shareList = m_tenantShareLists.get(tenantDomain);
        if (shareList == null) {
            // Create the tenant specific share list
            shareList = new SharedDeviceList();
            // Create a tenant specific share for this domain
            shareList.addShare(createTenantShare(tenantDomain));
            // Store the list for use by other members of this domain
            m_tenantShareLists.put(tenantDomain, shareList);
        }
    }
    return shareList;
}
Also used : SharedDeviceList(org.alfresco.jlan.server.core.SharedDeviceList)

Example 2 with SharedDeviceList

use of org.alfresco.jlan.server.core.SharedDeviceList in project alfresco-repository by Alfresco.

the class MultiTenantShareMapper method deleteShares.

/**
 * Delete temporary shares for the specified session
 *
 * @param sess SrvSession
 */
public void deleteShares(SrvSession sess) {
    if (sess.hasDynamicShares() == false)
        return;
    // Delete the dynamic shares
    SharedDeviceList shares = sess.getDynamicShareList();
    Enumeration<SharedDevice> enm = shares.enumerateShares();
    while (enm.hasMoreElements()) {
        // Get the current share from the list
        SharedDevice shr = enm.nextElement();
        // Close the shared device
        shr.getContext().CloseContext();
    }
}
Also used : SharedDeviceList(org.alfresco.jlan.server.core.SharedDeviceList) DiskSharedDevice(org.alfresco.jlan.server.filesys.DiskSharedDevice) SharedDevice(org.alfresco.jlan.server.core.SharedDevice)

Aggregations

SharedDeviceList (org.alfresco.jlan.server.core.SharedDeviceList)2 SharedDevice (org.alfresco.jlan.server.core.SharedDevice)1 DiskSharedDevice (org.alfresco.jlan.server.filesys.DiskSharedDevice)1