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 java.lang.Object implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBeanUpgrade 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 Classes Modifier and Type Class Description static classUpgradePasswordHashWorker.UpgradePasswordHashJobA scheduled job that checks and upgrades users passwords to the system's preferred encoding.static classUpgradePasswordHashWorker.UpgradePasswordHashWorkResultThread-safe helper class to carry the job progress information.
-
Constructor Summary
Constructors Constructor Description UpgradePasswordHashWorker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()UpgradePasswordHashWorker.UpgradePasswordHashWorkResultexecute()Performs the work, including logging details of progress.booleanprocessPasswordHash(java.util.Map<org.alfresco.service.namespace.QName,java.io.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)
-
-
-
Method Detail
-
setJobLockService
public void setJobLockService(JobLockService jobLockService)
-
setTransactionService
public void setTransactionService(TransactionService transactionService)
-
setAuthenticationDao
public void setAuthenticationDao(MutableAuthenticationDao authenticationDao)
-
setCompositePasswordEncoder
public void setCompositePasswordEncoder(CompositePasswordEncoder passwordEncoder)
-
setPatchDAO
public void setPatchDAO(PatchDAO patchDAO)
-
setNodeDAO
public void setNodeDAO(NodeDAO nodeDAO)
-
setQnameDAO
public void setQnameDAO(QNameDAO qnameDAO)
-
setBehaviourFilter
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
-
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.BeansExceptionSet the application context for event publishing during batch processing- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
execute
public UpgradePasswordHashWorker.UpgradePasswordHashWorkResult execute()
Performs the work, including logging details of progress.
-
processPasswordHash
public boolean processPasswordHash(java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> properties)
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.
-
-