Class DefaultConfigurationPersistenceStrategy
- java.lang.Object
-
- org.apache.sling.caconfig.impl.def.DefaultConfigurationPersistenceStrategy
-
- All Implemented Interfaces:
org.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2
public class DefaultConfigurationPersistenceStrategy extends Object implements org.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2
The default persistence strategy is quite simple: directly use the configuration resources. All existing properties are removed when new properties are stored in a singleton config resource. All existing child resources are removed when a new configs are stored for collection config resources.
-
-
Constructor Summary
Constructors Constructor Description DefaultConfigurationPersistenceStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
deleteConfiguration(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull String configResourcePath)
String
getCollectionItemConfigName(@NotNull String configName, @Nullable String relatedConfigPath)
org.apache.sling.api.resource.Resource
getCollectionItemResource(@NotNull org.apache.sling.api.resource.Resource resource)
String
getCollectionItemResourcePath(@NotNull String resourcePath)
String
getCollectionParentConfigName(@NotNull String configName, @Nullable String relatedConfigPath)
org.apache.sling.api.resource.Resource
getCollectionParentResource(@NotNull org.apache.sling.api.resource.Resource resource)
String
getCollectionParentResourcePath(@NotNull String resourcePath)
String
getConfigName(@NotNull String configName, @Nullable String relatedConfigPath)
org.apache.sling.api.resource.Resource
getResource(@NotNull org.apache.sling.api.resource.Resource resource)
String
getResourcePath(@NotNull String resourcePath)
boolean
persistConfiguration(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull String configResourcePath, @NotNull org.apache.sling.caconfig.spi.ConfigurationPersistData data)
boolean
persistConfigurationCollection(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull String configResourceCollectionParentPath, @NotNull org.apache.sling.caconfig.spi.ConfigurationCollectionPersistData data)
-
-
-
Method Detail
-
getResource
public org.apache.sling.api.resource.Resource getResource(@NotNull @NotNull org.apache.sling.api.resource.Resource resource)
- Specified by:
getResource
in interfaceorg.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2
-
getCollectionParentResource
public org.apache.sling.api.resource.Resource getCollectionParentResource(@NotNull @NotNull org.apache.sling.api.resource.Resource resource)
- Specified by:
getCollectionParentResource
in interfaceorg.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2
-
getCollectionItemResource
public org.apache.sling.api.resource.Resource getCollectionItemResource(@NotNull @NotNull org.apache.sling.api.resource.Resource resource)
- Specified by:
getCollectionItemResource
in interfaceorg.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2
-
getResourcePath
public String getResourcePath(@NotNull @NotNull String resourcePath)
- Specified by:
getResourcePath
in interfaceorg.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2
-
getCollectionParentResourcePath
public String getCollectionParentResourcePath(@NotNull @NotNull String resourcePath)
- Specified by:
getCollectionParentResourcePath
in interfaceorg.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2
-
getCollectionItemResourcePath
public String getCollectionItemResourcePath(@NotNull @NotNull String resourcePath)
- Specified by:
getCollectionItemResourcePath
in interfaceorg.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2
-
getConfigName
public String getConfigName(@NotNull @NotNull String configName, @Nullable @Nullable String relatedConfigPath)
- Specified by:
getConfigName
in interfaceorg.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2
-
getCollectionParentConfigName
public String getCollectionParentConfigName(@NotNull @NotNull String configName, @Nullable @Nullable String relatedConfigPath)
- Specified by:
getCollectionParentConfigName
in interfaceorg.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2
-
getCollectionItemConfigName
public String getCollectionItemConfigName(@NotNull @NotNull String configName, @Nullable @Nullable String relatedConfigPath)
- Specified by:
getCollectionItemConfigName
in interfaceorg.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2
-
persistConfiguration
public boolean persistConfiguration(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull @NotNull String configResourcePath, @NotNull @NotNull org.apache.sling.caconfig.spi.ConfigurationPersistData data)
- Specified by:
persistConfiguration
in interfaceorg.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2
-
persistConfigurationCollection
public boolean persistConfigurationCollection(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull @NotNull String configResourceCollectionParentPath, @NotNull @NotNull org.apache.sling.caconfig.spi.ConfigurationCollectionPersistData data)
- Specified by:
persistConfigurationCollection
in interfaceorg.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2
-
deleteConfiguration
public boolean deleteConfiguration(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull @NotNull String configResourcePath)
- Specified by:
deleteConfiguration
in interfaceorg.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2
-
-