Class NodeObserver

  • All Implemented Interfaces:
    Observer

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

      • NodeObserver

        protected NodeObserver​(String path,
                               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 String path,
                                      @NotNull
                                      @NotNull Set<String> added,
                                      @NotNull
                                      @NotNull Set<String> deleted,
                                      @NotNull
                                      @NotNull Set<String> changed,
                                      @NotNull
                                      @NotNull Map<String,​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 String path,
                                        @NotNull
                                        @NotNull Set<String> added,
                                        @NotNull
                                        @NotNull Set<String> deleted,
                                        @NotNull
                                        @NotNull Set<String> changed,
                                        @NotNull
                                        @NotNull Map<String,​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 String path,
                                        @NotNull
                                        @NotNull Set<String> added,
                                        @NotNull
                                        @NotNull Set<String> deleted,
                                        @NotNull
                                        @NotNull Set<String> changed,
                                        @NotNull
                                        @NotNull Map<String,​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