Class VerificationServiceImpl

java.lang.Object
org.craftercms.profile.services.impl.VerificationServiceImpl
All Implemented Interfaces:
VerificationService

public class VerificationServiceImpl extends Object implements VerificationService
Default implementation of VerificationService.
Author:
avasquez
  • Field Details

  • Constructor Details

    • VerificationServiceImpl

      public VerificationServiceImpl()
  • Method Details

    • setPermissionEvaluator

      public void setPermissionEvaluator(org.craftercms.commons.security.permissions.PermissionEvaluator<AccessToken,String> permissionEvaluator)
    • setTokenRepository

      public void setTokenRepository(VerificationTokenRepository tokenRepository)
    • setEmailFactory

      public void setEmailFactory(org.craftercms.commons.mail.EmailFactory emailFactory)
    • setTokenMaxAge

      public void setTokenMaxAge(int tokenMaxAge)
    • createToken

      public VerificationToken createToken(Profile profile) throws ProfileException
      Description copied from interface: VerificationService
      Creates a new verification token. The token can be later transmitted to the client through email, for example.
      Specified by:
      createToken in interface VerificationService
      Parameters:
      profile - the profile to create the token for
      Throws:
      ProfileException
    • sendEmail

      @Async public void sendEmail(VerificationToken token, Profile profile, String verificationBaseUrl, String from, String subject, String templateName) throws ProfileException
      Description copied from interface: VerificationService
      Creates a verification token and sends the user an email with the token for verification.
      Specified by:
      sendEmail in interface VerificationService
      Parameters:
      token - the verification token to send
      profile - the profile of the user
      verificationBaseUrl - the URL the user should click to verify the new profile
      from - the from address
      subject - the subject of the email
      templateName - the template name of the email
      Throws:
      ProfileException
    • getToken

      public VerificationToken getToken(String tokenId) throws ProfileException
      Description copied from interface: VerificationService
      Returns the token that corresponds to the specified ID
      Specified by:
      getToken in interface VerificationService
      Parameters:
      tokenId - the token ID, sent in the verification email
      Returns:
      the verification token object associated to the ID
      Throws:
      ProfileException
    • deleteToken

      public void deleteToken(String tokenId) throws ProfileException
      Description copied from interface: VerificationService
      Deletes the token corresponding the specified ID.
      Specified by:
      deleteToken in interface VerificationService
      Parameters:
      tokenId - the ID of the token to delete
      Throws:
      ProfileException
    • createVerificationUrl

      protected String createVerificationUrl(String verificationBaseUrl, String tokenId)
    • checkIfManageProfilesIsAllowed

      protected void checkIfManageProfilesIsAllowed(String tenantName)