Package org.apache.sling.caconfig.impl.def

# 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

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)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DefaultConfigurationPersistenceStrategy

public DefaultConfigurationPersistenceStrategy()

## Method Details

### getResource

public org.apache.sling.api.resource.Resource getResource(@NotNull @NotNull org.apache.sling.api.resource.Resource resource)

Specified by:
  `getResource` in interface `org.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 interface `org.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 interface `org.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2`

### getResourcePath

public String getResourcePath(@NotNull @NotNull String resourcePath)

Specified by:
  `getResourcePath` in interface `org.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2`

### getCollectionParentResourcePath

public String getCollectionParentResourcePath(@NotNull @NotNull String resourcePath)

Specified by:
  `getCollectionParentResourcePath` in interface `org.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2`

### getCollectionItemResourcePath

public String getCollectionItemResourcePath(@NotNull @NotNull String resourcePath)

Specified by:
  `getCollectionItemResourcePath` in interface `org.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2`

### getConfigName

public String getConfigName(@NotNull @NotNull String configName, @Nullable @Nullable String relatedConfigPath)

Specified by:
  `getConfigName` in interface `org.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2`

### getCollectionParentConfigName

public String getCollectionParentConfigName(@NotNull @NotNull String configName, @Nullable @Nullable String relatedConfigPath)

Specified by:
  `getCollectionParentConfigName` in interface `org.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2`

### getCollectionItemConfigName

public String getCollectionItemConfigName(@NotNull @NotNull String configName, @Nullable @Nullable String relatedConfigPath)

Specified by:
  `getCollectionItemConfigName` in interface `org.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 interface `org.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 interface `org.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 interface `org.apache.sling.caconfig.spi.ConfigurationPersistenceStrategy2`