You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2022/03/29 21:47:31 UTC
[sling-org-apache-sling-jcr-resource] 01/01: Merging latest changes from master
This is an automated email from the ASF dual-hosted git repository.
dklco pushed a commit to branch SLING-11229
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-resource.git
commit 31f48d9ac6c2899e48fef9e7a89f5512af6c30df
Merge: af5294a e85033f
Author: Dan Klco <kl...@adobe.com>
AuthorDate: Tue Mar 29 17:46:28 2022 -0400
Merging latest changes from master
pom.xml | 6 +-
.../resource/internal/JcrModifiableValueMap.java | 3 +-
.../sling/jcr/resource/internal/NodeUtil.java | 50 ++++++-
.../helper/jcr/BinaryDownloadUriProvider.java | 145 +++++++++++++++++++++
.../internal/helper/jcr/JcrNodeResource.java | 51 ++------
.../internal/helper/jcr/JcrResourceProvider.java | 48 +++----
.../resource/internal/JcrResourceListenerTest.java | 7 +-
.../helper/jcr/BinaryDownloadUriProviderTest.java | 125 ++++++++++++++++++
8 files changed, 360 insertions(+), 75 deletions(-)
diff --cc src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
index c7b75f4,bdb7790..e829200
--- a/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
+++ b/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
@@@ -27,9 -28,12 +28,10 @@@ import java.util.HashSet
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
- import java.util.concurrent.ConcurrentHashMap;
+ import java.util.SortedMap;
+ import java.util.TreeMap;
import java.util.concurrent.atomic.AtomicReference;
-import org.jetbrains.annotations.Nullable;
-import org.jetbrains.annotations.NotNull;
import javax.jcr.Item;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
@@@ -52,7 -57,7 +55,6 @@@ import org.apache.sling.jcr.resource.ap
import org.apache.sling.jcr.resource.internal.JcrListenerBaseConfig;
import org.apache.sling.jcr.resource.internal.JcrModifiableValueMap;
import org.apache.sling.jcr.resource.internal.JcrResourceListener;
--import org.apache.sling.jcr.resource.internal.NodeUtil;
import org.apache.sling.spi.resource.provider.ObserverConfiguration;
import org.apache.sling.spi.resource.provider.ProviderContext;
import org.apache.sling.spi.resource.provider.QueryLanguageProvider;
@@@ -104,17 -103,7 +106,16 @@@ public class JcrResourceProvider extend
IGNORED_PROPERTIES.add("jcr:createdBy");
}
+ @ObjectClassDefinition(name = "Apache Sling JCR Resource Provider", description = "Provides Sling resources based on the Java Content Repository")
+ public @interface Config {
+
+ @AttributeDefinition(name = "Enable Query Limit", description = "If set to true, the JcrResourceProvider will set a default limit for all other queries using the findResources / queryResources methods")
+ boolean enable_query_limit() default false;
+
+ @AttributeDefinition(name = "Query Limit", description = "The default query limit for queries using the findResources / queryResources methods")
+ long query_limit() default 10000L;
+ }
-
- @Reference(name = REPOSITORY_REFERNENCE_NAME, service = SlingRepository.class)
+ @Reference(name = REPOSITORY_REFERENCE_NAME, service = SlingRepository.class)
private ServiceReference<SlingRepository> repositoryReference;
/** The JCR listener base configuration. */
@@@ -129,15 -122,13 +134,14 @@@
private volatile JcrProviderStateFactory stateFactory;
+ private Config config;
+ private final AtomicReference<DynamicClassLoaderManager> classLoaderManagerReference = new AtomicReference<>();
- private final AtomicReference<DynamicClassLoaderManager> classLoaderManagerReference = new AtomicReference<DynamicClassLoaderManager>();
-
- private AtomicReference<URIProvider[]> uriProviderReference = new AtomicReference<URIProvider[]>();
+ private AtomicReference<URIProvider[]> uriProviderReference = new AtomicReference<>();
@Activate
- protected void activate(final ComponentContext context) {
+ protected void activate(final ComponentContext context, final Config config) throws RepositoryException {
- SlingRepository repository = context.locateService(REPOSITORY_REFERNENCE_NAME,
+ SlingRepository repository = context.locateService(REPOSITORY_REFERENCE_NAME,
this.repositoryReference);
if (repository == null) {
// concurrent unregistration of SlingRepository service