You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by fm...@apache.org on 2013/07/03 10:56:38 UTC

svn commit: r1499275 - in /sling/whiteboard/fmeschbe/deprecate_login_administrative/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping: ServiceUserMapper.java impl/ServiceUserMapperImpl.java

Author: fmeschbe
Date: Wed Jul  3 08:56:38 2013
New Revision: 1499275

URL: http://svn.apache.org/r1499275
Log:
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.

Modified:
    sling/whiteboard/fmeschbe/deprecate_login_administrative/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/ServiceUserMapper.java
    sling/whiteboard/fmeschbe/deprecate_login_administrative/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java

Modified: sling/whiteboard/fmeschbe/deprecate_login_administrative/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/ServiceUserMapper.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/deprecate_login_administrative/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/ServiceUserMapper.java?rev=1499275&r1=1499274&r2=1499275&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/deprecate_login_administrative/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/ServiceUserMapper.java (original)
+++ sling/whiteboard/fmeschbe/deprecate_login_administrative/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/ServiceUserMapper.java Wed Jul  3 08:56:38 2013
@@ -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);
 }

Modified: sling/whiteboard/fmeschbe/deprecate_login_administrative/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/deprecate_login_administrative/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java?rev=1499275&r1=1499274&r2=1499275&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/deprecate_login_administrative/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java (original)
+++ sling/whiteboard/fmeschbe/deprecate_login_administrative/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java Wed Jul  3 08:56:38 2013
@@ -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 imple
             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 imple
             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 */