You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/10/18 23:19:48 UTC

[sling-org-apache-sling-featureflags] branch master created (now 0321970)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git.


      at 0321970  SLING-7167 Adjust READMEs

This branch includes the following new commits:

     new 161c737  SLING-3353 Move feature flags from contrib to bundles
     new 8441aa9  FELIX-3444 : Provide a switch to enable feature flags for the resource resolver
     new f815060  SLING-3484 - Remove FeatureAuthenticationInfoPostProcessor and FeatureConstants, unneeded
     new bf71326  Add svn info, remove unused dep
     new 485e197  [maven-release-plugin] prepare release org.apache.sling.featureflags-1.0.0
     new 91b4bdc  [maven-release-plugin] prepare for next development iteration
     new 67a15ff  Update to parent pom v19
     new 2754846  Updated to parent version 20
     new a0355f8  Update to Sling Parent POM 22 with baselining enabled
     new 40f7e22  Add missing licence header
     new 59f5a30  Update to Sling Parent 23
     new b4c5776  Remove superflous sling.java.version=6 as it's the default now
     new 53944da  SLING-4836 - Escape output in Apache Sling Feature Flags webconsole plugin * applied patch from  Alexandre Collignon (Thanks!)
     new 92d3883  [maven-release-plugin] prepare release org.apache.sling.featureflags-1.0.2
     new 3d0051f  [maven-release-plugin] prepare for next development iteration
     new 6e06d68  set parent version to 24 and add empty relativePath where missing
     new 03c1fe0  Update the main reactor to parent 25
     new 9ab8b73  Switch to parent pom 26
     new 9d1cf8a  SLING-5939 : Register filter using http whiteboard
     new 94b2b96  SLING-5939 : Register filter using Http Whiteboard
     new f7953e2  [maven-release-plugin] prepare release org.apache.sling.featureflags-1.1.0
     new f80bb4f  [maven-release-plugin] prepare for next development iteration
     new 1686a4e  SLING-5981 : Provide access to Features service in execution context
     new 073a538  [maven-release-plugin] prepare release org.apache.sling.featureflags-1.2.0
     new 106be95  [maven-release-plugin] prepare for next development iteration
     new 91aa6f6  switch parent pom reference everywhere to 28 where it was 27 before this can be safely done because the only difference between 27 and 28 is an updated maven-source-plugin (fix heap space error)
     new 1072543  use Sling Parent 30
     new 0321970  SLING-7167 Adjust READMEs

