Package org.apache.sling.caconfig.resource

## Interface ConfigurationResourceResolver

    @ProviderType
    public interface ConfigurationResourceResolver

Getting context-aware configuration resources for a given resource context. This is a low-level interface for supporting advanced use cases. If you just want to fetch some configuration parameters `ConfigurationResolver` is the right place.

### Method Summary

All Methods Instance Methods Abstract Methods
`@NotNull Collection<String>` `getAllContextPaths​(@NotNull org.apache.sling.api.resource.Resource resource)` Get all context paths for which context-aware configurations could be defined.
`String` `getContextPath​(@NotNull org.apache.sling.api.resource.Resource resource)` Get the inner-most context path (deepest path) returned by `getAllContextPaths(Resource)`.
`@Nullable org.apache.sling.api.resource.Resource` `getResource​(@NotNull org.apache.sling.api.resource.Resource resource, @NotNull String bucketName, @NotNull String configName)` Get a context-aware singleton configuration resource defined by the given configuration name.
`@NotNull Collection<org.apache.sling.api.resource.Resource>` `getResourceCollection​(@NotNull org.apache.sling.api.resource.Resource resource, @NotNull String bucketName, @NotNull String configName)` Get a collection of context-aware configuration resources defined by the given configuration name.

### Method Detail

#### getResource

    @Nullable
    @Nullable org.apache.sling.api.resource.Resource getResource​(@NotNull
                                                                 @NotNull org.apache.sling.api.resource.Resource resource,
                                                                 @NotNull
                                                                 @NotNull String bucketName,
                                                                 @NotNull
                                                                 @NotNull String configName)

Get a context-aware singleton configuration resource defined by the given configuration name.

Parameters:
  `resource` - 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:
  Configuration resource or `null`.

#### getResourceCollection

    @NotNull
    @NotNull Collection<org.apache.sling.api.resource.Resource> getResourceCollection​(@NotNull
                                                                                      @NotNull org.apache.sling.api.resource.Resource resource,
                                                                                      @NotNull
                                                                                      @NotNull String bucketName,
                                                                                      @NotNull
                                                                                      @NotNull String configName)

Get a collection of context-aware configuration resources defined by the given configuration name.

Parameters:
  `resource` - 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:
  Collection of configuration resources, the collection might be empty.

#### getContextPath

    String getContextPath​(@NotNull
                          @NotNull org.apache.sling.api.resource.Resource resource)

Get the inner-most context path (deepest path) returned by `getAllContextPaths(Resource)`.

Parameters:
  `resource` - Context resource to fetch configuration for
Returns:
  Context path or null

#### getAllContextPaths

    @NotNull
    @NotNull Collection<String> getAllContextPaths​(@NotNull
                                                   @NotNull org.apache.sling.api.resource.Resource resource)

Get all context paths for which context-aware configurations could be defined. The context paths are always ancestors of the resource path, or the resource path itself. Which ancestors are allowed for context-aware configuration depends on configuration.

Parameters:
  `resource` - Context resource to fetch configuration for
Returns:
  List of context paths