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/11/07 10:13:44 UTC

[sling-org-apache-sling-serviceusermapper] annotated tag org.apache.sling.serviceusermapper-1.0.4 created (now a51f075)

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

rombert pushed a change to annotated tag org.apache.sling.serviceusermapper-1.0.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-serviceusermapper.git.


      at a51f075  (tag)
 tagging bed7b6b86acfd4f1c33ebd1e147dd5a258a2ca20 (commit)
      by Carsten Ziegeler
      on Thu Jul 10 21:04:43 2014 +0000

- Log -----------------------------------------------------------------
org.apache.sling.serviceusermapper-1.0.4
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new e689b69  Working on a prototype to deprecate loginAdministrative
     new c5e0963  change api: use ServiceFactory approach and service bundle is actually the using bundle
     new 7d98561  Switch back to using a regular ServiceUserName service tacking the service bundle as an argument.
     new 1b03026  Implement support for service based ResourceResolver and Session access
     new 3ecf9df  Implement support for service based ResourceResolver and Session access
     new f39b2fc  SLING-2944 Implement Service User Mapper
     new 0a5259b  SLING-2944 :  Replace administrative login by service-based login
     new e9b4e3e  Update to parent pom 18
     new 145bf95  SLING-3286 - Remove plugin version overrides from poms
     new e1a1537  Add svn info
     new ce124d6  [maven-release-plugin] prepare release org.apache.sling.serviceusermapper-1.0.0
     new b1c7389  [maven-release-plugin] prepare for next development iteration
     new e40493e  Update to parent pom v19
     new 90f2a66  SLING-3578 : Support mapping amendments
     new fe71e7f  [maven-release-plugin] prepare release org.apache.sling.serviceusermapper-1.0.2
     new 0394164  [maven-release-plugin] prepare for next development iteration
     new dad1f70  SLING-3465 : Wrong description for "user.mapping" property of ServiceUserMapperImpl. Apply patch from Tobias Bocanegra and also fix the copied info in the new MappingConfigAmendment
     new a8f6248  SLING-3757 : cannot add more than 1 service user with the OSGI console
     new 3c2449b  [maven-release-plugin] prepare release org.apache.sling.serviceusermapper-1.0.4
     new bed7b6b  [maven-release-plugin]  copy for tag org.apache.sling.serviceusermapper-1.0.4

The 20 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-serviceusermapper] 03/05: SLING-3757 : cannot add more than 1 service user with the OSGI console

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

rombert pushed a commit to annotated tag org.apache.sling.serviceusermapper-1.0.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-serviceusermapper.git

commit a8f6248654d7e39214efba4520b6b43560fed786
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jul 10 21:03:55 2014 +0000

    SLING-3757 : cannot add more than 1 service user with the OSGI console
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/serviceusermapper@1609569 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/serviceusermapping/impl/Mapping.java   |  6 ++++++
 .../serviceusermapping/impl/MappingConfigAmendment.java | 17 ++++++++++++-----
 .../serviceusermapping/impl/ServiceUserMapperImpl.java  |  2 +-
 .../impl/ServiceUserMapperImplTest.java                 |  2 --
 4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/apache/sling/serviceusermapping/impl/Mapping.java b/src/main/java/org/apache/sling/serviceusermapping/impl/Mapping.java
index b7effb7..07ca263 100644
--- a/src/main/java/org/apache/sling/serviceusermapping/impl/Mapping.java
+++ b/src/main/java/org/apache/sling/serviceusermapping/impl/Mapping.java
@@ -87,4 +87,10 @@ class Mapping {
     private boolean equals(String str1, String str2) {
         return ((str1 == null) ? str2 == null : str1.equals(str2));
     }
+
+    @Override
+    public String toString() {
+        return "Mapping [serviceName=" + serviceName + ", subServiceName="
+                + subServiceName + ", userName=" + userName + "]";
+    }
 }
diff --git a/src/main/java/org/apache/sling/serviceusermapping/impl/MappingConfigAmendment.java b/src/main/java/org/apache/sling/serviceusermapping/impl/MappingConfigAmendment.java
index 44265fe..1894133 100644
--- a/src/main/java/org/apache/sling/serviceusermapping/impl/MappingConfigAmendment.java
+++ b/src/main/java/org/apache/sling/serviceusermapping/impl/MappingConfigAmendment.java
@@ -29,7 +29,6 @@ import org.apache.felix.scr.annotations.Property;
 import org.apache.felix.scr.annotations.PropertyUnbounded;
 import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.commons.osgi.PropertiesUtil;