The 28 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-featureflags] 28/28: SLING-7167 Adjust READMEs

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 03219703f37e71836fc3b2ef8b04e5d5857cff7f
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Oct 3 09:21:43 2017 +0000

    SLING-7167 Adjust READMEs
    
    add missing README
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1810690 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..eb41272
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+# Apache Sling Feature Flags
+
+This module is part of the [Apache Sling](https://sling.apache.org) project.

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 10/28: Add missing licence header

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 40f7e226b15482e65b68b512ff4443e97d046c6a
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Apr 27 14:44:41 2015 +0000

    Add missing licence header
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1676278 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/pom.xml b/pom.xml
index 2b2a415..7aeeedf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,4 +1,22 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 24/28: [maven-release-plugin] prepare release org.apache.sling.featureflags-1.2.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 073a53856b23b5b6fb2fb1975f107d12f9b9f8e1
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Aug 19 16:30:35 2016 +0000

    [maven-release-plugin] prepare release org.apache.sling.featureflags-1.2.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1756931 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 72366d6..2109b83 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,14 +28,14 @@
     
     <groupId>org.apache.sling</groupId>
     <artifactId>org.apache.sling.featureflags</artifactId>
-    <version>1.1.1-SNAPSHOT</version>
+    <version>1.2.0</version>
     <packaging>bundle</packaging>
     <name>Apache Sling Feature Flags</name>
     
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/feature-flags</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.featureflags-1.2.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.featureflags-1.2.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.featureflags-1.2.0</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 25/28: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 106be95a082ccbc6781ca39a652da6976eb9e7b7
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Aug 19 16:30:51 2016 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1756933 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2109b83..ade7802 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,14 +28,14 @@
     
     <groupId>org.apache.sling</groupId>
     <artifactId>org.apache.sling.featureflags</artifactId>
-    <version>1.2.0</version>
+    <version>1.2.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
     <name>Apache Sling Feature Flags</name>
     
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.featureflags-1.2.0</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.featureflags-1.2.0</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.featureflags-1.2.0</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/feature-flags</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 05/28: [maven-release-plugin] prepare release org.apache.sling.featureflags-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 485e197bcd18fce600fc377a160b8dac586d5f35
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Mar 31 12:08:00 2014 +0000

    [maven-release-plugin] prepare release org.apache.sling.featureflags-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1583308 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index c9fdc64..a8d8025 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
     
     <groupId>org.apache.sling</groupId>
     <artifactId>org.apache.sling.featureflags</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
+    <version>1.0.0</version>
     <packaging>bundle</packaging>
     <name>Apache Sling Feature Flags</name>
     
@@ -18,9 +18,9 @@
     </properties>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/feature-flags</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.featureflags-1.0.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.featureflags-1.0.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.featureflags-1.0.0</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 21/28: [maven-release-plugin] prepare release org.apache.sling.featureflags-1.1.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit f7953e2708003d8eac0c5b88bef7074873ceaa30
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Aug 2 07:35:00 2016 +0000

    [maven-release-plugin] prepare release org.apache.sling.featureflags-1.1.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1754838 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6d221fc..258e917 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,19 +23,19 @@
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
         <version>27</version>
-        <relativePath/>
+        <relativePath />
     </parent>
     
     <groupId>org.apache.sling</groupId>
     <artifactId>org.apache.sling.featureflags</artifactId>
-    <version>1.0.3-SNAPSHOT</version>
+    <version>1.1.0</version>
     <packaging>bundle</packaging>
     <name>Apache Sling Feature Flags</name>
     
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/feature-flags</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.featureflags-1.1.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.featureflags-1.1.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.featureflags-1.1.0</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 17/28: Update the main reactor to parent 25

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 03c1fe049bb96a88f1ec9da6d3d6e03aa0a2381f
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Oct 5 10:03:45 2015 +0000

    Update the main reactor to parent 25
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1706780 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 2dbec51..251d277 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>24</version>
+        <version>25</version>
         <relativePath/>
     </parent>
     

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 27/28: use Sling Parent 30

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 107254368f9a95e28089415bba673a94008d3f23
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Mar 6 10:31:22 2017 +0000

    use Sling Parent 30
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1785622 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 064b8dd..8b31c79 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>28</version>
+        <version>30</version>
         <relativePath />
     </parent>
     

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 11/28: Update to Sling Parent 23

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 59f5a302de6aa175060be7256c3b44b62d489aeb
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 25 13:08:16 2015 +0000

    Update to Sling Parent 23
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1687500 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 7aeeedf..fefcfe2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>22</version>
+        <version>23</version>
     </parent>
     
     <groupId>org.apache.sling</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 15/28: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 3d0051fb9e023606c7e3d84530bf21a7a2932255
Author: Antonio Sanso <as...@apache.org>
AuthorDate: Fri Jun 26 07:38:13 2015 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1687696 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index ba4c1e7..118e07e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,14 +27,14 @@
     
     <groupId>org.apache.sling</groupId>
     <artifactId>org.apache.sling.featureflags</artifactId>
-    <version>1.0.2</version>
+    <version>1.0.3-SNAPSHOT</version>
     <packaging>bundle</packaging>
     <name>Apache Sling Feature Flags</name>
     
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.featureflags-1.0.2</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.featureflags-1.0.2</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.featureflags-1.0.2</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/feature-flags</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 04/28: Add svn info, remove unused dep

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit bf713269fc63ab4dd0c9bbbb2300a1bc8f62f686
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Mar 31 12:01:49 2014 +0000

    Add svn info, remove unused dep
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1583307 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6ea7c84..c9fdc64 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,6 +17,12 @@
         <sling.java.version>6</sling.java.version>
     </properties>
 
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/feature-flags</url>
+    </scm>
+
     <build>
         <plugins>
             <plugin>
@@ -53,12 +59,6 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.auth.core</artifactId>
-            <version>1.1.0</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
         </dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 23/28: SLING-5981 : Provide access to Features service in execution context

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 1686a4eb843edccbdf439fcb3d6514c7d53d5bea
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Aug 19 16:26:24 2016 +0000

    SLING-5981 : Provide access to Features service in execution context
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1756930 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/featureflags/ExecutionContext.java       |  7 ++++++
 .../sling/featureflags/impl/ConfiguredFeature.java |  5 +++-
 .../featureflags/impl/ExecutionContextImpl.java    | 28 +++++++++++++++++-----
 .../sling/featureflags/impl/FeatureManager.java    | 23 ++++++++++--------
 .../apache/sling/featureflags/package-info.java    |  4 ++--
 5 files changed, 48 insertions(+), 19 deletions(-)

diff --git a/src/main/java/org/apache/sling/featureflags/ExecutionContext.java b/src/main/java/org/apache/sling/featureflags/ExecutionContext.java
index 5eda911..4d64685 100644
--- a/src/main/java/org/apache/sling/featureflags/ExecutionContext.java
+++ b/src/main/java/org/apache/sling/featureflags/ExecutionContext.java
@@ -60,4 +60,11 @@ public interface ExecutionContext {
      * @return the resource resolver or {@code null}
      */
     ResourceResolver getResourceResolver();
+
+    /**
+     * Return the {@link Features} manager. This allows a feature to find out
+     * about other features.
+     * @since 1.1.0
+     */
+    Features getFeatures();
 }
diff --git a/src/main/java/org/apache/sling/featureflags/impl/ConfiguredFeature.java b/src/main/java/org/apache/sling/featureflags/impl/ConfiguredFeature.java
index 266069e..7280f64 100644
--- a/src/main/java/org/apache/sling/featureflags/impl/ConfiguredFeature.java
+++ b/src/main/java/org/apache/sling/featureflags/impl/ConfiguredFeature.java
@@ -34,7 +34,10 @@ import org.osgi.service.metatype.annotations.ObjectClassDefinition;
 
 @Designate(ocd = ConfiguredFeature.Config.class, factory = true)
 @Component(service = Feature.class,
-           configurationPolicy = ConfigurationPolicy.REQUIRE)
+           configurationPolicy = ConfigurationPolicy.REQUIRE,
+           property = {
+                   Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
+           })
 public class ConfiguredFeature implements Feature {
 
     @ObjectClassDefinition(name = "Apache Sling Configured Feature",
diff --git a/src/main/java/org/apache/sling/featureflags/impl/ExecutionContextImpl.java b/src/main/java/org/apache/sling/featureflags/impl/ExecutionContextImpl.java
index 76d40c7..8a95302 100644
--- a/src/main/java/org/apache/sling/featureflags/impl/ExecutionContextImpl.java
+++ b/src/main/java/org/apache/sling/featureflags/impl/ExecutionContextImpl.java
@@ -23,9 +23,11 @@ import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.featureflags.ExecutionContext;
 import org.apache.sling.featureflags.Feature;
+import org.apache.sling.featureflags.Features;
 
 /**
  * Implementation of the provider context.
@@ -40,18 +42,25 @@ public class ExecutionContextImpl implements ExecutionContext {
 
     private final Map<String, Boolean> featureCache;
 
-    public ExecutionContextImpl(final HttpServletRequest request) {
+    private final Features features;
+
+    public ExecutionContextImpl(final Features features, final HttpServletRequest request) {
         ResourceResolver resourceResolver = null;
         if (request != null) {
-            Object resolverObject = request.getAttribute(REQUEST_ATTRIBUTE_RESOLVER);
-            if (resolverObject instanceof ResourceResolver) {
-                resourceResolver = (ResourceResolver) resolverObject;
+            if ( request instanceof SlingHttpServletRequest ) {
+                resourceResolver = ((SlingHttpServletRequest)request).getResourceResolver();
+            } else {
+                Object resolverObject = request.getAttribute(REQUEST_ATTRIBUTE_RESOLVER);
+                if (resolverObject instanceof ResourceResolver) {
+                    resourceResolver = (ResourceResolver) resolverObject;
+                }
             }
         }
 
         this.request = request;
         this.resourceResolver = resourceResolver;
         this.featureCache = new HashMap<String, Boolean>();
+        this.features = features;
     }
 
     @Override
@@ -64,11 +73,18 @@ public class ExecutionContextImpl implements ExecutionContext {
         return this.resourceResolver;
     }
 
-    boolean isEnabled(Feature feature) {
+    @Override
+    public Features getFeatures() {
+        return this.features;
+    }
+
+    boolean isEnabled(final Feature feature) {
         final String name = feature.getName();
         Boolean entry = this.featureCache.get(name);
         if (entry == null) {
-            entry = Boolean.valueOf(feature.isEnabled(this));
+            // put false in the cache to stop on circular calls
+            this.featureCache.put(name, Boolean.FALSE);
+            entry = feature.isEnabled(this);
             this.featureCache.put(name, entry);
         }
         return entry;
diff --git a/src/main/java/org/apache/sling/featureflags/impl/FeatureManager.java b/src/main/java/org/apache/sling/featureflags/impl/FeatureManager.java
index c8fd473..17464fd 100644
--- a/src/main/java/org/apache/sling/featureflags/impl/FeatureManager.java
+++ b/src/main/java/org/apache/sling/featureflags/impl/FeatureManager.java
@@ -62,7 +62,8 @@ import org.slf4j.LoggerFactory;
                    "felix.webconsole.label=features",
                    "felix.webconsole.title=Features",
                    "felix.webconsole.category=Sling",
-                   Constants.SERVICE_RANKING + ":Integer=16384"
+                   Constants.SERVICE_RANKING + ":Integer=16384",
+                   Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
            })
 public class FeatureManager implements Features, Filter, Servlet {
 
@@ -90,7 +91,7 @@ public class FeatureManager implements Features, Filter, Servlet {
     }
 
     @Override
-    public boolean isEnabled(String featureName) {
+    public boolean isEnabled(final String featureName) {
         final Feature feature = this.getFeature(featureName);
         if (feature != null) {
             return getCurrentExecutionContext().isEnabled(feature);
@@ -101,15 +102,17 @@ public class FeatureManager implements Features, Filter, Servlet {
     //--- Filter
 
     @Override
-    public void init(FilterConfig filterConfig) {
-        // nothing todo do
+    public void init(final FilterConfig filterConfig) {
+        // nothing to do
     }
 
     @Override
-    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
-            ServletException {
+    public void doFilter(final ServletRequest request,
+            final ServletResponse response,
+            final FilterChain chain)
+    throws IOException, ServletException {
+        this.pushContext((HttpServletRequest) request);
         try {
-            this.pushContext((HttpServletRequest) request);
             chain.doFilter(request, response);
         } finally {
             this.popContext();
@@ -125,7 +128,7 @@ public class FeatureManager implements Features, Filter, Servlet {
     //--- Servlet
 
     @Override
-    public void init(ServletConfig config) {
+    public void init(final ServletConfig config) {
         this.servletConfig = config;
     }
 
@@ -221,7 +224,7 @@ public class FeatureManager implements Features, Filter, Servlet {
     //--- Client Context management and access
 
     void pushContext(final HttpServletRequest request) {
-        this.perThreadClientContext.set(new ExecutionContextImpl(request));
+        this.perThreadClientContext.set(new ExecutionContextImpl(this, request));
     }
 
     void popContext() {
@@ -230,7 +233,7 @@ public class FeatureManager implements Features, Filter, Servlet {
 
     ExecutionContextImpl getCurrentExecutionContext() {
         ExecutionContextImpl ctx = this.perThreadClientContext.get();
-        return (ctx != null) ? ctx : new ExecutionContextImpl(null);
+        return (ctx != null) ? ctx : new ExecutionContextImpl(this, null);
     }
 
     /**
diff --git a/src/main/java/org/apache/sling/featureflags/package-info.java b/src/main/java/org/apache/sling/featureflags/package-info.java
index ff01425..4df4dc6 100644
--- a/src/main/java/org/apache/sling/featureflags/package-info.java
+++ b/src/main/java/org/apache/sling/featureflags/package-info.java
@@ -60,8 +60,8 @@
  *  </tr>
  * </table>
  *
- * @version 1.0
+ * @version 1.1
  * @see <a href="http://sling.apache.org/documentation/the-sling-engine/featureflags.html">Feature Flags</a>
  */
-@org.osgi.annotation.versioning.Version("1.0.1")
+@org.osgi.annotation.versioning.Version("1.1.0")
 package org.apache.sling.featureflags;

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 01/28: SLING-3353 Move feature flags from contrib to bundles

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 161c7370ab9a72ca242e9075c525675d6b7d9e18
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Thu Jan 30 09:48:41 2014 +0000

    SLING-3353 Move feature flags from contrib to bundles
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1562757 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  70 +++++
 .../sling/featureflags/ExecutionContext.java       |  64 +++++
 .../org/apache/sling/featureflags/Feature.java     |  71 +++++
 .../org/apache/sling/featureflags/Features.java    |  69 +++++
 .../sling/featureflags/impl/ConfiguredFeature.java | 105 ++++++++
 .../featureflags/impl/ExecutionContextImpl.java    |  76 ++++++
 .../sling/featureflags/impl/FeatureManager.java    | 287 +++++++++++++++++++++
 .../apache/sling/featureflags/package-info.java    |  70 +++++
 8 files changed, 812 insertions(+)

diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..6ea7c84
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>18</version>
+    </parent>
+    
+    <groupId>org.apache.sling</groupId>
+    <artifactId>org.apache.sling.featureflags</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Apache Sling Feature Flags</name>
+    
+    <properties>
+        <sling.java.version>6</sling.java.version>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+            </plugin>
+        </plugins>
+    </build>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.api</artifactId>
+            <version>2.1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.osgi</artifactId>
+            <version>2.1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.auth.core</artifactId>
+            <version>1.1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/src/main/java/org/apache/sling/featureflags/ExecutionContext.java b/src/main/java/org/apache/sling/featureflags/ExecutionContext.java
new file mode 100644
index 0000000..321a092
--- /dev/null
+++ b/src/main/java/org/apache/sling/featureflags/ExecutionContext.java
@@ -0,0 +1,64 @@
+/*
+ * 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.featureflags;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.sling.api.resource.ResourceResolver;
+
+import aQute.bnd.annotation.ProviderType;
+
+/**
+ * The {@code ExecutionContext} interface provides access to the context for
+ * evaluating whether a feature is enabled or not. Instances of this object are
+ * provided to the {@link Feature#isEnabled(ExecutionContext)} to help
+ * evaluating whether the feature is enabled or not.
+ * <p>
+ * This object provides access to live data and must only be used to read
+ * information. Modifying content through a {@code ResourceResolver} directly or
+ * indirectly provided by this object is considered inappropriate and faulty
+ * behavior.
+ * <p>
+ * Instances of this interface are provided by the feature manager to the
+ * {@link Feature} services. This interface is not intended to be implemented by
+ * client and application code.
+ */
+@ProviderType
+public interface ExecutionContext {
+
+    /**
+     * Returns a {@code HttpServletRequest} object to retrieve information which
+     * may influence the decision whether a {@link Feature} is enabled or not.
+     * If a {@code HttpServletRequest} object is not available in the context,
+     * this method may return {@code null}.
+     *
+     * @return the request or {@code null}
+     */
+    HttpServletRequest getRequest();
+
+    /**
+     * Returns a {@code ResourceResolver} object to retrieve information which
+     * may influence the decision whether a {@link Feature} is enabled or not.
+     * If a {@code ResourceResolver} object is not available in the context,
+     * this method may return {@code null}.
+     *
+     * @return the resource resolver or {@code null}
+     */
+    ResourceResolver getResourceResolver();
+}
diff --git a/src/main/java/org/apache/sling/featureflags/Feature.java b/src/main/java/org/apache/sling/featureflags/Feature.java
new file mode 100644
index 0000000..1d835b9
--- /dev/null
+++ b/src/main/java/org/apache/sling/featureflags/Feature.java
@@ -0,0 +1,71 @@
+/*
+ * 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.featureflags;
+
+import aQute.bnd.annotation.ConsumerType;
+
+/**
+ * A feature is defined by its name. Features are registered as OSGi services.
+ * <p>
+ * Feature {@link #getName() names} should be globally unique. If multiple
+ * features have the same name, the feature with the highest service ranking is
+ * accessible through the {@link Features} service while those with lower
+ * service rankings are ignored.
+ * <p>
+ * This interface is expected to be implemented by feature providers.
+ */
+@ConsumerType
+public interface Feature {
+
+    /**
+     * The name of the feature.
+     *
+     * @return The name of this feature which must not be {@code null} or an
+     *         empty string.
+     */
+    String getName();
+
+    /**
+     * The description of the feature.
+     *
+     * @return The optional description of this feature, which may be
+     *         {@code null} or an empty string.
+     */
+    String getDescription();
+
+    /**
+     * Checks whether the feature is enabled for the given execution context.
+     * <p>
+     * Multiple calls to this method may but are not required to return the same
+     * value. For example the return value may depend on the time of day, some
+     * random number or some information provided by the given
+     * {@link ExecutionContext}.
+     * <p>
+     * This method is called by the {@link Feature} manager and is not intended
+     * to be called by application code directly.
+     *
+     * @param context The {@link ExecutionContext} providing a context to
+     *            evaluate whether the feature is enabled or not.
+     *            Implementations must not hold on to this context instance or
+     *            the values provided for longer than executing this method.
+     * @return {@code true} if this {@code Feature} is enabled in the given
+     *         {@link ExecutionContext}.
+     */
+    boolean isEnabled(ExecutionContext context);
+}
diff --git a/src/main/java/org/apache/sling/featureflags/Features.java b/src/main/java/org/apache/sling/featureflags/Features.java
new file mode 100644
index 0000000..a1d2a69
--- /dev/null
+++ b/src/main/java/org/apache/sling/featureflags/Features.java
@@ -0,0 +1,69 @@
+/*
+ * 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.featureflags;
+
+import aQute.bnd.annotation.ProviderType;
+
+/**
+ * The {@code Features} service is the applications access point to the Feature
+ * Flag functionality. It can be used to query the available features and to
+ * create client contexts to be used for enabled feature checking.
+ */
+@ProviderType
+public interface Features {
+
+    /**
+     * Get the list of all (known) features.
+     * <p>
+     * Features are known if they are registered as {@link Feature} services or
+     * are configured with OSGi configuration whose factory PID is
+     * {@code org.apache.sling.featureflags.Feature}.
+     *
+     * @return The known features
+     */
+    Feature[] getFeatures();
+
+    /**
+     * Returns the feature with the given name.
+     * <p>
+     * Features are known if they are registered as {@link Feature} services or
+     * are configured with OSGi configuration whose factory PID is
+     * {@code org.apache.sling.featureflags.Feature}.
+     *
+     * @param name The name of the feature.
+     * @return The feature or <code>null</code> if not known or the name is an
+     *         empty string or {@code null}.
+     */
+    Feature getFeature(String name);
+
+    /**
+     * Returns {@code true} if a feature with the given name is known and
+     * enabled under the current {@link ExecutionContext}.
+     * <p>
+     * Features are known if they are registered as {@link Feature} services or
+     * are configured with OSGi configuration whose factory PID is
+     * {@code org.apache.sling.featureflags.Feature}.
+     *
+     * @param name The name of the feature to check for enablement.
+     * @return {@code true} if the named feature is known and enabled.
+     *         Specifically {@code false} is also returned if the named feature
+     *         is not known.
+     */
+    boolean isEnabled(String name);
+}
diff --git a/src/main/java/org/apache/sling/featureflags/impl/ConfiguredFeature.java b/src/main/java/org/apache/sling/featureflags/impl/ConfiguredFeature.java
new file mode 100644
index 0000000..d79d8cf
--- /dev/null
+++ b/src/main/java/org/apache/sling/featureflags/impl/ConfiguredFeature.java
@@ -0,0 +1,105 @@
+/*
+ * 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.featureflags.impl;
+
+import java.util.Map;
+
+import javax.servlet.ServletRequest;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.ConfigurationPolicy;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.commons.osgi.PropertiesUtil;
+import org.apache.sling.featureflags.ExecutionContext;
+import org.apache.sling.featureflags.Feature;
+import org.osgi.framework.Constants;
+
+@Component(
+        name = "org.apache.sling.featureflags.Feature",
+        metatype = true,
+        configurationFactory = true,
+        policy = ConfigurationPolicy.REQUIRE,
+        label = "Apache Sling Configured Feature",
+        description = "Allows for the definition of statically configured features which are defined and enabled through OSGi configuration")
+@Service
+public class ConfiguredFeature implements Feature {
+
+    private static final String PROP_FEATURE = "feature";
+
+    @Property(label = "Name", description = "Short name of this feature. This name is used "
+        + "to refer to this feature when checking for it to be enabled or not. This "
+        + "property is required and defaults to a name derived from the feature's class "
+        + "name and object identity. It is strongly recommended to define a useful and unique for the feature")
+    private static final String NAME = "name";
+
+    @Property(label = "Description", description = "Description for the feature. The "
+        + "intent is to descibe the behaviour of the application if this feature would be "
+        + "enabled. It is recommended to define this property. The default value is the value of the name property.")
+    private static final String DESCRIPTION = "description";
+
+    @Property(boolValue = false, label = "Enabled", description = "Boolean flag indicating whether the feature is "
+        + "enabled or not by this configuration")
+    private static final String ENABLED = "enabled";
+
+    private String name;
+
+    private String description;
+
+    private boolean enabled;
+
+    @Activate
+    private void activate(final Map<String, Object> configuration) {
+        final String pid = PropertiesUtil.toString(configuration.get(Constants.SERVICE_PID), getClass().getName() + "$"
+            + System.identityHashCode(this));
+        this.name = PropertiesUtil.toString(configuration.get(NAME), pid);
+        this.description = PropertiesUtil.toString(configuration.get(DESCRIPTION), this.name);
+        this.enabled = PropertiesUtil.toBoolean(configuration.get(ENABLED), false);
+    }
+
+    @Override
+    public boolean isEnabled(ExecutionContext context) {
+
+        // Request Parameter Override
+        ServletRequest request = context.getRequest();
+        if (request != null) {
+            String[] features = request.getParameterValues(PROP_FEATURE);
+            if (features != null) {
+                for (String feature : features) {
+                    if (this.name.equals(feature)) {
+                        return true;
+                    }
+                }
+            }
+        }
+
+        return this.enabled;
+    }
+
+    @Override
+    public String getName() {
+        return this.name;
+    }
+
+    @Override
+    public String getDescription() {
+        return this.description;
+    }
+}
diff --git a/src/main/java/org/apache/sling/featureflags/impl/ExecutionContextImpl.java b/src/main/java/org/apache/sling/featureflags/impl/ExecutionContextImpl.java
new file mode 100644
index 0000000..76d40c7
--- /dev/null
+++ b/src/main/java/org/apache/sling/featureflags/impl/ExecutionContextImpl.java
@@ -0,0 +1,76 @@
+/*
+ * 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.featureflags.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.featureflags.ExecutionContext;
+import org.apache.sling.featureflags.Feature;
+
+/**
+ * Implementation of the provider context.
+ */
+public class ExecutionContextImpl implements ExecutionContext {
+
+    private static final String REQUEST_ATTRIBUTE_RESOLVER = "org.apache.sling.auth.core.ResourceResolver";
+
+    private final ResourceResolver resourceResolver;
+
+    private final HttpServletRequest request;
+
+    private final Map<String, Boolean> featureCache;
+
+    public ExecutionContextImpl(final HttpServletRequest request) {
+        ResourceResolver resourceResolver = null;
+        if (request != null) {
+            Object resolverObject = request.getAttribute(REQUEST_ATTRIBUTE_RESOLVER);
+            if (resolverObject instanceof ResourceResolver) {
+                resourceResolver = (ResourceResolver) resolverObject;
+            }
+        }
+
+        this.request = request;
+        this.resourceResolver = resourceResolver;
+        this.featureCache = new HashMap<String, Boolean>();
+    }
+
+    @Override
+    public HttpServletRequest getRequest() {
+        return this.request;
+    }
+
+    @Override
+    public ResourceResolver getResourceResolver() {
+        return this.resourceResolver;
+    }
+
+    boolean isEnabled(Feature feature) {
+        final String name = feature.getName();
+        Boolean entry = this.featureCache.get(name);
+        if (entry == null) {
+            entry = Boolean.valueOf(feature.isEnabled(this));
+            this.featureCache.put(name, entry);
+        }
+        return entry;
+    }
+}
diff --git a/src/main/java/org/apache/sling/featureflags/impl/FeatureManager.java b/src/main/java/org/apache/sling/featureflags/impl/FeatureManager.java
new file mode 100644
index 0000000..c4f6b84
--- /dev/null
+++ b/src/main/java/org/apache/sling/featureflags/impl/FeatureManager.java
@@ -0,0 +1,287 @@
+/*
+ * 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.featureflags.impl;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.ConfigurationPolicy;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.ReferencePolicy;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.featureflags.Feature;
+import org.apache.sling.featureflags.Features;
+import org.osgi.framework.Constants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This service implements the feature handling. It keeps track of all
+ * {@link Feature} services.
+ */
+@Component(policy = ConfigurationPolicy.IGNORE)
+@Service
+@Reference(
+        name = "feature",
+        cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE,
+        policy = ReferencePolicy.DYNAMIC,
+        referenceInterface = Feature.class)
+@Properties({
+    @Property(name = "felix.webconsole.label", value = "features"),
+    @Property(name = "felix.webconsole.title", value = "Features"),
+    @Property(name = "felix.webconsole.category", value = "Sling"),
+    @Property(name = "pattern", value = "/.*"),
+    @Property(name = "service.ranking", intValue = 0x4000)
+})
+public class FeatureManager implements Features, Filter, Servlet {
+
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    private final ThreadLocal<ExecutionContextImpl> perThreadClientContext = new ThreadLocal<ExecutionContextImpl>();
+
+    private final Map<String, List<FeatureDescription>> allFeatures = new HashMap<String, List<FeatureDescription>>();
+
+    private Map<String, Feature> activeFeatures = Collections.emptyMap();
+
+    private ServletConfig servletConfig;
+
+    //--- Features
+
+    public Feature[] getFeatures() {
+        final Map<String, Feature> activeFeatures = this.activeFeatures;
+        return activeFeatures.values().toArray(new Feature[activeFeatures.size()]);
+    }
+
+    public Feature getFeature(final String name) {
+        return this.activeFeatures.get(name);
+    }
+
+    public boolean isEnabled(String featureName) {
+        final Feature feature = this.getFeature(featureName);
+        if (feature != null) {
+            return getCurrentExecutionContext().isEnabled(feature);
+        }
+        return false;
+    }
+
+    //--- Filter
+
+    @Override
+    public void init(FilterConfig filterConfig) {
+        // nothing todo do
+    }
+
+    @Override
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
+            ServletException {
+        try {
+            this.pushContext((HttpServletRequest) request);
+            chain.doFilter(request, response);
+        } finally {
+            this.popContext();
+        }
+    }
+
+    @Override
+    public void destroy() {
+        // method shared by Servlet and Filter interface
+        this.servletConfig = null;
+    }
+
+    //--- Servlet
+
+    @Override
+    public void init(ServletConfig config) {
+        this.servletConfig = config;
+    }
+
+    @Override
+    public ServletConfig getServletConfig() {
+        return this.servletConfig;
+    }
+
+    @Override
+    public String getServletInfo() {
+        return "Features";
+    }
+
+    @Override
+    public void service(ServletRequest req, ServletResponse res) throws IOException {
+        if ("GET".equals(((HttpServletRequest) req).getMethod())) {
+            final PrintWriter pw = res.getWriter();
+            final Feature[] features = getFeatures();
+            if (features == null || features.length == 0) {
+                pw.println("<p class='statline ui-state-highlight'>No Features currently defined</p>");
+            } else {
+                pw.printf("<p class='statline ui-state-highlight'>%d Feature(s) currently defined</p>%n",
+                    features.length);
+                pw.println("<table class='nicetable'>");
+                pw.println("<tr><th>Name</th><th>Description</th><th>Enabled</th></tr>");
+                final ExecutionContextImpl ctx = getCurrentExecutionContext();
+                for (final Feature feature : features) {
+                    pw.printf("<tr><td>%s</td><td>%s</td><td>%s</td></tr>%n", feature.getName(),
+                        feature.getDescription(), ctx.isEnabled(feature));
+                }
+                pw.println("</table>");
+            }
+        } else {
+            ((HttpServletResponse) res).sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+            res.flushBuffer();
+        }
+    }
+
+    //--- Feature binding
+
+    // bind method for Feature services
+    @SuppressWarnings("unused")
+    private void bindFeature(final Feature f, final Map<String, Object> props) {
+        synchronized (this.allFeatures) {
+            final String name = f.getName();
+            final FeatureDescription info = new FeatureDescription(f, props);
+
+            List<FeatureDescription> candidates = this.allFeatures.get(name);
+            if (candidates == null) {
+                candidates = new ArrayList<FeatureDescription>();
+                this.allFeatures.put(name, candidates);
+            }
+            candidates.add(info);
+            Collections.sort(candidates);
+
+            this.calculateActiveProviders();
+        }
+    }
+
+    // unbind method for Feature services
+    @SuppressWarnings("unused")
+    private void unbindFeature(final Feature f, final Map<String, Object> props) {
+        synchronized (this.allFeatures) {
+            final String name = f.getName();
+            final FeatureDescription info = new FeatureDescription(f, props);
+
+            final List<FeatureDescription> candidates = this.allFeatures.get(name);
+            if (candidates != null) { // sanity check
+                candidates.remove(info);
+                if (candidates.size() == 0) {
+                    this.allFeatures.remove(name);
+                }
+            }
+            this.calculateActiveProviders();
+        }
+    }
+
+    // calculates map of active features (eliminating Feature name
+    // collisions). Must be called while synchronized on this.allFeatures
+    private void calculateActiveProviders() {
+        final Map<String, Feature> activeMap = new HashMap<String, Feature>();
+        for (final Map.Entry<String, List<FeatureDescription>> entry : this.allFeatures.entrySet()) {
+            final FeatureDescription desc = entry.getValue().get(0);
+            activeMap.put(entry.getKey(), desc.feature);
+            if (entry.getValue().size() > 1) {
+                logger.warn("More than one feature service for feature {}", entry.getKey());
+            }
+        }
+        this.activeFeatures = activeMap;
+    }
+
+    //--- Client Context management and access
+
+    void pushContext(final HttpServletRequest request) {
+        this.perThreadClientContext.set(new ExecutionContextImpl(request));
+    }
+
+    void popContext() {
+        this.perThreadClientContext.set(null);
+    }
+
+    ExecutionContextImpl getCurrentExecutionContext() {
+        ExecutionContextImpl ctx = this.perThreadClientContext.get();
+        return (ctx != null) ? ctx : new ExecutionContextImpl(null);
+    }
+
+    /**
+     * Internal class caching some feature meta data like service id and
+     * ranking.
+     */
+    private final static class FeatureDescription implements Comparable<FeatureDescription> {
+
+        public final int ranking;
+
+        public final long serviceId;
+
+        public final Feature feature;
+
+        public FeatureDescription(final Feature feature, final Map<String, Object> props) {
+            this.feature = feature;
+            final Object sr = props.get(Constants.SERVICE_RANKING);
+            if (sr instanceof Integer) {
+                this.ranking = (Integer) sr;
+            } else {
+                this.ranking = 0;
+            }
+            this.serviceId = (Long) props.get(Constants.SERVICE_ID);
+        }
+
+        @Override
+        public int compareTo(final FeatureDescription o) {
+            if (this.ranking < o.ranking) {
+                return 1;
+            } else if (this.ranking > o.ranking) {
+                return -1;
+            }
+            // If ranks are equal, then sort by service id in descending order.
+            return (this.serviceId < o.serviceId) ? -1 : 1;
+        }
+
+        @Override
+        public boolean equals(final Object obj) {
+            if (obj instanceof FeatureDescription) {
+                return ((FeatureDescription) obj).serviceId == this.serviceId;
+            }
+            return false;
+        }
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + (int) (serviceId ^ (serviceId >>> 32));
+            return result;
+        }
+    }
+}
diff --git a/src/main/java/org/apache/sling/featureflags/package-info.java b/src/main/java/org/apache/sling/featureflags/package-info.java
new file mode 100644
index 0000000..c1803b5
--- /dev/null
+++ b/src/main/java/org/apache/sling/featureflags/package-info.java
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+
+/**
+ * The <i>Feature Flags</i> feature allows applications to dynamically
+ * provide features to clients and consumers depending on various criteria such as
+ * <ul>
+ * <li>Time of Day</li>
+ * <li>Static Configuration</li>
+ * <li>Request Parameter</li>
+ * <li>Some Resource</li>
+ * </ul>
+ * <p>
+ * Feature flag support consists of two parts: The feature flag itself represented
+ * by the {@link org.apache.sling.featureflags.Feature Feature} interface and the
+ * the application providing a feature guarded by a feature flag. Such applications
+ * make use of the {@link org.apache.sling.featureflags.Features Features} service to
+ * query feature flags.
+ * <p>
+ * Feature flags can be provided by registering
+ * {@link org.apache.sling.featureflags.Feature Feature} services. Alternatively
+ * feature flags can be provided by factory configuration with factory PID
+ * {@code org.apache.sling.featureflags.Feature} as follows:
+ * <table>
+ *  <tr>
+ *      <td>{@code name}</td>
+ *      <td>Short name of the feature. This name is used to refer to the feature
+ *          when checking for it to be enabled or not. This property is required
+ *          and defaults to a name derived from the feature's class name and object
+ *          identity. It is strongly recommended to define a useful and unique name
+ *          for the feature</td>
+ *  </tr>
+ *  <tr>
+ *      <td>{@code description}</td>
+ *      <td>Description for the feature. The intent is to describe the behavior
+ *          of the application if this feature would be enabled. It is recommended
+ *          to define this property. The default value is the name of the feature
+ *          as derived from the {@code name} property.</td>
+ *  </tr>
+ *  <tr>
+ *      <td>{@code enabled}</td>
+ *      <td>Boolean flag indicating whether the feature is enabled or not by
+ *          this configuration</td>
+ *  </tr>
+ * </table>
+ *
+ * @version 1.0
+ * @see <a href="http://sling.apache.org/documentation/the-sling-engine/featureflags.html">Feature Flags</a>
+ */
+@Version("1.0")
+package org.apache.sling.featureflags;
+
+import aQute.bnd.annotation.Version;
+

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 14/28: [maven-release-plugin] prepare release org.apache.sling.featureflags-1.0.2

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 92d38839c7c9bf7f57477cc53945aaa386870b05
Author: Antonio Sanso <as...@apache.org>
AuthorDate: Fri Jun 26 07:37:55 2015 +0000

    [maven-release-plugin] prepare release org.apache.sling.featureflags-1.0.2
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1687694 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 1490da8..ba4c1e7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,14 +27,14 @@
     
     <groupId>org.apache.sling</groupId>
     <artifactId>org.apache.sling.featureflags</artifactId>
-    <version>1.0.1-SNAPSHOT</version>
+    <version>1.0.2</version>
     <packaging>bundle</packaging>
     <name>Apache Sling Feature Flags</name>
     
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/feature-flags</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.featureflags-1.0.2</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.featureflags-1.0.2</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.featureflags-1.0.2</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 06/28: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 91b4bdc8bc7fb1ab1b34825031010aa81bc66c2e
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Mar 31 12:08:41 2014 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1583310 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index a8d8025..1145a03 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
     
     <groupId>org.apache.sling</groupId>
     <artifactId>org.apache.sling.featureflags</artifactId>
-    <version>1.0.0</version>
+    <version>1.0.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
     <name>Apache Sling Feature Flags</name>
     
@@ -18,9 +18,9 @@
     </properties>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.featureflags-1.0.0</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.featureflags-1.0.0</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.featureflags-1.0.0</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/feature-flags</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 09/28: Update to Sling Parent POM 22 with baselining enabled

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit a0355f8e7857afcccfce08b40ad0585be454708c
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Oct 1 06:57:44 2014 +0000

    Update to Sling Parent POM 22 with baselining enabled
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1628622 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 71d9d1f..2b2a415 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>20</version>
+        <version>22</version>
     </parent>
     
     <groupId>org.apache.sling</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 08/28: Updated to parent version 20

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 2754846504ce09ec0242104d116eb5e708b9b85e
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Aug 1 19:16:26 2014 +0000

    Updated to parent version 20
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1615208 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index be10185..71d9d1f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>19</version>
+        <version>20</version>
     </parent>
     
     <groupId>org.apache.sling</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 12/28: Remove superflous sling.java.version=6 as it's the default now

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit b4c57765a46726f6d72617f4a7d24c99f630ddda
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 25 13:14:53 2015 +0000

    Remove superflous sling.java.version=6 as it's the default now
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1687505 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index fefcfe2..1490da8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,10 +31,6 @@
     <packaging>bundle</packaging>
     <name>Apache Sling Feature Flags</name>
     
-    <properties>
-        <sling.java.version>6</sling.java.version>
-    </properties>
-
     <scm>
         <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</connection>
         <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</developerConnection>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 18/28: Switch to parent pom 26

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 9ab8b73921340cf24dabc699738c24e72adb4ea9
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Jan 3 14:07:46 2016 +0000

    Switch to parent pom 26
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1722720 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 251d277..6fe29b9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>25</version>
+        <version>26</version>
         <relativePath/>
     </parent>
     

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 19/28: SLING-5939 : Register filter using http whiteboard

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 9d1cf8aa0a098dee35a30411c14d325ec6e7c4af
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Aug 1 16:16:00 2016 +0000

    SLING-5939 : Register filter using http whiteboard
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1754774 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            | 20 ++----
 .../sling/featureflags/ExecutionContext.java       |  3 +-
 .../org/apache/sling/featureflags/Feature.java     |  2 +-
 .../org/apache/sling/featureflags/Features.java    |  2 +-
 .../sling/featureflags/impl/ConfiguredFeature.java | 82 +++++++++++++---------
 .../sling/featureflags/impl/FeatureManager.java    | 44 ++++++------
 .../apache/sling/featureflags/package-info.java    |  5 +-
 7 files changed, 78 insertions(+), 80 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6fe29b9..8b245e6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>26</version>
+        <version>27</version>
         <relativePath/>
     </parent>
     
@@ -42,10 +42,6 @@
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
             </plugin>
@@ -55,27 +51,23 @@
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
+            <artifactId>osgi.core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.api</artifactId>
-            <version>2.1.0</version>
+            <artifactId>org.osgi.service.http.whiteboard</artifactId>
+            <version>1.0.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.commons.osgi</artifactId>
+            <artifactId>org.apache.sling.api</artifactId>
             <version>2.1.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
+            <artifactId>javax.servlet-api</artifactId>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
diff --git a/src/main/java/org/apache/sling/featureflags/ExecutionContext.java b/src/main/java/org/apache/sling/featureflags/ExecutionContext.java
index 321a092..5eda911 100644
--- a/src/main/java/org/apache/sling/featureflags/ExecutionContext.java
+++ b/src/main/java/org/apache/sling/featureflags/ExecutionContext.java
@@ -21,8 +21,7 @@ package org.apache.sling.featureflags;
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.sling.api.resource.ResourceResolver;
-
-import aQute.bnd.annotation.ProviderType;
+import org.osgi.annotation.versioning.ProviderType;
 
 /**
  * The {@code ExecutionContext} interface provides access to the context for
diff --git a/src/main/java/org/apache/sling/featureflags/Feature.java b/src/main/java/org/apache/sling/featureflags/Feature.java
index 1d835b9..7faa6a4 100644
--- a/src/main/java/org/apache/sling/featureflags/Feature.java
+++ b/src/main/java/org/apache/sling/featureflags/Feature.java
@@ -18,7 +18,7 @@
  */
 package org.apache.sling.featureflags;
 
-import aQute.bnd.annotation.ConsumerType;
+import org.osgi.annotation.versioning.ConsumerType;
 
 /**
  * A feature is defined by its name. Features are registered as OSGi services.
diff --git a/src/main/java/org/apache/sling/featureflags/Features.java b/src/main/java/org/apache/sling/featureflags/Features.java
index a1d2a69..e9b7f7d 100644
--- a/src/main/java/org/apache/sling/featureflags/Features.java
+++ b/src/main/java/org/apache/sling/featureflags/Features.java
@@ -18,7 +18,7 @@
  */
 package org.apache.sling.featureflags;
 
-import aQute.bnd.annotation.ProviderType;
+import org.osgi.annotation.versioning.ProviderType;
 
 /**
  * The {@code Features} service is the applications access point to the Feature
diff --git a/src/main/java/org/apache/sling/featureflags/impl/ConfiguredFeature.java b/src/main/java/org/apache/sling/featureflags/impl/ConfiguredFeature.java
index d79d8cf..266069e 100644
--- a/src/main/java/org/apache/sling/featureflags/impl/ConfiguredFeature.java
+++ b/src/main/java/org/apache/sling/featureflags/impl/ConfiguredFeature.java
@@ -22,42 +22,44 @@ import java.util.Map;
 
 import javax.servlet.ServletRequest;
 
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.ConfigurationPolicy;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.featureflags.ExecutionContext;
 import org.apache.sling.featureflags.Feature;
 import org.osgi.framework.Constants;
-
-@Component(
-        name = "org.apache.sling.featureflags.Feature",
-        metatype = true,
-        configurationFactory = true,
-        policy = ConfigurationPolicy.REQUIRE,
-        label = "Apache Sling Configured Feature",
-        description = "Allows for the definition of statically configured features which are defined and enabled through OSGi configuration")
-@Service
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.ConfigurationPolicy;
+import org.osgi.service.metatype.annotations.AttributeDefinition;
+import org.osgi.service.metatype.annotations.Designate;
+import org.osgi.service.metatype.annotations.ObjectClassDefinition;
+
+@Designate(ocd = ConfiguredFeature.Config.class, factory = true)
+@Component(service = Feature.class,
+           configurationPolicy = ConfigurationPolicy.REQUIRE)
 public class ConfiguredFeature implements Feature {
 
-    private static final String PROP_FEATURE = "feature";
-
-    @Property(label = "Name", description = "Short name of this feature. This name is used "
-        + "to refer to this feature when checking for it to be enabled or not. This "
-        + "property is required and defaults to a name derived from the feature's class "
-        + "name and object identity. It is strongly recommended to define a useful and unique for the feature")
-    private static final String NAME = "name";
+    @ObjectClassDefinition(name = "Apache Sling Configured Feature",
+            description = "Allows for the definition of statically configured features which are defined and enabled through OSGi configuration",
+            factoryPid = "org.apache.sling.featureflags.Feature")
+    public static @interface Config {
+
+        @AttributeDefinition(name = "Name", description = "Short name of this feature. This name is used "
+            + "to refer to this feature when checking for it to be enabled or not. This "
+            + "property is required and defaults to a name derived from the feature's class "
+            + "name and object identity. It is strongly recommended to define a useful and unique for the feature")
+        String name();
+
+        @AttributeDefinition(name = "Description", description = "Description for the feature. The "
+                + "intent is to descibe the behaviour of the application if this feature would be "
+                + "enabled. It is recommended to define this property. The default value is the value of the name property.")
+        String description();
+
+        @AttributeDefinition(name = "Enabled", description = "Boolean flag indicating whether the feature is "
+                + "enabled or not by this configuration")
+        boolean enabled() default false;
+    }
 
-    @Property(label = "Description", description = "Description for the feature. The "
-        + "intent is to descibe the behaviour of the application if this feature would be "
-        + "enabled. It is recommended to define this property. The default value is the value of the name property.")
-    private static final String DESCRIPTION = "description";
+    private static final String PROP_FEATURE = "feature";
 
-    @Property(boolValue = false, label = "Enabled", description = "Boolean flag indicating whether the feature is "
-        + "enabled or not by this configuration")
-    private static final String ENABLED = "enabled";
 
     private String name;
 
@@ -66,12 +68,22 @@ public class ConfiguredFeature implements Feature {
     private boolean enabled;
 
     @Activate
-    private void activate(final Map<String, Object> configuration) {
-        final String pid = PropertiesUtil.toString(configuration.get(Constants.SERVICE_PID), getClass().getName() + "$"
-            + System.identityHashCode(this));
-        this.name = PropertiesUtil.toString(configuration.get(NAME), pid);
-        this.description = PropertiesUtil.toString(configuration.get(DESCRIPTION), this.name);
-        this.enabled = PropertiesUtil.toBoolean(configuration.get(ENABLED), false);
+    private void activate(final Config config, final Map<String, Object> properties) {
+        this.name = config.name();
+        if ( this.name == null ) {
+            Object pid = properties.get(Constants.SERVICE_PID);
+            if ( pid == null ) {
+                this.name = getClass().getName() + "$" + System.identityHashCode(this);
+            } else {
+                this.name = pid.toString();
+            }
+
+        }
+        this.description = config.description();
+        if ( this.description == null ) {
+            this.description = this.name;
+        }
+        this.enabled = config.enabled();
     }
 
     @Override
diff --git a/src/main/java/org/apache/sling/featureflags/impl/FeatureManager.java b/src/main/java/org/apache/sling/featureflags/impl/FeatureManager.java
index 9fed787..c8fd473 100644
--- a/src/main/java/org/apache/sling/featureflags/impl/FeatureManager.java
+++ b/src/main/java/org/apache/sling/featureflags/impl/FeatureManager.java
@@ -37,18 +37,16 @@ import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.ConfigurationPolicy;
-import org.apache.felix.scr.annotations.Properties;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.apache.felix.scr.annotations.ReferencePolicy;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.request.ResponseUtil;
 import org.apache.sling.featureflags.Feature;
 import org.apache.sling.featureflags.Features;
 import org.osgi.framework.Constants;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.ConfigurationPolicy;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.osgi.service.component.annotations.ReferencePolicy;
+import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -56,20 +54,16 @@ import org.slf4j.LoggerFactory;
  * This service implements the feature handling. It keeps track of all
  * {@link Feature} services.
  */
-@Component(policy = ConfigurationPolicy.IGNORE)
-@Service
-@Reference(
-        name = "feature",
-        cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE,
-        policy = ReferencePolicy.DYNAMIC,
-        referenceInterface = Feature.class)
-@Properties({
-    @Property(name = "felix.webconsole.label", value = "features"),
-    @Property(name = "felix.webconsole.title", value = "Features"),
-    @Property(name = "felix.webconsole.category", value = "Sling"),
-    @Property(name = "pattern", value = "/.*"),
-    @Property(name = "service.ranking", intValue = 0x4000)
-})
+@Component(service = {Features.class, Filter.class, Servlet.class},
+           configurationPolicy = ConfigurationPolicy.IGNORE,
+           property = {
+                   HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT + "=(" + HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME + "=org.apache.sling)",
+                   HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_PATTERN + "=/",
+                   "felix.webconsole.label=features",
+                   "felix.webconsole.title=Features",
+                   "felix.webconsole.category=Sling",
+                   Constants.SERVICE_RANKING + ":Integer=16384"
+           })
 public class FeatureManager implements Features, Filter, Servlet {
 
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
@@ -84,15 +78,18 @@ public class FeatureManager implements Features, Filter, Servlet {
 
     //--- Features
 
+    @Override
     public Feature[] getFeatures() {
         final Map<String, Feature> activeFeatures = this.activeFeatures;
         return activeFeatures.values().toArray(new Feature[activeFeatures.size()]);
     }
 
+    @Override
     public Feature getFeature(final String name) {
         return this.activeFeatures.get(name);
     }
 
+    @Override
     public boolean isEnabled(String featureName) {
         final Feature feature = this.getFeature(featureName);
         if (feature != null) {
@@ -170,7 +167,8 @@ public class FeatureManager implements Features, Filter, Servlet {
     //--- Feature binding
 
     // bind method for Feature services
-    @SuppressWarnings("unused")
+    @Reference(cardinality = ReferenceCardinality.MULTIPLE,
+            policy = ReferencePolicy.DYNAMIC)
     private void bindFeature(final Feature f, final Map<String, Object> props) {
         synchronized (this.allFeatures) {
             final String name = f.getName();
diff --git a/src/main/java/org/apache/sling/featureflags/package-info.java b/src/main/java/org/apache/sling/featureflags/package-info.java
index c1803b5..ff01425 100644
--- a/src/main/java/org/apache/sling/featureflags/package-info.java
+++ b/src/main/java/org/apache/sling/featureflags/package-info.java
@@ -63,8 +63,5 @@
  * @version 1.0
  * @see <a href="http://sling.apache.org/documentation/the-sling-engine/featureflags.html">Feature Flags</a>
  */
-@Version("1.0")
+@org.osgi.annotation.versioning.Version("1.0.1")
 package org.apache.sling.featureflags;
-
-import aQute.bnd.annotation.Version;
-

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 26/28: switch parent pom reference everywhere to 28 where it was 27 before this can be safely done because the only difference between 27 and 28 is an updated maven-source-plugin (fix heap space error)

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 91aa6f65affbaec90ab87c150d668095ef0a79e3
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Fri Aug 19 21:15:35 2016 +0000

    switch parent pom reference everywhere to 28 where it was 27 before
    this can be safely done because the only difference between 27 and 28 is an updated maven-source-plugin (fix heap space error)
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1756968 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index ade7802..064b8dd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>27</version>
+        <version>28</version>
         <relativePath />
     </parent>
     

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 13/28: SLING-4836 - Escape output in Apache Sling Feature Flags webconsole plugin * applied patch from Alexandre Collignon (Thanks!)

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 53944da72584ff3f1386afbcae9a7ef848c5649a
Author: Antonio Sanso <as...@apache.org>
AuthorDate: Fri Jun 26 07:31:10 2015 +0000

    SLING-4836 - Escape output in Apache Sling Feature Flags webconsole plugin
    * applied patch from  Alexandre Collignon (Thanks!)
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1687690 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/sling/featureflags/impl/FeatureManager.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/featureflags/impl/FeatureManager.java b/src/main/java/org/apache/sling/featureflags/impl/FeatureManager.java
index c4f6b84..9fed787 100644
--- a/src/main/java/org/apache/sling/featureflags/impl/FeatureManager.java
+++ b/src/main/java/org/apache/sling/featureflags/impl/FeatureManager.java
@@ -45,6 +45,7 @@ import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.ReferenceCardinality;
 import org.apache.felix.scr.annotations.ReferencePolicy;
 import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.api.request.ResponseUtil;
 import org.apache.sling.featureflags.Feature;
 import org.apache.sling.featureflags.Features;
 import org.osgi.framework.Constants;
@@ -155,8 +156,8 @@ public class FeatureManager implements Features, Filter, Servlet {
                 pw.println("<tr><th>Name</th><th>Description</th><th>Enabled</th></tr>");
                 final ExecutionContextImpl ctx = getCurrentExecutionContext();
                 for (final Feature feature : features) {
-                    pw.printf("<tr><td>%s</td><td>%s</td><td>%s</td></tr>%n", feature.getName(),
-                        feature.getDescription(), ctx.isEnabled(feature));
+                    pw.printf("<tr><td>%s</td><td>%s</td><td>%s</td></tr>%n", ResponseUtil.escapeXml(feature.getName()),
+                            ResponseUtil.escapeXml(feature.getDescription()), ctx.isEnabled(feature));
                 }
                 pw.println("</table>");
             }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 02/28: FELIX-3444 : Provide a switch to enable feature flags for the resource resolver

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 8441aa9ad6e2dd2d99d30f1d5e8101ec23e48586
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Mar 10 14:31:48 2014 +0000

    FELIX-3444 : Provide a switch to enable feature flags for the resource resolver
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1575951 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/featureflags/FeatureConstants.java       | 31 +++++++++++++
 .../FeatureAuthenticationInfoPostProcessor.java    | 52 ++++++++++++++++++++++
 2 files changed, 83 insertions(+)

diff --git a/src/main/java/org/apache/sling/featureflags/FeatureConstants.java b/src/main/java/org/apache/sling/featureflags/FeatureConstants.java
new file mode 100644
index 0000000..47b1f8b
--- /dev/null
+++ b/src/main/java/org/apache/sling/featureflags/FeatureConstants.java
@@ -0,0 +1,31 @@
+/*
+ * 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.featureflags;
+
+
+public abstract class FeatureConstants {
+
+    /**
+     * The name of the resource resolver attribute which is set if the
+     * feature flag support should be enabled in the resource resolver.
+     * The value of this property should be of type Boolean. The default
+     * is <code>false</code>
+     */
+    public static final String RESOLVER_ATTR_FEATURES_ENABLED = "sling.resourceresolver.feature";
+}
diff --git a/src/main/java/org/apache/sling/featureflags/impl/FeatureAuthenticationInfoPostProcessor.java b/src/main/java/org/apache/sling/featureflags/impl/FeatureAuthenticationInfoPostProcessor.java
new file mode 100644
index 0000000..ab2f30c
--- /dev/null
+++ b/src/main/java/org/apache/sling/featureflags/impl/FeatureAuthenticationInfoPostProcessor.java
@@ -0,0 +1,52 @@
+/*
+ * 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.featureflags.impl;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.api.resource.LoginException;
+import org.apache.sling.auth.core.spi.AuthenticationInfo;
+import org.apache.sling.auth.core.spi.AuthenticationInfoPostProcessor;
+import org.apache.sling.featureflags.FeatureConstants;
+
+/**
+ * This authentication info post processor enables the feature flag support
+ * in the resource resolver for GET and HEAD requests.
+ */
+@Component
+@Service(value=AuthenticationInfoPostProcessor.class)
+public class FeatureAuthenticationInfoPostProcessor implements AuthenticationInfoPostProcessor {
+
+    /**
+     * @see org.apache.sling.auth.core.spi.AuthenticationInfoPostProcessor#postProcess(org.apache.sling.auth.core.spi.AuthenticationInfo, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
+     */
+    @Override
+    public void postProcess(final AuthenticationInfo info,
+            final HttpServletRequest request,
+            final HttpServletResponse response)
+    throws LoginException {
+        if ( "GET".equals(request.getMethod()) || "HEAD".equals(request.getMethod()) ) {
+            info.put(FeatureConstants.RESOLVER_ATTR_FEATURES_ENABLED, Boolean.TRUE);
+        }
+    }
+
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 22/28: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit f80bb4fbf01afa10fc36bb96243e93edcb059444
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Aug 2 07:35:15 2016 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1754840 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 258e917..72366d6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,14 +28,14 @@
     
     <groupId>org.apache.sling</groupId>
     <artifactId>org.apache.sling.featureflags</artifactId>
-    <version>1.1.0</version>
+    <version>1.1.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
     <name>Apache Sling Feature Flags</name>
     
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.featureflags-1.1.0</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.featureflags-1.1.0</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.featureflags-1.1.0</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/feature-flags</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/feature-flags</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 20/28: SLING-5939 : Register filter using Http Whiteboard

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 94b2b96f18fb57e970bbcd408f5789528ec76db7
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Aug 2 07:15:19 2016 +0000

    SLING-5939 : Register filter using Http Whiteboard
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1754831 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pom.xml b/pom.xml
index 8b245e6..6d221fc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -44,6 +44,13 @@
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
+                <configuration>
+                    <instructions>                
+                        <Require-Capability>
+                            osgi.implementation;filter:="(&amp;(osgi.implementation=osgi.http)(version=1.0))"
+                        </Require-Capability>
+                    </instructions>                
+                </configuration>
             </plugin>
         </plugins>
     </build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 16/28: set parent version to 24 and add empty relativePath where missing

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 6e06d68b2fe1c7131de9c646aebea6361e317db9
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Jul 7 08:09:17 2015 +0000

    set parent version to 24 and add empty relativePath where missing
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1689593 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 118e07e..2dbec51 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,8 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>23</version>
+        <version>24</version>
+        <relativePath/>
     </parent>
     
     <groupId>org.apache.sling</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 03/28: SLING-3484 - Remove FeatureAuthenticationInfoPostProcessor and FeatureConstants, unneeded

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit f815060b953857eb8c57b44cb34c60356b1a528b
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Mar 27 10:47:18 2014 +0000

    SLING-3484 - Remove FeatureAuthenticationInfoPostProcessor and FeatureConstants, unneeded
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1582249 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/featureflags/FeatureConstants.java       | 31 -------------
 .../FeatureAuthenticationInfoPostProcessor.java    | 52 ----------------------
 2 files changed, 83 deletions(-)

diff --git a/src/main/java/org/apache/sling/featureflags/FeatureConstants.java b/src/main/java/org/apache/sling/featureflags/FeatureConstants.java
deleted file mode 100644
index 47b1f8b..0000000
--- a/src/main/java/org/apache/sling/featureflags/FeatureConstants.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.featureflags;
-
-
-public abstract class FeatureConstants {
-
-    /**
-     * The name of the resource resolver attribute which is set if the
-     * feature flag support should be enabled in the resource resolver.
-     * The value of this property should be of type Boolean. The default
-     * is <code>false</code>
-     */
-    public static final String RESOLVER_ATTR_FEATURES_ENABLED = "sling.resourceresolver.feature";
-}
diff --git a/src/main/java/org/apache/sling/featureflags/impl/FeatureAuthenticationInfoPostProcessor.java b/src/main/java/org/apache/sling/featureflags/impl/FeatureAuthenticationInfoPostProcessor.java
deleted file mode 100644
index ab2f30c..0000000
--- a/src/main/java/org/apache/sling/featureflags/impl/FeatureAuthenticationInfoPostProcessor.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.featureflags.impl;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.sling.api.resource.LoginException;
-import org.apache.sling.auth.core.spi.AuthenticationInfo;
-import org.apache.sling.auth.core.spi.AuthenticationInfoPostProcessor;
-import org.apache.sling.featureflags.FeatureConstants;
-
-/**
- * This authentication info post processor enables the feature flag support
- * in the resource resolver for GET and HEAD requests.
- */
-@Component
-@Service(value=AuthenticationInfoPostProcessor.class)
-public class FeatureAuthenticationInfoPostProcessor implements AuthenticationInfoPostProcessor {
-
-    /**
-     * @see org.apache.sling.auth.core.spi.AuthenticationInfoPostProcessor#postProcess(org.apache.sling.auth.core.spi.AuthenticationInfo, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
-     */
-    @Override
-    public void postProcess(final AuthenticationInfo info,
-            final HttpServletRequest request,
-            final HttpServletResponse response)
-    throws LoginException {
-        if ( "GET".equals(request.getMethod()) || "HEAD".equals(request.getMethod()) ) {
-            info.put(FeatureConstants.RESOLVER_ATTR_FEATURES_ENABLED, Boolean.TRUE);
-        }
-    }
-
-}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-featureflags] 07/28: Update to parent pom v19

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-featureflags.git

commit 67a15ffb1b33c2b8f0f5f76c4b7f7655f1b8724f
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Mar 31 14:39:20 2014 +0000

    Update to parent pom v19
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1583337 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 1145a03..be10185 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>18</version>
+        <version>19</version>
     </parent>
     
     <groupId>org.apache.sling</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.