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:29 UTC

[sling-org-apache-sling-serviceusermapper] 04/12: Implement support for service based ResourceResolver and Session access

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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-serviceusermapper.git

commit 1b030267375ce9e2dd938f326b53e2d858258cc8
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Wed Jul 3 08:56:38 2013 +0000

    Implement support for service based ResourceResolver and Session access
    
    - JavaDoc cleanup
    - Do not require configuration - otherwise ResourceResolverFactory
      and ResourceProviderFactory services may be unsatisfied. If no
      configuration exists, default configuration applies, which
      defines no services and default user.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/whiteboard/fmeschbe/deprecate_login_administrative/serviceusermapper@1499275 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/serviceusermapping/ServiceUserMapper.java    | 8 ++++++--
 .../sling/serviceusermapping/impl/ServiceUserMapperImpl.java      | 8 +++-----
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/sling/serviceusermapping/ServiceUserMapper.java b/src/main/java/org/apache/sling/serviceusermapping/ServiceUserMapper.java
index e95d96d..35938c8 100644
--- a/src/main/java/org/apache/sling/serviceusermapping/ServiceUserMapper.java
+++ b/src/main/java/org/apache/sling/serviceusermapping/ServiceUserMapper.java
@@ -56,6 +56,9 @@ public interface ServiceUserMapper {
     /**
      * Returns the name of the service represented by the {@code bundle} and the
      * {@code serviceInfo}.
+     * <p>
+     * The service name consists of a name derived from the bundle and the
+     * {@code serviceInfo} value if not {@code null}.
      *
      * @param bundle The bundle implementing the service request access to
      *            resources.
@@ -77,8 +80,9 @@ public interface ServiceUserMapper {
      *            requesting access. This parameter is optional and may be
      *            {@code null}.
      * @return The name of the user to use to provide access to the resources
-     *         for the service. This may be {@code null} to only grant guest
-     *         level (or anonymous level) access to the resources.
+     *         for the service. This may be {@code null} if no particular user
+     *         can be derived for the service identified by the bundle and the
+     *         optional {@code serviceInfo}.
      */
     String getUserForService(Bundle bundle, String serviceInfo);
 }
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 9109cab..bc14ccd 100644
--- a/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java
+++ b/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java
@@ -23,7 +23,6 @@ import java.util.Map;
 
 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.Modified;
 import org.apache.felix.scr.annotations.Property;
 import org.apache.felix.scr.annotations.PropertyUnbounded;
@@ -34,7 +33,7 @@ import org.osgi.framework.Bundle;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@Component(metatype = true, ds = true, policy = ConfigurationPolicy.REQUIRE)
+@Component(metatype = true, ds = true)
 @Service()
 public class ServiceUserMapperImpl implements ServiceUserMapper {
 
@@ -42,7 +41,7 @@ public class ServiceUserMapperImpl implements ServiceUserMapper {
             label = "Service Mappings",
             description = "Provides mappings from service name to user names. "
                 + "Each entry is of the form 'serviceName [ \":\" serviceInfo ] \"=\" userName' "
-                + "where serviceName and serviceInfo identify the service and userName would "
+                + "where serviceName and serviceInfo 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";
@@ -55,8 +54,7 @@ public class ServiceUserMapperImpl implements ServiceUserMapper {
             name = PROP_DEFAULT_USER,
             label = "Default User",
             description = "The name of the user to use as the default if no service mapping"
-                + "applies. If this property is missing or empty the default user name reflects "
-                + "an anonymous user.")
+                + "applies. If this property is missing or empty no default user is defined.")
     private static final String PROP_DEFAULT_USER_DEFAULT = "";
 
     /** default log */

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