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;
}
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();
}
}
Aggregations