Class PrincipalManagerImpl

java.lang.Object
org.apache.jackrabbit.oak.spi.security.principal.PrincipalManagerImpl
All Implemented Interfaces:
PrincipalManager, PrincipalQueryManager

public class PrincipalManagerImpl extends Object implements PrincipalQueryManager, PrincipalManager
Default implementation of the PrincipalManager interface.
  • Constructor Details

    • PrincipalManagerImpl

      public PrincipalManagerImpl(@NotNull @NotNull PrincipalProvider principalProvider)
  • Method Details

    • hasPrincipal

      public boolean hasPrincipal(@NotNull @NotNull String principalName)
      Description copied from interface: PrincipalManager
      Checks if the principal with the given name is known to this manager (in respect to the sessions access rights). If this method returns true then the following expression evaluates to true as well: PrincipalManager.getPrincipal(name).getName().equals(name)
      Specified by:
      hasPrincipal in interface PrincipalManager
      Parameters:
      principalName - the name of the principal to check
      Returns:
      return true if the principal with this name is known to this manager; false otherwise.
    • getPrincipal

      @Nullable public @Nullable Principal getPrincipal(@NotNull @NotNull String principalName)
      Description copied from interface: PrincipalManager
      Returns the principal with the given name if is known to this manager (with respect to the sessions access rights). Please note that due to security reasons group principals will only reveal those members that are visible to the Session this PrincipalManager has been built for.
      Specified by:
      getPrincipal in interface PrincipalManager
      Parameters:
      principalName - the name of the principal to retrieve
      Returns:
      return the requested principal or null if a principal with the given name does not exist or is not accessible for the editing session.
    • findPrincipals

      @NotNull public @NotNull PrincipalIterator findPrincipals(@Nullable @Nullable String simpleFilter)
      Description copied from interface: PrincipalManager
      Gets the principals matching a simple filter expression applied against the principal name. TODO: define the filter expression.
      An implementation may limit the number of principals returned. If there are no matching principals, an empty iterator is returned.
      Specified by:
      findPrincipals in interface PrincipalManager
      Returns:
      a PrincipalIterator over the Principals matching the given filter.
    • findPrincipals

      @NotNull public @NotNull PrincipalIterator findPrincipals(@Nullable @Nullable String simpleFilter, int searchType)
      Description copied from interface: PrincipalManager
      Gets the principals matching a simple filter expression applied against the principal name AND the specified search type. TODO: define the filter expression.
      An implementation may limit the number of principals returned. If there are no matching principals, an empty iterator is returned.
      Specified by:
      findPrincipals in interface PrincipalManager
      searchType - Any of the following constants:
      Returns:
      a PrincipalIterator over the Principals matching the given filter and search type.
    • getPrincipals

      @NotNull public @NotNull PrincipalIterator getPrincipals(int searchType)
      Description copied from interface: PrincipalManager
      Returns all Principals matching the specified search type.
      Specified by:
      getPrincipals in interface PrincipalManager
      Parameters:
      searchType - Any of the following constants:
      Returns:
      a PrincipalIterator over all the Principals matching the given search type.
    • getGroupMembership

      @NotNull public @NotNull PrincipalIterator getGroupMembership(@NotNull @NotNull Principal principal)
      Description copied from interface: PrincipalManager
      Returns an iterator over all group principals for which the given principal is either direct or indirect member of.

      Example:
      If Principal P is member of Group A, and Group A is member of Group B, this method will return Principal A and Principal B.

      Specified by:
      getGroupMembership in interface PrincipalManager
      Parameters:
      principal - the principal to return it's membership from.
      Returns:
      an iterator returning all groups the given principal is member of.
    • getEveryone

      @NotNull public @NotNull Principal getEveryone()
      Description copied from interface: PrincipalManager
      Returns the Principal which is implicitly applied to every subject.
      Specified by:
      getEveryone in interface PrincipalManager
      Returns:
      the 'everyone' principal
    • findPrincipals

      @NotNull public @NotNull PrincipalIterator findPrincipals(@Nullable @Nullable String simpleFilter, boolean fullText, int searchType, long offset, long limit)
      Description copied from interface: PrincipalQueryManager
      Gets the principals matching a simple filter expression applied against the principal name AND the specified search type. Results are expected to be sorted by the principal name. An implementation may limit the number of principals returned. If there are no matching principals, an empty iterator is returned.
      Specified by:
      findPrincipals in interface PrincipalQueryManager
      searchType - Any of the following constants:
      offset - Offset from where to start returning results. 0 for no offset.
      limit - Maximal number of results to return. -1 for no limit.
      Returns:
      a PrincipalIterator over the Principals matching the given filter and search type.