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:
  • Field Summary

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

    Modifier and Type
    Method
    Description
    boolean
    autoSave(boolean enable)
    Deprecated.
    Changes the auto save behavior of this UserManager.
    createGroup(String groupId, String principalName)
    Deprecated.
    Creates a new Group for the given name and Principal-Name
    createGroup(String groupId, String principalName, String intermediatePath)
    Deprecated.
    Creates a new Group for the given name and Principal-Name
    createUser(String userId, String password, String principalName)
    Deprecated.
    Creates a new User for given Id, password and PrincipalName.
    createUser(String userId, String password, String principalName, String intermediatePath)
    Deprecated.
    Creates a new User for given Id, password and PrincipalName.
    <AuthType extends Authorizable>
    RangeIterator<AuthType>
    find(String query, Class<AuthType> type)
    Deprecated.
    Search for Authorizables that contain the given Query.
    find(String propertyName, 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.
    find(Principal principal)
    Deprecated.
    Searches for an Authorizable for the given Principal.
    findByHome(String homePath)
    Deprecated.
    Searches an Authorizable which has the given path as Path of it's Home Path property.
    get(String id)
    Deprecated.
    Accesses an Authorizable by its ID.
    Deprecated.
     
    Deprecated.
     
    boolean
    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
    Deprecated.
    If any write operations executed through the User API are automatically persisted this method returns true.
  • Field Details

  • Method Details

    • hasAuthorizable

      boolean hasAuthorizable(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

      Deprecated.
      Accesses an Authorizable by its ID. if an Authorizable exists a test with hasAuthorizable(id) has to be true.
      Parameters:
      id - of the Authorizable requested
      Returns:
      the requests Authorizable
      Throws:
      NoSuchAuthorizableException - in case no Authorizable for that ID exists
    • find

      Authorizable find(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:
    • find

      Iterator<Authorizable> find(String propertyName, 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

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

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

      User createUser(String userId, String password, 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(String userId, String password, String principalName, 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(String groupId, String principalName) 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
      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
    • createGroup

      Group createGroup(String groupId, String principalName, 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 Authorizable> RangeIterator<AuthType> find(String query, 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(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:
    • 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 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.