i personally would prefer using regex instead of glob syntax, because other 
areas in sling use it as well for path matching (e.g. sling mapping).

about the performance implications where the filtering should take place i 
cannot say much currently.

stefan

>-----Original Message-----
>From: Radu Cotescu [mailto:r...@apache.org]
>Sent: Friday, July 15, 2016 3:24 PM
>To: Sling Dev
>Subject: [DISCUSS] Path filtering support for ResourceChangeListeners
>
>Hello,
>
>The current release of the Sling API
>org.apache.sling.api.resource.observation.ResourceChangeListener
>(org.apache.sling.api.resource.observation;version=1.0.0) specification
>does not provide any kind of support for path filtering or pattern
>matching. As I understand it, the future regarding Resource observation is
>to switch from registering OSGi EventHandlers to registering
>ResourceChangeListeners. If one concept replaces the other, then we need to
>find an acceptable solution for the filtering support that EventHandlers
>brought to the table [0][1].
>
>The implementation I proposed [2] relied on adding support for the Glob
>pattern matching provided by java.nio.file.PathMatcher (albeit I only
>thought of a sub-set of it). What syntax would you prefer and why? Do we
>need to support the full Glob syntax? Would a sub-set be enough? Do we want
>to also support RegEx? Should we actually filter everything directly in the
>ResourceChangeListener#onChange and not care about providing support for
>filtering in the service's configuration?
>
>Thanks,
>Radu
>
>[0] -
>https://osgi.org/javadoc/r6/cmpn/org/osgi/service/event/EventHandler.html
>[1] -
>https://osgi.org/javadoc/r6/cmpn/org/osgi/service/event/EventConstants.html
>#EVENT_FILTER
>[2] -
>https://github.com/apache/sling/commit/4264dc16205abab300d041d15524c6d996b9
>d40a

Reply via email to