cziegeler commented on a change in pull request #25:
URL: 
https://github.com/apache/sling-org-apache-sling-api/pull/25#discussion_r499224970



##########
File path: 
src/main/java/org/apache/sling/api/resource/mapping/PathToUriMappingService.java
##########
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.api.resource.mapping;
+
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.sling.api.uri.SlingUri;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Provides a way to resolve and map paths to Sling URIs. Both operations are 
extensible by
+ * {@link org.apache.sling.spi.urimapping.SlingUriMapper} OSGi services.
+ * 
+ * @since 1.1.0 (Sling API Bundle 2.23.0)
+ */
+@ProviderType
+public interface PathToUriMappingService {
+
+    /** The result of a map or resolve operation */
+    @ProviderType
+    public interface Result {
+        /**
+         * The Sling URI as result of the resolve or map operation.
+         * 
+         * @return the Sling URI
+         */
+        @NotNull
+        SlingUri getUri();
+
+        /**
+         * Returns all intermediate mappings as produced by {@link 
org.apache.sling.spi.urimapping.SlingUriMapper} services
+         * 
+         * @return the intermediate mappings
+         */
+        @NotNull
+        Map<String, SlingUri> getIntermediateMappings();

Review comment:
       I don't think that a class name is a good key - in theory there could be 
a factory component for SlingUriMapper with different configurations - sharing 
the same class name.
   As this is ordered, it probably should be a list. So how about a list of 
some type of object, which has two getter methods, one to get the SlingUri, the 
other to get some info about the SlingUriMapper. We could add a default method 
to SlingUriMapper like getName() which by default returns the class name. But 
this way, the contract is at least more clear.
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to