Interface ObserverConfiguration


  • @ProviderType
    public interface ObserverConfiguration
    A observer configuration describes active configurations from registered listeners. All implementations of ObserverConfiguration are comparable using the Object.equals(Object) method. Two configurations are equal, if they have exactly the same parameters. A resource provider implementation observation must support sending remove events as explained in ResourceChangeListener. If an observer configuration contains a pattern or is limited to a sub tree, removal events not matching the pattern or removing events of parents of that sub tree must be provided to the listener nevertheless - if the listener is interested in resource remove events.
    Since:
    1.0.0 (Sling API Bundle 2.11.0)
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      @NotNull java.util.Set<ResourceChange.ChangeType> getChangeTypes()
      The set of types listeners are interested in.
      @NotNull PathSet getExcludedPaths()
      The set of excluded paths.
      @NotNull PathSet getPaths()
      The set of paths this listener is interested in.
      @NotNull java.util.Set<java.lang.String> getPropertyNamesHint()
      Set containing the set of property names which serves as an optional hint for the underlying to only report property changes enlisted, ie the underlying might ignore this.
      boolean includeExternal()
      true if a listener is interested in external events.
      boolean matches​(java.lang.String path)
      Checks whether a path matches one of the paths of this configuration but is not in the excluded paths set.
    • Method Detail

      • includeExternal

        boolean includeExternal()
        true if a listener is interested in external events.
        Returns:
        true if a listener is interested in external events.
      • getPaths

        @NotNull
        @NotNull PathSet getPaths()
        The set of paths this listener is interested in. Each entry is absolute.
        Returns:
        Non empty set of paths
      • getExcludedPaths

        @NotNull
        @NotNull PathSet getExcludedPaths()
        The set of excluded paths. All the paths are sub paths from one entry of getPaths()
        Returns:
        A set of excluded paths, might be empty.
      • getChangeTypes

        @NotNull
        @NotNull java.util.Set<ResourceChange.ChangeType> getChangeTypes()
        The set of types listeners are interested in.
        Returns:
        Non empty set of types
      • getPropertyNamesHint

        @NotNull
        @NotNull java.util.Set<java.lang.String> getPropertyNamesHint()
        Set containing the set of property names which serves as an optional hint for the underlying to only report property changes enlisted, ie the underlying might ignore this.
        Returns:
        Set containing the set of property names or null
      • matches

        boolean matches​(java.lang.String path)
        Checks whether a path matches one of the paths of this configuration but is not in the excluded paths set.
        Parameters:
        path - The path to check
        Returns:
        true if the path matches the configuration.