Interface AccountManager


  • public interface AccountManager
    Deprecated.
    since CQ 6.2 Use com.adobe.cq.account.api.AccountManagementService instead.
    Simple Utility for User-Account self services. Provides basics for creation and password handling. The Profile can be read and stored via its API
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      User createAccount​(java.lang.String uid, java.lang.String pwd, java.lang.String group, java.util.Map<java.lang.String,​RequestParameter[]> properties)
      Deprecated.
      Convenience to create a new User together with setting properties in one method call.
      User findAccount​(java.lang.String fragment)
      Deprecated.
      findAccount.
      User getOrCreateAccount​(java.lang.String id, java.lang.String pwd, java.lang.String group, java.util.Map<java.lang.String,​RequestParameter[]> properties)
      Deprecated.
      Convenience to either search and update an existing account or create it
      boolean requestAccount​(java.lang.String email, java.net.URL requestUrl)
      Deprecated.
      Request for creating a new account.
      boolean requestPasswordReset​(User user, java.net.URL requestUrl)
      Deprecated.
      Request a password rest.
      java.lang.String resetPassword​(User user)
      Deprecated.
      Reset the Password of the Account to a randomly generated
      java.lang.String resetPassword​(User user, java.lang.String key)
      Deprecated.
      Reset the Password of the Account to a randomly generated, requires a key in order to verify, that the reset has been requested by the key owner.
      boolean sendMail​(User user, java.lang.String from, java.lang.String subject, java.lang.String body, java.util.Map<java.lang.String,​java.lang.String> replace)
      Deprecated.
      Simple utility to send a mail to a given user account.
      boolean setPassword​(User user, java.lang.String key, java.lang.String pwd)
      Deprecated.
      Set the Password of the Account to a given password.
      void updateAccount​(User user, java.util.Map<java.lang.String,​RequestParameter[]> properties)
      Deprecated.
      Convenience update an Account with a set of properties with setting properties in one method call.
    • Method Detail

      • findAccount

        User findAccount​(java.lang.String fragment)
        Deprecated.

        findAccount.

        Parameters:
        fragment - of the id / name
        Returns:
        User or null if no User is related to the fragment
      • createAccount

        User createAccount​(java.lang.String uid,
                           java.lang.String pwd,
                           java.lang.String group,
                           java.util.Map<java.lang.String,​RequestParameter[]> properties)
                    throws javax.jcr.AccessDeniedException,
                           javax.jcr.RepositoryException
        Deprecated.
        Convenience to create a new User together with setting properties in one method call. Where the keys are the property names and the value the
        Parameters:
        uid - to create account for
        pwd - to set on the new user account
        group - to assign membership to the new group
        properties - to set
        Returns:
        User or null if no User is related to the fragment
        Throws:
        javax.jcr.RepositoryException - in case of error creating the user
        javax.jcr.AccessDeniedException - in case of missing privileges to create accounts
        See Also:
        UserManager.createUser(String, String, String, String)
      • updateAccount

        void updateAccount​(User user,
                           java.util.Map<java.lang.String,​RequestParameter[]> properties)
                    throws javax.jcr.RepositoryException
        Deprecated.
        Convenience update an Account with a set of properties with setting properties in one method call.
        Parameters:
        user - to update
        properties - to set
        Throws:
        javax.jcr.RepositoryException - in case of error updating the account
      • resetPassword

        java.lang.String resetPassword​(User user)
                                throws javax.jcr.AccessDeniedException,
                                       javax.jcr.RepositoryException
        Deprecated.
        Reset the Password of the Account to a randomly generated
        Parameters:
        user - to reset the password for
        Returns:
        the newly generated password
        Throws:
        javax.jcr.RepositoryException - in case of error creating the user
        javax.jcr.AccessDeniedException - in case of missing privileges to create accounts
      • resetPassword

        java.lang.String resetPassword​(User user,
                                       java.lang.String key)
                                throws javax.jcr.AccessDeniedException,
                                       javax.jcr.RepositoryException
        Deprecated.
        Reset the Password of the Account to a randomly generated, requires a key in order to verify, that the reset has been requested by the key owner. The key is the result of the call to request o password reset requestPasswordReset(User, URL)
        Parameters:
        user - to reset the password for
        key - required to reset the password
        Returns:
        the newly generated password or null on failure
        Throws:
        javax.jcr.RepositoryException - in case of error creating the user
        javax.jcr.AccessDeniedException - in case of missing privileges to create accounts
        See Also:
        requestPasswordReset(User, URL)
      • setPassword

        boolean setPassword​(User user,
                            java.lang.String key,
                            java.lang.String pwd)
                     throws javax.jcr.AccessDeniedException,
                            javax.jcr.RepositoryException
        Deprecated.
        Set the Password of the Account to a given password. Requires a key in order to verify, that the reset has been requested by the key owner. The key is the result of the call to request o password reset requestPasswordReset(User, URL)
        Parameters:
        user - to reset the password for
        key - required to set the password
        pwd - new password
        Returns:
        true on success, false on failure
        Throws:
        javax.jcr.RepositoryException - in case of error creating the user
        javax.jcr.AccessDeniedException - in case of missing privileges to create accounts
        See Also:
        requestPasswordReset(User, URL)
      • requestPasswordReset

        boolean requestPasswordReset​(User user,
                                     java.net.URL requestUrl)
                              throws javax.jcr.RepositoryException
        Deprecated.
        Request a password rest. Results in a key that has to be presented in order to finally set the Password to some new value.
        Parameters:
        user - to reset the password for
        requestUrl - the url called to request the reset
        Returns:
        a key that allows to reset the password
        Throws:
        javax.jcr.RepositoryException - in case of error creating the user
        javax.jcr.AccessDeniedException - in case of missing privileges to create accounts
        See Also:
        resetPassword(User, String)
      • requestAccount

        boolean requestAccount​(java.lang.String email,
                               java.net.URL requestUrl)
                        throws javax.jcr.RepositoryException
        Deprecated.
        Request for creating a new account. Results in a mail being sent to the requester which contains further information how to complete account generation.
        Parameters:
        email - email address of requester
        requestUrl - the url called to request the reset
        Returns:
        true if account request succeeded, false otherwise
        Throws:
        javax.jcr.RepositoryException - if any.
      • sendMail

        boolean sendMail​(User user,
                         java.lang.String from,
                         java.lang.String subject,
                         java.lang.String body,
                         java.util.Map<java.lang.String,​java.lang.String> replace)
                  throws javax.jcr.RepositoryException
        Deprecated.
        Simple utility to send a mail to a given user account. Adds the ability to replace variables within the mail body with properties from the User. This Properties can be addressed by using their name as variable name.
        Parameters:
        user - to receive the mail
        from - the from e-mail address
        subject - of the mail to send
        body - of the mail to send
        replace - map of replacements for variables, with variable name as key and value as value
        Returns:
        true if the mail could be send
        Throws:
        javax.jcr.RepositoryException - in case of error accessing the repository