-import org.apache.sling.commons.osgi.ServiceUtil;
 import org.osgi.framework.Constants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -63,7 +62,7 @@ public class MappingConfigAmendment implements Comparable<MappingConfigAmendment
 
     private Mapping[] serviceUserMappings;
 
-    private Comparable<Object> comparable;
+    private int serviceRanking;
 
     @Activate
     @Modified
@@ -71,7 +70,7 @@ public class MappingConfigAmendment implements Comparable<MappingConfigAmendment
         final String[] props = PropertiesUtil.toStringArray(config.get(PROP_SERVICE2USER_MAPPING),
             PROP_SERVICE2USER_MAPPING_DEFAULT);
 
-        ArrayList<Mapping> mappings = new ArrayList<Mapping>(props.length);
+        final ArrayList<Mapping> mappings = new ArrayList<Mapping>(props.length);
         for (final String prop : props) {
             if (prop != null && prop.trim().length() > 0 ) {
                 try {
@@ -84,7 +83,7 @@ public class MappingConfigAmendment implements Comparable<MappingConfigAmendment
         }
 
         this.serviceUserMappings = mappings.toArray(new Mapping[mappings.size()]);
-        this.comparable = ServiceUtil.getComparableForServiceRanking(config);
+        this.serviceRanking = PropertiesUtil.toInteger(config.get(Constants.SERVICE_RANKING), 0);
     }
 
     public Mapping[] getServiceUserMappings() {
@@ -92,6 +91,14 @@ public class MappingConfigAmendment implements Comparable<MappingConfigAmendment
     }
 
     public int compareTo(final MappingConfigAmendment o) {
-        return -this.comparable.compareTo(o.comparable);
+        // Sort by rank in descending order.
+        if ( this.serviceRanking > o.serviceRanking ) {
+            return -1; // lower rank
+        } else if (this.serviceRanking < o.serviceRanking) {
+            return 1; // higher rank
+        }
+
+        // If ranks are equal, then sort by hash code
+        return this.hashCode() < o.hashCode() ? -1 : 1;
     }
 }
diff --git a/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java b/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java
index ecd29ef..02e22f6 100644
--- a/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java
+++ b/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java
@@ -49,7 +49,7 @@ import org.slf4j.LoggerFactory;
            referenceInterface=MappingConfigAmendment.class,
            cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE,
            policy=ReferencePolicy.DYNAMIC,
