Class TokenServiceImpl
- java.lang.Object
-
- co.mastermindcms.modules.services.TokenServiceImpl
-
- All Implemented Interfaces:
TokenService
@Service public class TokenServiceImpl extends java.lang.Object implements TokenService
-
-
Field Summary
Fields Modifier and Type Field Description private PasswordResetTokenRepository
passwordTokenRepository
private SequenceGeneratorService
sequenceGeneratorService
private VerificationTokenRepository
tokenRepository
-
Constructor Summary
Constructors Constructor Description TokenServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createPasswordResetTokenForUser(User user, java.lang.String token)
This method creates a verification toke for database entity(user).void
createVerificationTokenForUser(User user, java.lang.String token)
This method creates a verification toke for database entity(user).void
deletePasswordResetToken(PasswordResetToken passwordResetToken)
This method removed a database entity.void
deleteVerificationToken(VerificationToken verificationToken)
This method removed a database entity.java.util.Optional<PasswordResetToken>
findByUser(User user)
This method returns a database entity.java.util.Optional<PasswordResetToken>
getPasswordResetToken(java.lang.String passwordResetToken)
This method returns a database entity.java.util.Optional<VerificationToken>
getVerificationToken(java.lang.String verificationToken)
This method returns a database entity.
-
-
-
Field Detail
-
tokenRepository
@Autowired private VerificationTokenRepository tokenRepository
-
passwordTokenRepository
@Autowired private PasswordResetTokenRepository passwordTokenRepository
-
sequenceGeneratorService
@Autowired private SequenceGeneratorService sequenceGeneratorService
-
-
Method Detail
-
createVerificationTokenForUser
@Transactional public void createVerificationTokenForUser(User user, java.lang.String token)
Description copied from interface:TokenService
This method creates a verification toke for database entity(user).- Specified by:
createVerificationTokenForUser
in interfaceTokenService
- Parameters:
user
- database entitytoken
- field value, which will be added in database entity
-
createPasswordResetTokenForUser
@Transactional public void createPasswordResetTokenForUser(User user, java.lang.String token)
Description copied from interface:TokenService
This method creates a verification toke for database entity(user).- Specified by:
createPasswordResetTokenForUser
in interfaceTokenService
- Parameters:
user
- database entitytoken
- field value, which will be added in database entity
-
getVerificationToken
@Transactional public java.util.Optional<VerificationToken> getVerificationToken(java.lang.String verificationToken)
Description copied from interface:TokenService
This method returns a database entity.- Specified by:
getVerificationToken
in interfaceTokenService
- Parameters:
verificationToken
- database entity- Returns:
- optional value to externally interaction
-
getPasswordResetToken
@Transactional public java.util.Optional<PasswordResetToken> getPasswordResetToken(java.lang.String passwordResetToken)
Description copied from interface:TokenService
This method returns a database entity.- Specified by:
getPasswordResetToken
in interfaceTokenService
- Parameters:
passwordResetToken
- database entity- Returns:
- optional value to externally interaction
-
findByUser
@Transactional public java.util.Optional<PasswordResetToken> findByUser(User user)
Description copied from interface:TokenService
This method returns a database entity.- Specified by:
findByUser
in interfaceTokenService
- Parameters:
user
- database entity for find and return other database entity- Returns:
- optional value to externally interaction
-
deleteVerificationToken
@Transactional public void deleteVerificationToken(VerificationToken verificationToken)
Description copied from interface:TokenService
This method removed a database entity.- Specified by:
deleteVerificationToken
in interfaceTokenService
- Parameters:
verificationToken
- database entity, which will be removed
-
deletePasswordResetToken
@Transactional public void deletePasswordResetToken(PasswordResetToken passwordResetToken)
Description copied from interface:TokenService
This method removed a database entity.- Specified by:
deletePasswordResetToken
in interfaceTokenService
- Parameters:
passwordResetToken
- database entity, which will be removed
-
-