You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2021/12/22 19:32:35 UTC

[GitHub] [sling-org-apache-sling-caconfig-spi] stefanseifert commented on a change in pull request #1: SLING-8849 Added a ConfigurationBindingsResourceDetectionStrategy that can be used to detect a Resource based on the provided bindings

stefanseifert commented on a change in pull request #1:
URL: https://github.com/apache/sling-org-apache-sling-caconfig-spi/pull/1#discussion_r774120023



##########
File path: src/main/java/org/apache/sling/caconfig/resource/spi/ConfigurationBindingsResourceDetectionStrategy.java
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.caconfig.resource.spi;
+
+import org.apache.sling.api.resource.Resource;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.osgi.annotation.versioning.ConsumerType;
+
+import javax.script.Bindings;
+
+@ConsumerType
+public interface ConfigurationBindingsResourceDetectionStrategy {
+    /**
+     * Detects the resource by looking at the available bindings.
+     * @param bindings Bindings object to use for detecting the correct Resource.
+     * @return Detected Resource or {@code null} if this strategy did not detect an applicable resource.
+     */
+    @Nullable Resource detectResource(@NotNull Bindings bindings);

Review comment:
       switched to SlingHttpServletRequest as we need this interface also for SLING-7256




-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org