Package org.apache.sling.caconfig.impl.override

# Class ConfigurationOverrideMultiplexerImpl

java.lang.Object
org.apache.sling.caconfig.impl.override.ConfigurationOverrideMultiplexerImpl

All Implemented Interfaces:
  `ConfigurationOverrideMultiplexer`, `org.apache.sling.commons.osgi.RankedServices.ChangeListener`

public class ConfigurationOverrideMultiplexerImpl extends Object implements ConfigurationOverrideMultiplexer, org.apache.sling.commons.osgi.RankedServices.ChangeListener
Detects all `ConfigurationOverrideProvider` implementations in the container and consolidates their result based on service ranking.

## Constructor Summary

Constructors
Constructor
Description
`ConfigurationOverrideMultiplexerImpl()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`bindConfigurationOverrideProvider(org.apache.sling.caconfig.spi.ConfigurationOverrideProvider item, Map<String,Object> props)`
`void`
`changed()`
If a provider is added or removed parse and collect all overrides again (to ensure correct overall order is preserved).
`boolean`
`isAllOverridden(@NotNull String contextPath, @NotNull String configName)`
Checks if the whole configuration for the given context path and name is overridden.
`Map<String,Object>`
`overrideProperties(@NotNull String contextPath, @NotNull String configName, @NotNull Map<String,Object> properties)`
Override properties for given context path and configuration name.
`org.apache.sling.api.resource.Resource`
`overrideProperties(@NotNull String contextPath, @NotNull String configName, @Nullable org.apache.sling.api.resource.Resource configResource)`
Override properties in given configuration resource (if any overrides are defined).
`org.apache.sling.api.resource.Resource`
`overrideProperties(@NotNull String contextPath, @NotNull String configName, @Nullable org.apache.sling.api.resource.Resource configResource, @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver)`
Override properties in given configuration resource (if any overrides are defined).
`protected void`
`unbindConfigurationOverrideProvider(org.apache.sling.caconfig.spi.ConfigurationOverrideProvider item, Map<String,Object> props)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ConfigurationOverrideMultiplexerImpl

public ConfigurationOverrideMultiplexerImpl()

## Method Details

### bindConfigurationOverrideProvider

protected void bindConfigurationOverrideProvider(org.apache.sling.caconfig.spi.ConfigurationOverrideProvider item, Map<String,Object> props)

### unbindConfigurationOverrideProvider

protected void unbindConfigurationOverrideProvider(org.apache.sling.caconfig.spi.ConfigurationOverrideProvider item, Map<String,Object> props)

### isAllOverridden

public boolean isAllOverridden(@NotNull @NotNull String contextPath, @NotNull @NotNull String configName)
Description copied from interface: `ConfigurationOverrideMultiplexer`
Checks if the whole configuration for the given context path and name is overridden.

Specified by:
  `isAllOverridden` in interface `ConfigurationOverrideMultiplexer`
Parameters:
  `contextPath` - Context path
  `configName` - Config name
Returns:
  true if the whole configuration is overridden.

### overrideProperties

public Map<String,Object> overrideProperties(@NotNull @NotNull String contextPath, @NotNull @NotNull String configName, @NotNull @NotNull Map<String,Object> properties)
Description copied from interface: `ConfigurationOverrideMultiplexer`
Override properties for given context path and configuration name.

Specified by:
  `overrideProperties` in interface `ConfigurationOverrideMultiplexer`
Parameters:
  `contextPath` - Path of context resource for which configuration was resolved
  `configName` - Configuration name
  `properties` - Resolved configuration properties
Returns:
  Overwritten or replaced properties - or null if no override took place

### overrideProperties

public org.apache.sling.api.resource.Resource overrideProperties(@NotNull @NotNull String contextPath, @NotNull @NotNull String configName, @Nullable @Nullable org.apache.sling.api.resource.Resource configResource)
Description copied from interface: `ConfigurationOverrideMultiplexer`
Override properties in given configuration resource (if any overrides are defined).

Specified by:
  `overrideProperties` in interface `ConfigurationOverrideMultiplexer`
Parameters:
  `contextPath` - Context path
  `configName` - Configuration name
  `configResource` - Resolved configuration resource
Returns:
  Resource with overwritten configuration properties - or original configuration resource if no override took place

### overrideProperties

public org.apache.sling.api.resource.Resource overrideProperties(@NotNull @NotNull String contextPath, @NotNull @NotNull String configName, @Nullable @Nullable org.apache.sling.api.resource.Resource configResource, @NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver)
Description copied from interface: `ConfigurationOverrideMultiplexer`
Override properties in given configuration resource (if any overrides are defined).

Specified by:
  `overrideProperties` in interface `ConfigurationOverrideMultiplexer`
Parameters:
  `contextPath` - Context path
  `configName` - Configuration name
  `configResource` - Resolved configuration resource
  `resourceResolver` - Resource resolver
Returns:
  Resource with overwritten configuration properties - or original configuration resource if no override took place

### changed

public void changed()
If a provider is added or removed parse and collect all overrides again (to ensure correct overall order is preserved).

Specified by:
  `changed` in interface `org.apache.sling.commons.osgi.RankedServices.ChangeListener`