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 parametersConfigurationResolver
is the right place.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull java.util.Collection<java.lang.String>
getAllContextPaths(@NotNull Resource resource)
Get all context paths for which context-aware configurations could be defined.java.lang.String
getContextPath(@NotNull Resource resource)
Get the inner-most context path (deepest path) returned bygetAllContextPaths(Resource)
.@Nullable Resource
getResource(@NotNull Resource resource, @NotNull java.lang.String bucketName, @NotNull java.lang.String configName)
Get a context-aware singleton configuration resource defined by the given configuration name.@NotNull java.util.Collection<Resource>
getResourceCollection(@NotNull Resource resource, @NotNull java.lang.String bucketName, @NotNull java.lang.String configName)
Get a collection of context-aware configuration resources defined by the given configuration name.
-
-
-
Method Detail
-
getResource
@Nullable @Nullable Resource getResource(@NotNull @NotNull Resource resource, @NotNull @NotNull java.lang.String bucketName, @NotNull @NotNull java.lang.String configName)
Get a context-aware singleton configuration resource defined by the given configuration name.- Parameters:
resource
- Context resource to fetch configuration forbucketName
- 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 java.util.Collection<Resource> getResourceCollection(@NotNull @NotNull Resource resource, @NotNull @NotNull java.lang.String bucketName, @NotNull @NotNull java.lang.String configName)
Get a collection of context-aware configuration resources defined by the given configuration name.- Parameters:
resource
- Context resource to fetch configuration forbucketName
- 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
java.lang.String getContextPath(@NotNull @NotNull Resource resource)
Get the inner-most context path (deepest path) returned bygetAllContextPaths(Resource)
.- Parameters:
resource
- Context resource to fetch configuration for- Returns:
- Context path or null
-
getAllContextPaths
@NotNull @NotNull java.util.Collection<java.lang.String> getAllContextPaths(@NotNull @NotNull 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
-
-