Author: cziegeler Date: Thu Oct 13 08:58:21 2016 New Revision: 1764630 URL: http://svn.apache.org/viewvc?rev=1764630&view=rev Log: SLING-6056 : achieve 1:1 mapping between observation and resource change listener
Modified: sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ObservationReporter.java sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/package-info.java 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=1764630&r1=1764629&r2=1764630&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 Thu Oct 13 08:58:21 2016 @@ -23,7 +23,6 @@ import java.util.List; import javax.annotation.Nonnull; import org.apache.sling.api.resource.observation.ResourceChange; - import org.osgi.annotation.versioning.ProviderType; /** @@ -52,8 +51,37 @@ public interface ObservationReporter { * Due to performance reasons, the observation reporter might not verify if the * reported change matches the observer configurations. * + * If the resource provider part which is reporting the changes is using just a single + * mechanism reporting changes, this method must be used to report changes across + * all observer configurations. However, if the implementation is using a mechanism + * per observation configuration {@link #reportChanges(ObserverConfiguration, Iterable, boolean)} + * must be used instead. + * * @param changes The list of changes. * @param distribute Whether the changes should be distributed to other instances. */ void reportChanges(@Nonnull Iterable<ResourceChange> changes, boolean distribute); + + /** + * 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 + * will distribute the events to all other instances. + * + * Due to performance reasons, the observation reporter might not verify if the + * reported change matches the observer configurations. + * + * If the resource provider part which is reporting the changes is using just a single + * mechanism reporting changes, {@link #reportChanges(Iterable, boolean)} must be used to + * report changes across all observer configurations. However, if the implementation is + * using a mechanism per observation configuration this method must be used instead. + * + * @param config The configuration the change belongs to + * @param changes The list of changes. + * @param distribute Whether the changes should be distributed to other instances. + * @since 1.1.0 (Sling API Bundle 2.15.0) + */ + void reportChanges(@Nonnull ObserverConfiguration config, + @Nonnull Iterable<ResourceChange> changes, + boolean distribute); } Modified: sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/package-info.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/package-info.java?rev=1764630&r1=1764629&r2=1764630&view=diff ============================================================================== --- sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/package-info.java (original) +++ sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/package-info.java Thu Oct 13 08:58:21 2016 @@ -17,7 +17,7 @@ * under the License. */ -@Version("1.0.2") +@Version("1.1.0") package org.apache.sling.spi.resource.provider; import org.osgi.annotation.versioning.Version;