-           updated="update")
+           updated="updateAmendment")
 public class ServiceUserMapperImpl implements ServiceUserMapper {
 
     @Property(
diff --git a/src/test/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImplTest.java b/src/test/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImplTest.java
index 2b007be..2a98a45 100644
--- a/src/test/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImplTest.java
+++ b/src/test/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImplTest.java
@@ -164,7 +164,6 @@ public class ServiceUserMapperImplTest {
         final Map<String, Object> mca1Config = new HashMap<String, Object>() {
             {
                 put("user.mapping", new String [] {BUNDLE_SYMBOLIC2 + "=" + ANOTHER});
-                put(Constants.SERVICE_ID, 1L);
                 put(Constants.SERVICE_RANKING, 100);
             }
         };
@@ -174,7 +173,6 @@ public class ServiceUserMapperImplTest {
         final Map<String, Object> mca2Config = new HashMap<String, Object>() {
             {
                 put("user.mapping", new String [] {BUNDLE_SYMBOLIC2 + "=" + ANOTHER_SUB});
-                put(Constants.SERVICE_ID, 2L);
                 put(Constants.SERVICE_RANKING, 200);
             }
         };

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

[sling-org-apache-sling-serviceusermapper] 02/05: SLING-3465 : Wrong description for "user.mapping" property of ServiceUserMapperImpl. Apply patch from Tobias Bocanegra and also fix the copied info in the new MappingConfigAmendment

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

rombert pushed a commit to annotated tag org.apache.sling.serviceusermapper-1.0.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-serviceusermapper.git

commit dad1f7059aec8c27fe037ec6b2841e8042042a8a
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed May 28 05:42:01 2014 +0000

    SLING-3465 : Wrong description for "user.mapping" property of ServiceUserMapperImpl. Apply patch from Tobias Bocanegra and also fix the copied info in the new MappingConfigAmendment
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/serviceusermapper@1597928 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/serviceusermapping/impl/MappingConfigAmendment.java  | 4 ++--
 .../apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/serviceusermapping/impl/MappingConfigAmendment.java b/src/main/java/org/apache/sling/serviceusermapping/impl/MappingConfigAmendment.java
index 2c2c962..44265fe 100644
--- a/src/main/java/org/apache/sling/serviceusermapping/impl/MappingConfigAmendment.java
+++ b/src/main/java/org/apache/sling/serviceusermapping/impl/MappingConfigAmendment.java
@@ -50,8 +50,8 @@ public class MappingConfigAmendment implements Comparable<MappingConfigAmendment
     @Property(
             label = "Service Mappings",
             description = "Provides mappings from service name to user names. "
-                + "Each entry is of the form 'serviceName [ \":\" subServiceName ] \"=\" userName' "
-                + "where serviceName and subServiceName identify the service and userName "
+                + "Each entry is of the form 'bundleId [ \":\" subServiceName ] \"=\" userName' "
+                + "where bundleId and subServiceName identify the service and userName "
                 + "defines the name of the user to provide to the service. Invalid entries are logged and ignored.",
             unbounded = PropertyUnbounded.ARRAY)
     private static final String PROP_SERVICE2USER_MAPPING = "user.mapping";
diff --git a/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java b/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java
index f044e02..ecd29ef 100644
--- a/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java
+++ b/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java
@@ -55,8 +55,8 @@ public class ServiceUserMapperImpl implements ServiceUserMapper {
     @Property(
             label = "Service Mappings",
             description = "Provides mappings from service name to user names. "
-                + "Each entry is of the form 'serviceName [ \":\" subServiceName ] \"=\" userName' "
-                + "where serviceName and subServiceName identify the service and userName "
+                + "Each entry is of the form 'bundleId [ \":\" subServiceName ] \"=\" userName' "
+                + "where bundleId and subServiceName identify the service and userName "
                 + "defines the name of the user to provide to the service. Invalid entries are logged and ignored.",
             unbounded = PropertyUnbounded.ARRAY)
     private static final String PROP_SERVICE2USER_MAPPING = "user.mapping";

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

[sling-org-apache-sling-serviceusermapper] 04/05: [maven-release-plugin] prepare release org.apache.sling.serviceusermapper-1.0.4

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

rombert pushed a commit to annotated tag org.apache.sling.serviceusermapper-1.0.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-serviceusermapper.git

commit 3c2449b64ff744bac4a39e6d9d85cd01dbae587e
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jul 10 21:04:27 2014 +0000

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

diff --git a/pom.xml b/pom.xml
index 23ee000..99cf77a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
     <artifactId>org.apache.sling.serviceusermapper</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.3-SNAPSHOT</version>
+    <version>1.0.4</version>
 
     <name>Apache Sling Service User Mapper</name>
     <description>
@@ -39,9 +39,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/serviceusermapper</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/serviceusermapper</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/serviceusermapper</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.serviceusermapper-1.0.4</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.serviceusermapper-1.0.4</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.serviceusermapper-1.0.4</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-serviceusermapper] 01/05: [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 annotated tag org.apache.sling.serviceusermapper-1.0.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-serviceusermapper.git

commit 0394164942e2b5cb0b1a3fcea6bded8ad9571e93
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon May 26 09:00:38 2014 +0000

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

diff --git a/pom.xml b/pom.xml
index 881cf5f..23ee000 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
     <artifactId>org.apache.sling.serviceusermapper</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.2</version>
+    <version>1.0.3-SNAPSHOT</version>
 
     <name>Apache Sling Service User Mapper</name>
     <description>
@@ -39,9 +39,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.serviceusermapper-1.0.2</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.serviceusermapper-1.0.2</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.serviceusermapper-1.0.2</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/serviceusermapper</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/serviceusermapper</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/serviceusermapper</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-serviceusermapper] 05/05: [maven-release-plugin] copy for tag org.apache.sling.serviceusermapper-1.0.4

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

rombert pushed a commit to annotated tag org.apache.sling.serviceusermapper-1.0.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-serviceusermapper.git

commit bed7b6b86acfd4f1c33ebd1e147dd5a258a2ca20
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jul 10 21:04:43 2014 +0000

    [maven-release-plugin]  copy for tag org.apache.sling.serviceusermapper-1.0.4
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.serviceusermapper-1.0.4@1609571 13f79535-47bb-0310-9956-ffa450edef68

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