Class NodeObserver

  • All Implemented Interfaces:
    Observer

    public abstract class NodeObserver
    extends java.lang.Object
    implements Observer
    Base class for Observer instances that group changes by node instead of tracking them down to individual properties.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected NodeObserver​(java.lang.String path, java.lang.String... propertyNames)
      Create a new instance for observing the given path.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void added​(@NotNull java.lang.String path, @NotNull java.util.Set<java.lang.String> added, @NotNull java.util.Set<java.lang.String> deleted, @NotNull java.util.Set<java.lang.String> changed, @NotNull java.util.Map<java.lang.String,​java.lang.String> properties, @NotNull CommitInfo commitInfo)
      A node at path has been added.
      protected abstract void changed​(@NotNull java.lang.String path, @NotNull java.util.Set<java.lang.String> added, @NotNull java.util.Set<java.lang.String> deleted, @NotNull java.util.Set<java.lang.String> changed, @NotNull java.util.Map<java.lang.String,​java.lang.String> properties, @NotNull CommitInfo commitInfo)
      A node at path has been changed.
      void contentChanged​(@NotNull NodeState root, @NotNull CommitInfo info)
      Observes a content change.
      protected abstract void deleted​(@NotNull java.lang.String path, @NotNull java.util.Set<java.lang.String> added, @NotNull java.util.Set<java.lang.String> deleted, @NotNull java.util.Set<java.lang.String> changed, @NotNull java.util.Map<java.lang.String,​java.lang.String> properties, @NotNull CommitInfo commitInfo)
      A node at path has been deleted.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NodeObserver

        protected NodeObserver​(java.lang.String path,
                               java.lang.String... propertyNames)
        Create a new instance for observing the given path.
        Parameters:
        path -
        propertyNames - names of properties to report even without a change
    • Method Detail

      • added

        protected abstract void added​(@NotNull
                                      @NotNull java.lang.String path,
                                      @NotNull
                                      @NotNull java.util.Set<java.lang.String> added,
                                      @NotNull
                                      @NotNull java.util.Set<java.lang.String> deleted,
                                      @NotNull
                                      @NotNull java.util.Set<java.lang.String> changed,
                                      @NotNull
                                      @NotNull java.util.Map<java.lang.String,​java.lang.String> properties,
                                      @NotNull
                                      @NotNull CommitInfo commitInfo)
        A node at path has been added.
        Parameters:
        path - Path of the added node.
        added - Names of the added properties.
        deleted - Names of the deleted properties.
        changed - Names of the changed properties.
        properties - Properties as specified in the constructor
        commitInfo - commit info associated with this change.
      • deleted

        protected abstract void deleted​(@NotNull
                                        @NotNull java.lang.String path,
                                        @NotNull
                                        @NotNull java.util.Set<java.lang.String> added,
                                        @NotNull
                                        @NotNull java.util.Set<java.lang.String> deleted,
                                        @NotNull
                                        @NotNull java.util.Set<java.lang.String> changed,
                                        @NotNull
                                        @NotNull java.util.Map<java.lang.String,​java.lang.String> properties,
                                        @NotNull
                                        @NotNull CommitInfo commitInfo)
        A node at path has been deleted.
        Parameters:
        path - Path of the deleted node.
        added - Names of the added properties.
        deleted - Names of the deleted properties.
        changed - Names of the changed properties.
        properties - Properties as specified in the constructor
        commitInfo - commit info associated with this change.
      • changed

        protected abstract void changed​(@NotNull
                                        @NotNull java.lang.String path,
                                        @NotNull
                                        @NotNull java.util.Set<java.lang.String> added,
                                        @NotNull
                                        @NotNull java.util.Set<java.lang.String> deleted,
                                        @NotNull
                                        @NotNull java.util.Set<java.lang.String> changed,
                                        @NotNull
                                        @NotNull java.util.Map<java.lang.String,​java.lang.String> properties,
                                        @NotNull
                                        @NotNull CommitInfo commitInfo)
        A node at path has been changed.
        Parameters:
        path - Path of the changed node.
        added - Names of the added properties.
        deleted - Names of the deleted properties.
        changed - Names of the changed properties.
        properties - Properties as specified in the constructor
        commitInfo - commit info associated with this change.
      • contentChanged

        public void contentChanged​(@NotNull
                                   @NotNull NodeState root,
                                   @NotNull
                                   @NotNull CommitInfo info)
        Description copied from interface: Observer
        Observes a content change. See the Observer class javadocs and relevant repository and observer registration details for more information on when and how this method gets called.
        Specified by:
        contentChanged in interface Observer
        Parameters:
        root - root state of the repository
        info - commit information