You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2015/05/11 15:16:03 UTC

svn commit: r1678749 - in /sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource: observation/ provider/ query/

Author: cziegeler
Date: Mon May 11 13:16:02 2015
New Revision: 1678749

URL: http://svn.apache.org/r1678749
Log:
Update observation api

Added:
    sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/UserAwareResourceListener.java   (with props)
    sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationReporter.java
      - copied, changed from r1677831, sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationHandler.java
Removed:
    sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationHandler.java
Modified:
    sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceChange.java
    sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java
    sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/package-info.java
    sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryManager.java

Modified: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceChange.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceChange.java?rev=1678749&r1=1678748&r2=1678749&view=diff
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceChange.java (original)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceChange.java Mon May 11 13:16:02 2015
@@ -19,7 +19,10 @@
 package org.apache.sling.api.resource.observation;
 
 /**
- * TODO properties
+ * TODO properties, added/changed/removed, see SlingConstants
+ *
+ * TODO Should we make this an interface? This would allow lazy evaluation of information and
+ * improve performance if the info is not needed
  */
 public class ResourceChange {
 

Modified: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java?rev=1678749&r1=1678748&r2=1678749&view=diff
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java (original)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java Mon May 11 13:16:02 2015
@@ -20,12 +20,21 @@ package org.apache.sling.api.resource.ob
 
 import javax.annotation.Nonnull;
 
-import org.apache.sling.api.resource.provider.ObservationHandler.ResourceChange;
-
 import aQute.bnd.annotation.ConsumerType;
 
 @ConsumerType
 public interface ResourceListener {
 
+    /** TODO - define service registration properties for filtering. */
+
+    /** Array of paths - required. */
+    String PATHS = "resource.paths";
+
+    /** Array of types, optional. */
+    String TYPES = "resource.types";
+
+    /** LDAP style filter matching against properties. - TODO do we need this? */
+    String FILTER = "resource.filter";
+
     void onChange(@Nonnull ResourceChange change);
 }

Added: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/UserAwareResourceListener.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/UserAwareResourceListener.java?rev=1678749&view=auto
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/UserAwareResourceListener.java (added)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/UserAwareResourceListener.java Mon May 11 13:16:02 2015
@@ -0,0 +1,45 @@
+/*
+ * 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.api.resource.observation;
+
+import javax.annotation.Nonnull;
+
+import org.apache.sling.api.resource.ResourceResolver;
+
+import aQute.bnd.annotation.ConsumerType;
+
+/**
+ * TODO Do we need to bind this to a user?
+ */
+@ConsumerType
+public interface UserAwareResourceListener {
+
+    /** TODO - define service registration properties for filtering. */
+
+    /** Array of paths - required. */
+    String PATHS = "resource.paths";
+
+    /** Array of types, optional. */
+    String TYPES = "resource.types";
+
+    /** LDAP style filter matching against properties. - TODO do we need this? */
+    String FILTER = "resource.filter";
+
+    void onChange(@Nonnull ResourceResolver resolver, @Nonnull ResourceChange change);
+}

Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/UserAwareResourceListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/UserAwareResourceListener.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/UserAwareResourceListener.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationReporter.java (from r1677831, sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationHandler.java)
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationReporter.java?p2=sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationReporter.java&p1=sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationHandler.java&r1=1677831&r2=1678749&rev=1678749&view=diff
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationHandler.java (original)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationReporter.java Mon May 11 13:16:02 2015
@@ -27,7 +27,7 @@ import aQute.bnd.annotation.ProviderType
 /**
  */
 @ProviderType
-public interface ObservationHandler {
+public interface ObservationReporter {
 
     void reportChanges(@Nonnull ResourceChange... changes);
 }

Modified: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/package-info.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/package-info.java?rev=1678749&r1=1678748&r2=1678749&view=diff
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/package-info.java (original)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/package-info.java Mon May 11 13:16:02 2015
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-@Version(1.0.0")
+@Version("1.0.0")
 package org.apache.sling.api.resource.provider;
 
 import aQute.bnd.annotation.Version;

Modified: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryManager.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryManager.java?rev=1678749&r1=1678748&r2=1678749&view=diff
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryManager.java (original)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryManager.java Mon May 11 13:16:02 2015
@@ -30,10 +30,13 @@ import aQute.bnd.annotation.ProviderType
 @ProviderType
 public interface QueryManager extends QueryBuilder {
 
+    /** TODO - we can move this to query builder class. */
     @Nonnull QueryBuilder create();
 
+    /** TODO - move to a class. */
     @Nonnull QueryInstruction limit(int n);
 
+    /** TODO - move to a class. */
     @Nonnull QueryInstruction range(int start, int end);
 
     @Nonnull Iterator<Resource> find(@Nonnull ResourceResolver resolver,
@@ -43,6 +46,7 @@ public interface QueryManager extends Qu
                                      @Nonnull Query q,
                                      @Nonnull QueryInstruction qi);
 
+    /** TODO - move to a class. */
     public interface QueryInstruction {
 
     }