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
  • Constructor Details

    • UpgradePasswordHashWorker

      public UpgradePasswordHashWorker()
  • Method Details

    • 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.BeansException
      Set the application context for event publishing during batch processing
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • execute

      Performs the work, including logging details of progress.
    • processPasswordHash

      public boolean processPasswordHash(Map<QName,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.