Package org.apache.sling.caconfig.spi
Interface ConfigurationPersistenceStrategy
-
@ConsumerType @Deprecated public interface ConfigurationPersistenceStrategyDeprecated.Please useConfigurationPersistenceStrategy2instead.Defines how configuration data is stored in the configuration resource. This SPI allows application to define their own content structure and node types to be used for configuration data storage.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleandeleteConfiguration(@NotNull ResourceResolver resourceResolver, @NotNull java.lang.String configResourcePath)Deprecated.Delete configuration or configuration collection data from repository using the inner-most context path as reference.@Nullable ResourcegetResource(@NotNull Resource resource)Deprecated.Allows the strategy to transform the given configuration resource according to it's persistent strategies, e.g.@Nullable java.lang.StringgetResourcePath(@NotNull java.lang.String resourcePath)Deprecated.Allows the strategy to transform the given configuration resource path according to it's persistent strategies, e.g.booleanpersistConfiguration(@NotNull ResourceResolver resourceResolver, @NotNull java.lang.String configResourcePath, @NotNull ConfigurationPersistData data)Deprecated.Stores configuration data for a singleton configuration resource.booleanpersistConfigurationCollection(@NotNull ResourceResolver resourceResolver, @NotNull java.lang.String configResourceCollectionParentPath, @NotNull ConfigurationCollectionPersistData data)Deprecated.Stores configuration data for a configuration resource collection.
-
-
-
Method Detail
-
getResource
@Nullable @Nullable Resource getResource(@NotNull @NotNull Resource resource)
Deprecated.Allows the strategy to transform the given configuration resource according to it's persistent strategies, e.g. fetching the data from a child resource instead of the given resource.- Parameters:
resource- Configuration resource- Returns:
- Transformed configuration resource. If null is returned this strategy does not support the given configuration resource.
-
getResourcePath
@Nullable @Nullable java.lang.String getResourcePath(@NotNull @NotNull java.lang.String resourcePath)Deprecated.Allows the strategy to transform the given configuration resource path according to it's persistent strategies, e.g. fetching the data from a child resource instead of the given resource.- Parameters:
resourcePath- Configuration resource path or part of it (e.g. config name)- Returns:
- Transformed configuration resource path. If null is returned this strategy does not support the given configuration resource path.
-
persistConfiguration
boolean persistConfiguration(@NotNull @NotNull ResourceResolver resourceResolver, @NotNull @NotNull java.lang.String configResourcePath, @NotNull @NotNull ConfigurationPersistData data)Deprecated.Stores configuration data for a singleton configuration resource. The changes are written using the given resource resolver. They are not committed, this is left to the caller.- Parameters:
resourceResolver- Resource resolverconfigResourcePath- Path to store configuration data to. The resource (and it's parents) may not exist and may have to be created.data- Configuration data to be stored. All existing properties are erased and replaced with the new ones.- Returns:
- true if the data was persisted. false if persisting the data was not accepted by this persistence strategy (in case of error throw an exception).
-
persistConfigurationCollection
boolean persistConfigurationCollection(@NotNull @NotNull ResourceResolver resourceResolver, @NotNull @NotNull java.lang.String configResourceCollectionParentPath, @NotNull @NotNull ConfigurationCollectionPersistData data)Deprecated.Stores configuration data for a configuration resource collection. The changes are written using the given resource resolver. They are not committed, this is left to the caller.- Parameters:
resourceResolver- Resource resolverconfigResourceCollectionParentPath- Parent path to store configuration collection data to. The resource (and it's parents) may not exist and may have to be created.data- Configuration collection data. All existing collection entries on this context path level are erased and replaced with the new ones.- Returns:
- true if the data was persisted. false if persisting the data was not accepted by this persistence strategy (in case of error throw an exception).
-
deleteConfiguration
boolean deleteConfiguration(@NotNull @NotNull ResourceResolver resourceResolver, @NotNull @NotNull java.lang.String configResourcePath)Deprecated.Delete configuration or configuration collection data from repository using the inner-most context path as reference.- Parameters:
resourceResolver- Resource resolverconfigResourcePath- Path to store configuration data to. The resource (and it's parents) may not exist and may have to be created.- Returns:
- true if the data was delete. false if deleting the data was not accepted by this persistence strategy (in case of error throw an exception).
-
-