Class DefaultConfigurationResourceResolvingStrategy

java.lang.Object
org.apache.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingStrategy
All Implemented Interfaces:
ConfigurationResourceResolvingStrategy

public class DefaultConfigurationResourceResolvingStrategy extends Object implements ConfigurationResourceResolvingStrategy
  • Constructor Details

    • DefaultConfigurationResourceResolvingStrategy

      public DefaultConfigurationResourceResolvingStrategy()
  • Method Details

    • getResource

      public Resource getResource(@NotNull @NotNull Resource contentResource, @NotNull @NotNull Collection<String> bucketNames, @NotNull @NotNull String configName)
      Description copied from interface: ConfigurationResourceResolvingStrategy
      Get a context-aware singleton configuration resource defined by the given configuration name.
      Specified by:
      getResource in 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 null if this strategy did not found matching resources.
    • getResourceInheritanceChain

      public Iterator<Resource> getResourceInheritanceChain(@NotNull @NotNull Resource contentResource, @NotNull @NotNull Collection<String> bucketNames, @NotNull @NotNull String configName)
      Description copied from interface: ConfigurationResourceResolvingStrategy
      Get 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 by ConfigurationResourceResolvingStrategy.getResource(Resource, Collection, String).
      Specified by:
      getResourceInheritanceChain in 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 null if this strategy did not found matching resources.
    • getResourceCollection

      public Collection<Resource> getResourceCollection(@NotNull @NotNull Resource contentResource, @NotNull @NotNull Collection<String> bucketNames, @NotNull @NotNull String configName)
      Description copied from interface: ConfigurationResourceResolvingStrategy
      Get a collection of context-aware configuration resources defined by the given configuration name.
      Specified by:
      getResourceCollection in 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 null if this strategy did not found matching resources.
    • getResourceCollectionInheritanceChain

      public Collection<Iterator<Resource>> getResourceCollectionInheritanceChain(@NotNull @NotNull Resource contentResource, @NotNull @NotNull Collection<String> bucketNames, @NotNull @NotNull String configName)
      Description copied from interface: ConfigurationResourceResolvingStrategy
      Get 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 by ConfigurationResourceResolvingStrategy.getResourceCollection(Resource, Collection, String).
      Specified by:
      getResourceCollectionInheritanceChain in 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 null if this strategy did not found matching resources.
    • getResourcePath

      public String getResourcePath(@NotNull @NotNull Resource contentResource, @NotNull @NotNull String bucketName, @NotNull @NotNull String configName)
      Description copied from interface: ConfigurationResourceResolvingStrategy
      Get 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:
      getResourcePath in 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
    • getResourceCollectionParentPath

      public String getResourceCollectionParentPath(@NotNull @NotNull Resource contentResource, @NotNull @NotNull String bucketName, @NotNull @NotNull String configName)
      Description copied from interface: ConfigurationResourceResolvingStrategy
      Get 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:
      getResourceCollectionParentPath in 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