Interface UserManager


  • public interface UserManager
    Deprecated.
    cq 5.5 Use org.apache.jackrabbit.api.security.user.UserManager instead.
    UserManager allows access to Users and Groups. These are the Objects that act on Resources. They are referred to by the common super-class 'Authorizable'.
    Basic search and creation means are provided.
    The UserManager for a Session can be accessed by use of UserManagerFactory

    NOTE: This does not go to the osg.services.UserManger, as it is not existing now...additionly to me its relation to Authentication outside Sling is not clear enough.

    See Also:
    Authorizable, UserManagerFactory
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int TYPE_GROUP
      Deprecated.
       
      static int TYPE_USER
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean autoSave​(boolean enable)
      Deprecated.
      Changes the auto save behavior of this UserManager.
      Group createGroup​(java.lang.String groupId, java.lang.String principalName)
      Deprecated.
      Creates a new Group for the given name and Principal-Name
      Group createGroup​(java.lang.String groupId, java.lang.String principalName, java.lang.String intermediatePath)
      Deprecated.
      Creates a new Group for the given name and Principal-Name
      User createUser​(java.lang.String userId, java.lang.String password, java.lang.String principalName)
      Deprecated.
      Creates a new User for given Id, password and PrincipalName.
      User createUser​(java.lang.String userId, java.lang.String password, java.lang.String principalName, java.lang.String intermediatePath)
      Deprecated.
      Creates a new User for given Id, password and PrincipalName.
      <AuthType extends Authorizable>
      RangeIterator<AuthType>
      find​(java.lang.String query, java.lang.Class<AuthType> type)
      Deprecated.
      Search for Authorizables that contain the given Query.
      java.util.Iterator<Authorizable> find​(java.lang.String propertyName, java.lang.String substring)
      Deprecated.
      Search for an Authorizable that contains the given query as a value of the given property.
      The value doesn't have to match exactly.
      Authorizable find​(java.security.Principal principal)
      Deprecated.
      Searches for an Authorizable for the given Principal.
      Authorizable findByHome​(java.lang.String homePath)
      Deprecated.
      Searches an Authorizable which has the given path as Path of it's Home Path property.
      Authorizable get​(java.lang.String id)
      Deprecated.
      Accesses an Authorizable by its ID.
      java.util.Iterator<Group> getGroups()
      Deprecated.
       
      java.util.Iterator<User> getUsers()
      Deprecated.
       
      boolean hasAuthorizable​(java.lang.String id)
      Deprecated.
      This method tests if the Manager has any Authorizable with this given ID.
      If this method evaluates to true a call to get(id) has to return a non-null Authorizable
      boolean isAutoSave()
      Deprecated.
      If any write operations executed through the User API are automatically persisted this method returns true.
    • Method Detail

      • hasAuthorizable

        boolean hasAuthorizable​(java.lang.String id)
        Deprecated.
        This method tests if the Manager has any Authorizable with this given ID.
        If this method evaluates to true a call to get(id) has to return a non-null Authorizable
        Parameters:
        id - to be probed
        Returns:
        true if an Authorizable with the given id exists
        See Also:
        get(String)
      • find

        Authorizable find​(java.security.Principal principal)
        Deprecated.
        Searches for an Authorizable for the given Principal.
        Parameters:
        principal - the Authorizable should contain
        Returns:
        the Authorizable or null if none found
        See Also:
        Authorizable.getPrincipal()
      • find

        java.util.Iterator<Authorizable> find​(java.lang.String propertyName,
                                              java.lang.String substring)
        Deprecated.
        Search for an Authorizable that contains the given query as a value of the given property.
        The value doesn't have to match exactly. Property names of Property to be searched. The Authorizable defines default properties, implementations may extend these
        Parameters:
        propertyName - to be searched in
        substring - to be found
        Returns:
        Iterator of hits, empty if no Authorizable matches
      • getUsers

        java.util.Iterator<User> getUsers()
        Deprecated.
        Returns:
        all Users this Manager knows. Should be used with care, may be time-consuming
      • getGroups

        java.util.Iterator<Group> getGroups()
        Deprecated.
        Returns:
        all Groups this Manager knows.Should be used with care, may be time-consuming
      • createUser

        User createUser​(java.lang.String userId,
                        java.lang.String password,
                        java.lang.String principalName)
                 throws AuthorizableExistsException,
                        AccessDeniedException
        Deprecated.
        Creates a new User for given Id, password and PrincipalName.
        Parameters:
        userId - Id for the User
        password - plain password, implementations may encrypt
        principalName - principalName to be used when authenticated
        Returns:
        the newly created User
        Throws:
        AuthorizableExistsException - in case the ID is already in use
        AccessDeniedException - in case the requesting session is not allowed to create a User
      • createUser

        User createUser​(java.lang.String userId,
                        java.lang.String password,
                        java.lang.String principalName,
                        java.lang.String intermediatePath)
                 throws AuthorizableExistsException,
                        AccessDeniedException
        Deprecated.
        Creates a new User for given Id, password and PrincipalName.
        Parameters:
        userId - Id for the User
        password - plain password, implementations may encrypt
        principalName - principalName to be used when authenticated
        intermediatePath -
        Returns:
        the newly created User
        Throws:
        AuthorizableExistsException - in case the ID is already in use
        AccessDeniedException - in case the requesting session is not allowed to create a User
      • createGroup

        Group createGroup​(java.lang.String groupId,
                          java.lang.String principalName,
                          java.lang.String intermediatePath)
                   throws AuthorizableExistsException,
                          AccessDeniedException
        Deprecated.
        Creates a new Group for the given name and Principal-Name
        Parameters:
        groupId - to be assigned to the new Group
        principalName - for the new Group
        intermediatePath -
        Returns:
        newly created Group
        Throws:
        AuthorizableExistsException - if the id is already in use
        AccessDeniedException - in case the requesting session is not allowed to create a Group
      • find

        <AuthType extends AuthorizableRangeIterator<AuthType> find​(java.lang.String query,
                                                                     java.lang.Class<AuthType> type)
        Deprecated.
        Search for Authorizables that contain the given Query. Searches typical ID-Properties, like authorizable ID, principal name.
        Parameters:
        query - token to find
        type - Class of Authorizable to take Authorizable to search for any kind
        Returns:
        that match the query
      • findByHome

        Authorizable findByHome​(java.lang.String homePath)
        Deprecated.
        Searches an Authorizable which has the given path as Path of it's Home Path property. Thus that findByHomepath(homePath).getHomePath().equals(homePath)
        Parameters:
        homePath - path of the Authorizable's Home
        Returns:
        the Authorizable or null
        See Also:
        Authorizable.getHomePath()
      • isAutoSave

        boolean isAutoSave()
        Deprecated.
        If any write operations executed through the User API are automatically persisted this method returns true. In this case there are no pending transient changes left and there is no need to explicitly call Session.save(). If this method returns false any changes must be completed by an extra save call on the Session associated with this UserManager.
        Returns:
        true if changes are automatically persisted; false if changes made through this API (including method calls on Authorizable and subclasses are only transient and must be persisted using Session.save().
        See Also:
        autoSave(boolean)
      • autoSave

        boolean autoSave​(boolean enable)
        Deprecated.
        Changes the auto save behavior of this UserManager.
        Parameters:
        enable - If true changes made through this API will be automatically saved
        Returns:
        true if the autoSave mode was successfully changed.