Class RecoveryServiceImpl

    • Constructor Summary

      Constructors 
      Constructor Description
      RecoveryServiceImpl​(org.molgenis.data.DataService dataService, org.molgenis.data.security.user.UserService userService, RecoveryCodeFactory recoveryCodeFactory, org.molgenis.data.populate.IdGenerator idGenerator)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.stream.Stream<RecoveryCode> generateRecoveryCodes()
      Generates new recovery codes for the current user and deletes the old codes (if any).
      java.util.stream.Stream<RecoveryCode> getRecoveryCodes()
      Get the recovery codes (if any) of the current user.
      void useRecoveryCode​(java.lang.String recoveryCode)
      Checks if a recovery code is valid for the current user and throws an exception if it is not.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RecoveryServiceImpl

        public RecoveryServiceImpl​(org.molgenis.data.DataService dataService,
                                   org.molgenis.data.security.user.UserService userService,
                                   RecoveryCodeFactory recoveryCodeFactory,
                                   org.molgenis.data.populate.IdGenerator idGenerator)
    • Method Detail

      • generateRecoveryCodes

        @Transactional
        public java.util.stream.Stream<RecoveryCode> generateRecoveryCodes()
        Description copied from interface: RecoveryService
        Generates new recovery codes for the current user and deletes the old codes (if any).
        Specified by:
        generateRecoveryCodes in interface RecoveryService
        Returns:
        stream of the new RecoveryCodes
      • useRecoveryCode

        @Transactional
        public void useRecoveryCode​(java.lang.String recoveryCode)
        Description copied from interface: RecoveryService
        Checks if a recovery code is valid for the current user and throws an exception if it is not. The code is removed after a successful recovery attempt.
        Specified by:
        useRecoveryCode in interface RecoveryService
        Parameters:
        recoveryCode - the code to validate