Class ConfirmationTokenService
java.lang.Object
com.example.demo.registration.token.ConfirmationTokenService
Service class that handles the core business logic for ConfirmationToken operations.
It acts as an intermediary between the business layer and the ConfirmationTokenRepository.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves a confirmation token by its unique token string.voidSaves a new confirmation token to the database.intsetConfirmedAt(String token) Updates the confirmedAt timestamp for a specific token to the current time.
-
Constructor Details
-
ConfirmationTokenService
public ConfirmationTokenService()
-
-
Method Details
-
saveConfirmationToken
Saves a new confirmation token to the database.- Parameters:
token- The ConfirmationToken entity to be saved.
-
getToken
Retrieves a confirmation token by its unique token string.- Parameters:
token- The unique token string to search for.- Returns:
- A optional (so its optional) containing the ConfirmationToken if found.
-
setConfirmedAt
Updates the confirmedAt timestamp for a specific token to the current time. This method is called upon confirmation of a user's email.- Parameters:
token- The token string of the record to update.- Returns:
- The number of records updated (should be 1 when done successfully).
-