Class AutoSave


  • public class AutoSave
    extends Object
    AutoSave...
    • Constructor Detail

      • AutoSave

        public AutoSave()
      • AutoSave

        public AutoSave​(int threshold)
    • Method Detail

      • setTracker

        public void setTracker​(@Nullable
                               @Nullable ProgressTracker tracker)
      • isDryRun

        public boolean isDryRun()
      • setDryRun

        public void setDryRun​(boolean dryRun)
      • setDebugFailEach

        public void setDebugFailEach​(int debugFailEach)
        Debug settings to allows to produce failures after each debugFailEach save.
        Parameters:
        debugFailEach - cardinal indicating when to fail
      • needsSave

        public boolean needsSave()
        Returns true if more than getThreshold() nodes are modified.
        Returns:
        true if threshold reached.
      • save

        public void save​(@Nullable
                         @Nullable Session session,
                         boolean isIntermediate)
                  throws RepositoryException
        Saves the changes under the given node and resets the counter.
        Parameters:
        session - the session to save. can be null
        isIntermediate - false when this is the final attempt, otherwise true.
        Throws:
        RepositoryException - if an error occurs.
      • getThreshold

        public int getThreshold()
        Returns the threshold
        Returns:
        the threshold
      • setThreshold

        public void setThreshold​(int threshold)
        Sets the threshold
        Parameters:
        threshold - the threshold
      • modified

        public boolean modified​(int num)
        Adds num modified
        Parameters:
        num - number of modified
        Returns:
        true if threshold is reached
      • markMissing

        @Deprecated
        public void markMissing​(@NotNull
                                @NotNull String path)
        Deprecated.
        As not working reliably it is simply ignored.
        Parameters:
        path -
      • markResolved

        @Deprecated
        public void markResolved​(@NotNull
                                 @NotNull String path)
        Deprecated.
        As not working reliably it is simply ignored.
        Parameters:
        path -