Class AutoSave


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

      • AutoSave

        public AutoSave()
      • AutoSave

        public AutoSave​(int threshold)
    • Method Detail

      • setTracker

        public void setTracker​(@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
                         Session session)
                  throws RepositoryException
        saves the changes under the given node and resets the counter
        Parameters:
        session - the session to save. can be null
        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

        public void markMissing​(@Nonnull
                                java.lang.String path)
      • markResolved

        public void markResolved​(@Nonnull
                                 java.lang.String path)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object