Class UpgradePasswordHashWorker
java.lang.Object
org.alfresco.repo.security.authentication.UpgradePasswordHashWorker
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
public class UpgradePasswordHashWorker
extends Object
implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
Upgrade Password Hash Worker
What it is
A worker for a scheduled job that checks and upgrades users passwords to the system's preferred encoding.Settings that control the behaviour
- ${system.upgradePasswordHash.jobBatchSize} - the number of users to process at one time.
- ${system.upgradePasswordHash.jobQueryRange} - the node ID range to query for. The process will repeat from the first to the last node, querying for up to this many nodes. Only reduce the value if the NodeDAO query takes a long time.
- ${system.upgradePasswordHash.jobThreadCount} - the number of threads that will handle user checks and changes. Increase or decrease this to allow for free CPU capacity on the machine executing the job.
- Author:
- Gavin Cornwell
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA scheduled job that checks and upgrades users passwords to the system's preferred encoding.static classThread-safe helper class to carry the job progress information. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Performs the work, including logging details of progress.booleanprocessPasswordHash(Map<QName, Serializable> properties) Processes the user properties, re-hashing the password, if required.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) Set the application context for event publishing during batch processingvoidsetAuthenticationDao(MutableAuthenticationDao authenticationDao) voidsetBatchSize(int batchSize) Sets the number of users to process at one time.voidsetBehaviourFilter(BehaviourFilter behaviourFilter) voidsetCompositePasswordEncoder(CompositePasswordEncoder passwordEncoder) voidsetJobLockService(JobLockService jobLockService) voidsetNodeDAO(NodeDAO nodeDAO) voidsetPatchDAO(PatchDAO patchDAO) voidsetQnameDAO(QNameDAO qnameDAO) voidsetQueryRange(int queryRange) Sets the number of users to retrieve from the repository in each query.voidsetThreadCount(int threadCount) Sets the number of threads to use to process users.voidsetTransactionService(TransactionService transactionService)
-
Constructor Details
-
UpgradePasswordHashWorker
public UpgradePasswordHashWorker()
-
-
Method Details
-
setJobLockService
-
setTransactionService
-
setAuthenticationDao
-
setCompositePasswordEncoder
-
setPatchDAO
-
setNodeDAO
-
setQnameDAO
-
setBehaviourFilter
-
setQueryRange
public void setQueryRange(int queryRange) Sets the number of users to retrieve from the repository in each query.- Parameters:
queryRange- The query range
-
setThreadCount
public void setThreadCount(int threadCount) Sets the number of threads to use to process users.- Parameters:
threadCount- Number of threads
-
setBatchSize
public void setBatchSize(int batchSize) Sets the number of users to process at one time.- Parameters:
batchSize- The batch size
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException Set the application context for event publishing during batch processing- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
execute
Performs the work, including logging details of progress. -
processPasswordHash
Processes the user properties, re-hashing the password, if required.- Parameters:
properties- The properties for the user.- Returns:
- true if the password was upgraded, false if no changes were made.
-