Class DefaultFeaturesManager
java.lang.Object
org.apache.sling.feature.cpconverter.features.DefaultFeaturesManager
- All Implemented Interfaces:
FeaturesManager
,PackagesEventsEmitter
public class DefaultFeaturesManager
extends Object
implements FeaturesManager, PackagesEventsEmitter
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDefaultFeaturesManager
(boolean mergeConfigurations, int bundlesStartOrder, @NotNull File featureModelsOutputDirectory, @Nullable String artifactIdOverride, @Nullable String prefix, @NotNull Map<String, String> properties, @Nullable AclManager aclManager) DefaultFeaturesManager
(@NotNull File tempDir) DefaultFeaturesManager
(@NotNull DefaultFeaturesManager.ConfigurationHandling configurationHandling, int bundlesStartOrder, @NotNull File featureModelsOutputDirectory, @Nullable String artifactIdOverride, @Nullable String prefix, @NotNull Map<String, String> properties, @Nullable AclManager aclManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAPIRegionExport
(@Nullable String runMode, @NotNull String exportedPackage) void
addArtifact
(@Nullable String runMode, @NotNull org.apache.sling.feature.ArtifactId id) void
addArtifact
(@Nullable String runMode, @NotNull org.apache.sling.feature.Artifact artifact, @Nullable Integer startOrder) void
addConfiguration
(@Nullable String runMode, @NotNull org.apache.sling.feature.Configuration cfg, @NotNull String path, @NotNull Dictionary<String, Object> configurationProperties) Add a configurationvoid
addOrAppendOakIndexDefinitionsExtension
(String source, String text) void
addOrAppendRepoInitExtension
(@NotNull String source, @NotNull String text, @Nullable String runMode) Add repoinit instructionsvoid
addSeed
(@NotNull org.apache.sling.feature.Feature seed) void
end()
Package converter endsvoid
endPackage
(@NotNull org.apache.jackrabbit.vault.packaging.PackageId originalPackageId, @NotNull org.apache.jackrabbit.vault.packaging.VaultPackage convertedPackage) Marks the end of the conversion of the package withoriginalPackageId
.void
endSubPackage
(@NotNull String path, @NotNull org.apache.jackrabbit.vault.packaging.PackageId originalPackageId, @NotNull org.apache.jackrabbit.vault.packaging.VaultPackage convertedPackage) Marks the end of the conversion of the sub package withoriginalPackageId
.@NotNull org.apache.sling.feature.Feature
getRunMode
(@Nullable String runMode) @Nullable org.apache.sling.feature.Feature
void
init
(@NotNull org.apache.sling.feature.ArtifactId packageId) void
void
setAclManager
(AclManager aclManager) @NotNull DefaultFeaturesManager
setAPIRegions
(@NotNull List<String> regions) void
setEnforceServiceMappingByPrincipal
(boolean enforceServiceMappingByPrincipal) @NotNull DefaultFeaturesManager
setExportToAPIRegion
(@NotNull String region) void
start()
Package converter startsvoid
startPackage
(@NotNull org.apache.jackrabbit.vault.packaging.VaultPackage originalPackage) Marks the start of the given original package.void
startSubPackage
(@NotNull String path, @NotNull org.apache.jackrabbit.vault.packaging.VaultPackage originalPackage) Marks the start of the given sub package.
-
Constructor Details
-
DefaultFeaturesManager
-
DefaultFeaturesManager
public DefaultFeaturesManager(boolean mergeConfigurations, int bundlesStartOrder, @NotNull @NotNull File featureModelsOutputDirectory, @Nullable @Nullable String artifactIdOverride, @Nullable @Nullable String prefix, @NotNull @NotNull Map<String, String> properties, @Nullable @Nullable AclManager aclManager) -
DefaultFeaturesManager
public DefaultFeaturesManager(@NotNull @NotNull DefaultFeaturesManager.ConfigurationHandling configurationHandling, int bundlesStartOrder, @NotNull @NotNull File featureModelsOutputDirectory, @Nullable @Nullable String artifactIdOverride, @Nullable @Nullable String prefix, @NotNull @NotNull Map<String, String> properties, @Nullable @Nullable AclManager aclManager)
-
-
Method Details
-
init
public void init(@NotNull @NotNull org.apache.sling.feature.ArtifactId packageId) - Specified by:
init
in interfaceFeaturesManager
-
getTargetFeature
@Nullable public @Nullable org.apache.sling.feature.Feature getTargetFeature()- Specified by:
getTargetFeature
in interfaceFeaturesManager
-
getRunMode
@NotNull public @NotNull org.apache.sling.feature.Feature getRunMode(@Nullable @Nullable String runMode) - Specified by:
getRunMode
in interfaceFeaturesManager
-
addArtifact
public void addArtifact(@Nullable @Nullable String runMode, @NotNull @NotNull org.apache.sling.feature.ArtifactId id) - Specified by:
addArtifact
in interfaceFeaturesManager
-
addArtifact
public void addArtifact(@Nullable @Nullable String runMode, @NotNull @NotNull org.apache.sling.feature.Artifact artifact, @Nullable @Nullable Integer startOrder) - Specified by:
addArtifact
in interfaceFeaturesManager
-
addAPIRegionExport
public void addAPIRegionExport(@Nullable @Nullable String runMode, @NotNull @NotNull String exportedPackage) - Specified by:
addAPIRegionExport
in interfaceFeaturesManager
-
setEnforceServiceMappingByPrincipal
public void setEnforceServiceMappingByPrincipal(boolean enforceServiceMappingByPrincipal) -
addSeed
public void addSeed(@NotNull @NotNull org.apache.sling.feature.Feature seed) throws IOException, ConverterException - Throws:
IOException
ConverterException
-
getNamespaceUriByPrefix
- Specified by:
getNamespaceUriByPrefix
in interfaceFeaturesManager
-
setAclManager
-
addConfiguration
public void addConfiguration(@Nullable @Nullable String runMode, @NotNull @NotNull org.apache.sling.feature.Configuration cfg, @NotNull @NotNull String path, @NotNull @NotNull Dictionary<String, Object> configurationProperties) throws IOException, ConverterExceptionDescription copied from interface:FeaturesManager
Add a configuration- Specified by:
addConfiguration
in interfaceFeaturesManager
- Parameters:
runMode
- Optional runmodecfg
- The configuration object for the pid and factory pid, name - no propertiespath
- The path for the configurationconfigurationProperties
- The configuration properties- Throws:
IOException
- if an error occursConverterException
- if conversion fails
-
serialize
- Specified by:
serialize
in interfaceFeaturesManager
- Throws:
IOException
-
setAPIRegions
@NotNull public @NotNull DefaultFeaturesManager setAPIRegions(@NotNull @NotNull List<String> regions) -
setExportToAPIRegion
@NotNull public @NotNull DefaultFeaturesManager setExportToAPIRegion(@NotNull @NotNull String region) -
addOrAppendRepoInitExtension
public void addOrAppendRepoInitExtension(@NotNull @NotNull String source, @NotNull @NotNull String text, @Nullable @Nullable String runMode) Description copied from interface:FeaturesManager
Add repoinit instructions- Specified by:
addOrAppendRepoInitExtension
in interfaceFeaturesManager
- Parameters:
source
- An identifier for the source, for example the configuration pidtext
- The repoinit instructionsrunMode
- Optional runmode
-
addOrAppendOakIndexDefinitionsExtension
public void addOrAppendOakIndexDefinitionsExtension(String source, String text) throws IOException, ConverterException - Specified by:
addOrAppendOakIndexDefinitionsExtension
in interfaceFeaturesManager
- Throws:
IOException
ConverterException
-
start
public void start()Description copied from interface:PackagesEventsEmitter
Package converter starts- Specified by:
start
in interfacePackagesEventsEmitter
-
end
public void end()Description copied from interface:PackagesEventsEmitter
Package converter ends- Specified by:
end
in interfacePackagesEventsEmitter
-
startPackage
public void startPackage(@NotNull @NotNull org.apache.jackrabbit.vault.packaging.VaultPackage originalPackage) Description copied from interface:PackagesEventsEmitter
Marks the start of the given original package.- Specified by:
startPackage
in interfacePackagesEventsEmitter
- Parameters:
originalPackage
- the package to be converted.
-
endPackage
public void endPackage(@NotNull @NotNull org.apache.jackrabbit.vault.packaging.PackageId originalPackageId, @NotNull @NotNull org.apache.jackrabbit.vault.packaging.VaultPackage convertedPackage) Description copied from interface:PackagesEventsEmitter
Marks the end of the conversion of the package withoriginalPackageId
.- Specified by:
endPackage
in interfacePackagesEventsEmitter
- Parameters:
originalPackageId
- The id of the original package as passed toPackagesEventsEmitter.startPackage(VaultPackage)
.convertedPackage
- the converted package.
-
startSubPackage
public void startSubPackage(@NotNull @NotNull String path, @NotNull @NotNull org.apache.jackrabbit.vault.packaging.VaultPackage originalPackage) Description copied from interface:PackagesEventsEmitter
Marks the start of the given sub package.- Specified by:
startSubPackage
in interfacePackagesEventsEmitter
- Parameters:
path
- The path of the sub package in the original parent packageoriginalPackage
- the sub package to be converted.
-
endSubPackage
public void endSubPackage(@NotNull @NotNull String path, @NotNull @NotNull org.apache.jackrabbit.vault.packaging.PackageId originalPackageId, @NotNull @NotNull org.apache.jackrabbit.vault.packaging.VaultPackage convertedPackage) Description copied from interface:PackagesEventsEmitter
Marks the end of the conversion of the sub package withoriginalPackageId
.- Specified by:
endSubPackage
in interfacePackagesEventsEmitter
- Parameters:
path
- The path of the original sub package in the parent packageoriginalPackageId
- The id of the original sub package as passed toPackagesEventsEmitter.startSubPackage(String, VaultPackage)
.convertedPackage
- the converted package
-