Author: cziegeler
Date: Mon Jun 15 09:25:58 2015
New Revision: 1685520

URL: http://svn.apache.org/r1685520
Log:
SLING-4751 : New observation API: Provide a way to optimize providers reporting 
changes

Added:
    
sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ObserverConfiguration.java
   (with props)
Modified:
    
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java
    
sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ObservationReporter.java

Modified: 
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java?rev=1685520&r1=1685519&r2=1685520&view=diff
==============================================================================
--- 
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java
 (original)
+++ 
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java
 Mon Jun 15 09:25:58 2015
@@ -45,6 +45,8 @@ import aQute.bnd.annotation.ConsumerType
  * caused by changes persisted on the same instance as this listener is 
registered.
  * If the resource listener is interested in external events, the 
implementation
  * should implement the {@link ExternalResourceListener} interface.
+ *
+ * TODO - how to register for current search paths?
  */
 @ConsumerType
 public interface ResourceListener {

Modified: 
sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ObservationReporter.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ObservationReporter.java?rev=1685520&r1=1685519&r2=1685520&view=diff
==============================================================================
--- 
sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ObservationReporter.java
 (original)
+++ 
sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ObservationReporter.java
 Mon Jun 15 09:25:58 2015
@@ -35,6 +35,13 @@ import aQute.bnd.annotation.ProviderType
 public interface ObservationReporter {
 
     /**
+     * Get the list of observer configurations affecting the provider this
+     * reporter is bound to.
+     * @return A list of observer configurations, the list might be empty.
+     */
+    @Nonnull List<ObserverConfiguration> getObserverConfigurations();
+
+    /**
      * A resource provider can inform about a list of changes.
      * If the resource provider is not able to report external events on other 
instances,
      * it should set the distribute flag. In this case the resource resolver 
implementation

Added: 
sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ObserverConfiguration.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ObserverConfiguration.java?rev=1685520&view=auto
==============================================================================
--- 
sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ObserverConfiguration.java
 (added)
+++ 
sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ObserverConfiguration.java
 Mon Jun 15 09:25:58 2015
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.spi.resource.provider;
+
+import org.apache.sling.api.resource.observation.ResourceChange;
+
+import aQute.bnd.annotation.ProviderType;
+
+/**
+ * A observer configuration descibes active configurations from registered 
listeners.
+ */
+@ProviderType
+public interface ObserverConfiguration {
+
+    boolean isExternal();
+
+    String[] getPaths();
+
+    String[] getExcludedPaths();
+
+    ResourceChange.ChangeType[] getChangeTypes();
+}

Propchange: 
sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ObserverConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ObserverConfiguration.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url


Reply via email to