Class AutoSaveEnabledManager

  • All Implemented Interfaces:
    org.apache.jackrabbit.api.security.user.UserManager

    public class AutoSaveEnabledManager
    extends Object
    implements org.apache.jackrabbit.api.security.user.UserManager
    Implementation of the user management that allows to set the autosave flag. Since OAK does no longer support the auto-save flag out of the box and this part of the user management is targeted for deprecation, this UserManager implementation should only be used for those cases where strict backwards compatibility is really required.

    In general any consumer of the Jackrabbit user management API should stick to the API contract and verify that the autosave flag is enabled before relying on the implementation to have it turned on:

         JackrabbitSession session = ...;
         UserManager userManager = session.getUserManager();
    
         // modify some user related content
    
         if (!userManager#isAutosave()) {
             session.save();
         }
     
    • Constructor Detail

      • AutoSaveEnabledManager

        public AutoSaveEnabledManager​(org.apache.jackrabbit.api.security.user.UserManager dlg,
                                      org.apache.jackrabbit.oak.api.Root root)
    • Method Detail

      • getAuthorizable

        @Nullable
        public @Nullable org.apache.jackrabbit.api.security.user.Authorizable getAuthorizable​(@NotNull
                                                                                              @NotNull String id)
                                                                                       throws javax.jcr.RepositoryException
        Specified by:
        getAuthorizable in interface org.apache.jackrabbit.api.security.user.UserManager
        Throws:
        javax.jcr.RepositoryException
      • getAuthorizable

        @Nullable
        public <T extends org.apache.jackrabbit.api.security.user.Authorizable> T getAuthorizable​(@NotNull
                                                                                                  @NotNull String id,
                                                                                                  @NotNull
                                                                                                  @NotNull Class<T> authorizableClass)
                                                                                           throws javax.jcr.RepositoryException
        Specified by:
        getAuthorizable in interface org.apache.jackrabbit.api.security.user.UserManager
        Throws:
        javax.jcr.RepositoryException
      • getAuthorizable

        @Nullable
        public @Nullable org.apache.jackrabbit.api.security.user.Authorizable getAuthorizable​(@NotNull
                                                                                              @NotNull Principal principal)
                                                                                       throws javax.jcr.RepositoryException
        Specified by:
        getAuthorizable in interface org.apache.jackrabbit.api.security.user.UserManager
        Throws:
        javax.jcr.RepositoryException
      • getAuthorizableByPath

        @Nullable
        public @Nullable org.apache.jackrabbit.api.security.user.Authorizable getAuthorizableByPath​(@NotNull
                                                                                                    @NotNull String path)
                                                                                             throws javax.jcr.RepositoryException
        Specified by:
        getAuthorizableByPath in interface org.apache.jackrabbit.api.security.user.UserManager
        Throws:
        javax.jcr.RepositoryException
      • findAuthorizables

        @NotNull
        public @NotNull Iterator<org.apache.jackrabbit.api.security.user.Authorizable> findAuthorizables​(@NotNull
                                                                                                         @NotNull String relPath,
                                                                                                         @Nullable
                                                                                                         @Nullable String value)
                                                                                                  throws javax.jcr.RepositoryException
        Specified by:
        findAuthorizables in interface org.apache.jackrabbit.api.security.user.UserManager
        Throws:
        javax.jcr.RepositoryException
      • findAuthorizables

        @NotNull
        public @NotNull Iterator<org.apache.jackrabbit.api.security.user.Authorizable> findAuthorizables​(@NotNull
                                                                                                         @NotNull String relPath,
                                                                                                         @Nullable
                                                                                                         @Nullable String value,
                                                                                                         int searchType)
                                                                                                  throws javax.jcr.RepositoryException
        Specified by:
        findAuthorizables in interface org.apache.jackrabbit.api.security.user.UserManager
        Throws:
        javax.jcr.RepositoryException
      • findAuthorizables

        @NotNull
        public @NotNull Iterator<org.apache.jackrabbit.api.security.user.Authorizable> findAuthorizables​(@NotNull
                                                                                                         @NotNull org.apache.jackrabbit.api.security.user.Query query)
                                                                                                  throws javax.jcr.RepositoryException
        Specified by:
        findAuthorizables in interface org.apache.jackrabbit.api.security.user.UserManager
        Throws:
        javax.jcr.RepositoryException
      • createUser

        @NotNull
        public @NotNull org.apache.jackrabbit.api.security.user.User createUser​(@NotNull
                                                                                @NotNull String userID,
                                                                                @Nullable
                                                                                @Nullable String password)
                                                                         throws javax.jcr.RepositoryException
        Specified by:
        createUser in interface org.apache.jackrabbit.api.security.user.UserManager
        Throws:
        javax.jcr.RepositoryException
      • createUser

        @NotNull
        public @NotNull org.apache.jackrabbit.api.security.user.User createUser​(@NotNull
                                                                                @NotNull String userID,
                                                                                @Nullable
                                                                                @Nullable String password,
                                                                                @NotNull
                                                                                @NotNull Principal principal,
                                                                                @Nullable
                                                                                @Nullable String intermediatePath)
                                                                         throws javax.jcr.RepositoryException
        Specified by:
        createUser in interface org.apache.jackrabbit.api.security.user.UserManager
        Throws:
        javax.jcr.RepositoryException
      • createSystemUser

        @NotNull
        public @NotNull org.apache.jackrabbit.api.security.user.User createSystemUser​(@NotNull
                                                                                      @NotNull String userID,
                                                                                      @Nullable
                                                                                      @Nullable String intermediatePath)
                                                                               throws javax.jcr.RepositoryException
        Specified by:
        createSystemUser in interface org.apache.jackrabbit.api.security.user.UserManager
        Throws:
        javax.jcr.RepositoryException
      • createGroup

        @NotNull
        public @NotNull org.apache.jackrabbit.api.security.user.Group createGroup​(@NotNull
                                                                                  @NotNull String groupId)
                                                                           throws javax.jcr.RepositoryException
        Specified by:
        createGroup in interface org.apache.jackrabbit.api.security.user.UserManager
        Throws:
        javax.jcr.RepositoryException
      • createGroup

        @NotNull
        public @NotNull org.apache.jackrabbit.api.security.user.Group createGroup​(@NotNull
                                                                                  @NotNull Principal principal)
                                                                           throws javax.jcr.RepositoryException
        Specified by:
        createGroup in interface org.apache.jackrabbit.api.security.user.UserManager
        Throws:
        javax.jcr.RepositoryException
      • createGroup

        @NotNull
        public @NotNull org.apache.jackrabbit.api.security.user.Group createGroup​(@NotNull
                                                                                  @NotNull Principal principal,
                                                                                  @Nullable
                                                                                  @Nullable String intermediatePath)
                                                                           throws javax.jcr.RepositoryException
        Specified by:
        createGroup in interface org.apache.jackrabbit.api.security.user.UserManager
        Throws:
        javax.jcr.RepositoryException
      • createGroup

        @NotNull
        public @NotNull org.apache.jackrabbit.api.security.user.Group createGroup​(@NotNull
                                                                                  @NotNull String groupID,
                                                                                  @NotNull
                                                                                  @NotNull Principal principal,
                                                                                  @Nullable
                                                                                  @Nullable String intermediatePath)
                                                                           throws javax.jcr.RepositoryException
        Specified by:
        createGroup in interface org.apache.jackrabbit.api.security.user.UserManager
        Throws:
        javax.jcr.RepositoryException
      • isAutoSave

        public boolean isAutoSave()
        Specified by:
        isAutoSave in interface org.apache.jackrabbit.api.security.user.UserManager
      • autoSave

        public void autoSave​(boolean enable)
        Specified by:
        autoSave in interface org.apache.jackrabbit.api.security.user.UserManager