public MapEntries()

in src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java [160:195]


    public MapEntries(final MapConfigurationProvider factory, 
            final BundleContext bundleContext, 
            final EventAdmin eventAdmin, 
            final StringInterpolationProvider stringInterpolationProvider, 
            final Optional<ResourceResolverMetrics> metrics) 
                    throws LoginException, IOException {

        this.resolver = factory.getServiceResourceResolver(factory.getServiceUserAuthenticationInfo("mapping"));
        this.factory = factory;
        this.eventAdmin = eventAdmin;

        this.resolveMapsMap = Collections.singletonMap(GLOBAL_LIST_KEY, Collections.emptyList());
        this.mapMaps = Collections.<MapEntry> emptyList();
        this.vanityTargets = Collections.<String,List <String>>emptyMap();
        this.aliasMap = Collections.<String, Map<String, String>>emptyMap();
        this.stringInterpolationProvider = stringInterpolationProvider;

        this.useOptimizeAliasResolution = doInit();

        this.registration = registerResourceChangeListener(bundleContext);

        this.vanityCounter = new AtomicLong(0);
        this.vanityPathLookups = new AtomicLong(0);
        this.vanityPathBloomNegative = new AtomicLong(0);
        this.vanityPathBloomFalsePositive = new AtomicLong(0);
        initializeVanityPaths();

        this.metrics = metrics;
        if (metrics.isPresent()) {
            this.metrics.get().setNumberOfVanityPathsSupplier(vanityCounter::get);
            this.metrics.get().setNumberOfVanityPathLookupsSupplier(vanityPathLookups::get);
            this.metrics.get().setNumberOfVanityPathBloomNegativeSupplier(vanityPathBloomNegative::get);
            this.metrics.get().setNumberOfVanityPathBloomFalsePositiveSupplier(vanityPathBloomFalsePositive::get);
            this.metrics.get().setNumberOfAliasesSupplier(() -> (long) aliasMap.size());
        }
    }