org.alfresco.repo.security.person
Class HomeFolderProviderSynchronizer

java.lang.Object
  extended by org.springframework.extensions.surf.util.AbstractLifecycleBean
      extended by org.alfresco.repo.security.person.HomeFolderProviderSynchronizer
All Implemented Interfaces:
java.util.EventListener, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener

public class HomeFolderProviderSynchronizer
extends org.springframework.extensions.surf.util.AbstractLifecycleBean

Called on startup to move (synchronise) home folders to the preferred location defined by their HomeFolderProvider2 or extend the now depreciated AbstractHomeFolderProvider. Only users that use a HomeFolderProvider2 that don't provide a shared home folder (all user are given the same home folder) will be moved. This allows existing home directories to be moved to reflect changes in policy related to the location of home directories. Originally created for ALF-7797 which related to the need to move large numbers of existing home directories created via an LDAP import into a hierarchical folder structure with fewer home folder in each.

By default no action is taken unless the the global property home_folder_provider_synchronizer.enabled=true.

The home folders for internal users (such as admin and guest) that use guestHomeFolderProvider or bootstrapHomeFolderProvider are not moved, nor are any users that use HomeFolderProviders create shared home folders (all user are given the same home folder). It is also possible change the HomeFolderProvider used by all other users by setting the global property home_folder_provider_synchronizer.override_provider=<providerBeanName>.

Warning: The LDAP synchronise process overwrites the home folder provider property. This is not an issue as long as the root path of the overwriting provider is the same as the overwritten provider or is not an ancestor of any of the existing home folders. This is important because the root directory value is used by this class to tidy up empty 'parent' folders under the root when a home folders are moved elsewhere. If you have any concerns that this may not be true, set the global property home_folder_provider_synchronizer.keep_empty_parents=true and tidy up any empty folders manually. Typically users created by the LDAP sync process are all placed under the same root folder so there will be no parent folders anyway.


Field Summary
 
Fields inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
log
 
Constructor Summary
HomeFolderProviderSynchronizer(TransactionService transactionService, AuthorityService authorityService, PersonService personService, FileFolderService fileFolderService, org.alfresco.service.cmr.repository.NodeService nodeService, PortableHomeFolderManager homeFolderManager, TenantAdminService tenantAdminService)
           
 
Method Summary
protected  void onBootstrap(org.springframework.context.ApplicationEvent event)
           
protected  void onShutdown(org.springframework.context.ApplicationEvent event)
           
 void setEnabled(java.lang.String enabled)
           
 void setKeepEmptyParents(java.lang.String keepEmptyParents)
           
 void setOverrideHomeFolderProviderName(java.lang.String overrideHomeFolderProviderName)
           
 
Methods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
getApplicationContext, onApplicationEvent, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HomeFolderProviderSynchronizer

public HomeFolderProviderSynchronizer(TransactionService transactionService,
                                      AuthorityService authorityService,
                                      PersonService personService,
                                      FileFolderService fileFolderService,
                                      org.alfresco.service.cmr.repository.NodeService nodeService,
                                      PortableHomeFolderManager homeFolderManager,
                                      TenantAdminService tenantAdminService)
Method Detail

setEnabled

public void setEnabled(java.lang.String enabled)

setOverrideHomeFolderProviderName

public void setOverrideHomeFolderProviderName(java.lang.String overrideHomeFolderProviderName)

setKeepEmptyParents

public void setKeepEmptyParents(java.lang.String keepEmptyParents)

onShutdown

protected void onShutdown(org.springframework.context.ApplicationEvent event)
Specified by:
onShutdown in class org.springframework.extensions.surf.util.AbstractLifecycleBean

onBootstrap

protected void onBootstrap(org.springframework.context.ApplicationEvent event)
Specified by:
onBootstrap in class org.springframework.extensions.surf.util.AbstractLifecycleBean


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.