Class PrincipalManagerImpl
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.principal.PrincipalManagerImpl
-
- All Implemented Interfaces:
PrincipalManager,PrincipalQueryManager
public class PrincipalManagerImpl extends java.lang.Object implements PrincipalQueryManager, PrincipalManager
Default implementation of thePrincipalManagerinterface.
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.api.security.principal.PrincipalManager
SEARCH_TYPE_ALL, SEARCH_TYPE_GROUP, SEARCH_TYPE_NOT_GROUP
-
-
Constructor Summary
Constructors Constructor Description PrincipalManagerImpl(@NotNull PrincipalProvider principalProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull PrincipalIteratorfindPrincipals(@Nullable java.lang.String simpleFilter)Gets the principals matching a simple filter expression applied against theprincipal name.@NotNull PrincipalIteratorfindPrincipals(@Nullable java.lang.String simpleFilter, boolean fullText, int searchType, long offset, long limit)Gets the principals matching a simple filter expression applied against theprincipal nameAND the specified search type.@NotNull PrincipalIteratorfindPrincipals(@Nullable java.lang.String simpleFilter, int searchType)Gets the principals matching a simple filter expression applied against theprincipal nameAND the specified search type.@NotNull java.security.PrincipalgetEveryone()Returns thePrincipalwhich is implicitly applied to every subject.@NotNull PrincipalIteratorgetGroupMembership(@NotNull java.security.Principal principal)Returns an iterator over all group principals for which the given principal is either direct or indirect member of.@Nullable java.security.PrincipalgetPrincipal(@NotNull java.lang.String principalName)Returns the principal with the given name if is known to this manager (with respect to the sessions access rights).@NotNull PrincipalIteratorgetPrincipals(int searchType)Returns allPrincipals matching the specified search type.booleanhasPrincipal(@NotNull java.lang.String principalName)Checks if the principal with the given name is known to this manager (in respect to the sessions access rights).
-
-
-
Constructor Detail
-
PrincipalManagerImpl
public PrincipalManagerImpl(@NotNull @NotNull PrincipalProvider principalProvider)
-
-
Method Detail
-
hasPrincipal
public boolean hasPrincipal(@NotNull @NotNull java.lang.String principalName)Description copied from interface:PrincipalManagerChecks if the principal with the given name is known to this manager (in respect to the sessions access rights). If this method returnstruethen the following expression evaluates totrueas well:PrincipalManager.getPrincipal(name).getName().equals(name)- Specified by:
hasPrincipalin interfacePrincipalManager- Parameters:
principalName- the name of the principal to check- Returns:
- return
trueif the principal with this name is known to this manager;falseotherwise.
-
getPrincipal
@Nullable public @Nullable java.security.Principal getPrincipal(@NotNull @NotNull java.lang.String principalName)Description copied from interface:PrincipalManagerReturns 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 thisPrincipalManagerhas been built for.- Specified by:
getPrincipalin interfacePrincipalManager- Parameters:
principalName- the name of the principal to retrieve- Returns:
- return the requested principal or
nullif 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 java.lang.String simpleFilter)
Description copied from interface:PrincipalManagerGets the principals matching a simple filter expression applied against theprincipal 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:
findPrincipalsin interfacePrincipalManager- Returns:
- a
PrincipalIteratorover thePrincipals matching the given filter.
-
findPrincipals
@NotNull public @NotNull PrincipalIterator findPrincipals(@Nullable @Nullable java.lang.String simpleFilter, int searchType)
Description copied from interface:PrincipalManagerGets the principals matching a simple filter expression applied against theprincipal nameAND 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:
findPrincipalsin interfacePrincipalManagersearchType- Any of the following constants:- Returns:
- a
PrincipalIteratorover thePrincipals matching the given filter and search type.
-
getPrincipals
@NotNull public @NotNull PrincipalIterator getPrincipals(int searchType)
Description copied from interface:PrincipalManagerReturns allPrincipals matching the specified search type.- Specified by:
getPrincipalsin interfacePrincipalManager- Parameters:
searchType- Any of the following constants:- Returns:
- a
PrincipalIteratorover all thePrincipals matching the given search type.
-
getGroupMembership
@NotNull public @NotNull PrincipalIterator getGroupMembership(@NotNull @NotNull java.security.Principal principal)
Description copied from interface:PrincipalManagerReturns 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:
getGroupMembershipin interfacePrincipalManager- 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 java.security.Principal getEveryone()
Description copied from interface:PrincipalManagerReturns thePrincipalwhich is implicitly applied to every subject.- Specified by:
getEveryonein interfacePrincipalManager- Returns:
- the 'everyone' principal
-
findPrincipals
@NotNull public @NotNull PrincipalIterator findPrincipals(@Nullable @Nullable java.lang.String simpleFilter, boolean fullText, int searchType, long offset, long limit)
Description copied from interface:PrincipalQueryManagerGets the principals matching a simple filter expression applied against theprincipal nameAND 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:
findPrincipalsin interfacePrincipalQueryManagersearchType- Any of the following constants:offset- Offset from where to start returning results.0for no offset.limit- Maximal number of results to return. -1 for no limit.- Returns:
- a
PrincipalIteratorover thePrincipals matching the given filter and search type.
-
-