Class DefaultConfigurationResourceResolvingStrategy
java.lang.Object
org.apache.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingStrategy
- All Implemented Interfaces:
- ConfigurationResourceResolvingStrategy
public class DefaultConfigurationResourceResolvingStrategy
extends Object
implements ConfigurationResourceResolvingStrategy
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic @interface
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetResource(@NotNull Resource contentResource, @NotNull Collection<String> bucketNames, @NotNull String configName) Get a context-aware singleton configuration resource defined by the given configuration name.getResourceCollection(@NotNull Resource contentResource, @NotNull Collection<String> bucketNames, @NotNull String configName) Get a collection of context-aware configuration resources defined by the given configuration name.getResourceCollectionInheritanceChain(@NotNull Resource contentResource, @NotNull Collection<String> bucketNames, @NotNull String configName) Get a collection of context-aware configuration resource inheritance chains defined by the given configuration name.getResourceCollectionParentPath(@NotNull Resource contentResource, @NotNull String bucketName, @NotNull String configName) Get the configuration resource collection parent path for storing configuration data for the given context resource and configuration name.getResourceInheritanceChain(@NotNull Resource contentResource, @NotNull Collection<String> bucketNames, @NotNull String configName) Get a context-aware singleton configuration resource inheritance chain defined by the given configuration name.getResourcePath(@NotNull Resource contentResource, @NotNull String bucketName, @NotNull String configName) Get the configuration resource path for storing configuration data for the given context resource and configuration name.
- 
Constructor Details- 
DefaultConfigurationResourceResolvingStrategypublic DefaultConfigurationResourceResolvingStrategy()
 
- 
- 
Method Details- 
getResourcepublic Resource getResource(@NotNull @NotNull Resource contentResource, @NotNull @NotNull Collection<String> bucketNames, @NotNull @NotNull String configName) Description copied from interface:ConfigurationResourceResolvingStrategyGet a context-aware singleton configuration resource defined by the given configuration name.- Specified by:
- getResourcein interface- ConfigurationResourceResolvingStrategy
- Parameters:
- contentResource- Context resource to fetch configuration for
- bucketNames- Configuration "bucket" names. For each inheritance level all bucket names are tried, and the first one that has a result is included.
- configName- Configuration name or relative path.
- Returns:
- Configuration resource or nullif this strategy did not found matching resources.
 
- 
getResourceInheritanceChainpublic Iterator<Resource> getResourceInheritanceChain(@NotNull @NotNull Resource contentResource, @NotNull @NotNull Collection<String> bucketNames, @NotNull @NotNull String configName) Description copied from interface:ConfigurationResourceResolvingStrategyGet a context-aware singleton configuration resource inheritance chain defined by the given configuration name. The first item of the inheritance chain it the same resource returned byConfigurationResourceResolvingStrategy.getResource(Resource, Collection, String).- Specified by:
- getResourceInheritanceChainin interface- ConfigurationResourceResolvingStrategy
- Parameters:
- contentResource- Context resource to fetch configuration for
- bucketNames- Configuration "bucket" names. For each inheritance level all bucket names are tried, and the first one that has a result is included.
- configName- Configuration name or relative path.
- Returns:
- Configuration resource inheritance chain or nullif this strategy did not found matching resources.
 
- 
getResourceCollectionpublic Collection<Resource> getResourceCollection(@NotNull @NotNull Resource contentResource, @NotNull @NotNull Collection<String> bucketNames, @NotNull @NotNull String configName) Description copied from interface:ConfigurationResourceResolvingStrategyGet a collection of context-aware configuration resources defined by the given configuration name.- Specified by:
- getResourceCollectionin interface- ConfigurationResourceResolvingStrategy
- Parameters:
- contentResource- Context resource to fetch configuration for
- bucketNames- Configuration "bucket" names. For each inheritance level all bucket names are tried, and the first one that has a result is included.
- configName- Configuration name or relative path.
- Returns:
- Collection of configuration resources or nullif this strategy did not found matching resources.
 
- 
getResourceCollectionInheritanceChainpublic Collection<Iterator<Resource>> getResourceCollectionInheritanceChain(@NotNull @NotNull Resource contentResource, @NotNull @NotNull Collection<String> bucketNames, @NotNull @NotNull String configName) Description copied from interface:ConfigurationResourceResolvingStrategyGet a collection of context-aware configuration resource inheritance chains defined by the given configuration name. The first item of each inheritance chain is the same item returned byConfigurationResourceResolvingStrategy.getResourceCollection(Resource, Collection, String).- Specified by:
- getResourceCollectionInheritanceChainin interface- ConfigurationResourceResolvingStrategy
- Parameters:
- contentResource- Context resource to fetch configuration for
- bucketNames- Configuration "bucket" names. For each inheritance level all bucket names are tried, and the first one that has a result is included.
- configName- Configuration name or relative path.
- Returns:
- Collection of configuration resource inheritance chains or nullif this strategy did not found matching resources.
 
- 
getResourcePathpublic String getResourcePath(@NotNull @NotNull Resource contentResource, @NotNull @NotNull String bucketName, @NotNull @NotNull String configName) Description copied from interface:ConfigurationResourceResolvingStrategyGet the configuration resource path for storing configuration data for the given context resource and configuration name. This path is used when no configuration resource exists yet, but new configuration data should be stored. So usually the returned path does not yet exist (and perhaps not even it's parents).- Specified by:
- getResourcePathin interface- ConfigurationResourceResolvingStrategy
- Parameters:
- contentResource- Context resource to fetch configuration for
- bucketName- Configuration "bucket" name. Each high-level configuration resolver should store it's configuration data grouped in a child resource of the configuration resource. This is what we call a "bucket", and the resource name is specified with this parameter.
- configName- Configuration name or relative path.
- Returns:
- Resource path, or null if no matching configuration resource path can be determined
 
- 
getResourceCollectionParentPathpublic String getResourceCollectionParentPath(@NotNull @NotNull Resource contentResource, @NotNull @NotNull String bucketName, @NotNull @NotNull String configName) Description copied from interface:ConfigurationResourceResolvingStrategyGet the configuration resource collection parent path for storing configuration data for the given context resource and configuration name. This path is used when no configuration resource collection exists yet, but new configuration data should be stored. So usually the returned path does not yet exist (and perhaps not even it's parents).- Specified by:
- getResourceCollectionParentPathin interface- ConfigurationResourceResolvingStrategy
- Parameters:
- contentResource- Context resource to fetch configuration for
- bucketName- Configuration "bucket" name. Each high-level configuration resolver should store it's configuration data grouped in a child resource of the configuration resource. This is what we call a "bucket", and the resource name is specified with this parameter.
- configName- Configuration name or relative path.
- Returns:
- Resource path, or null if no matching configuration resource path can be determined
 
 
-