@Service(value=DistributionPackageBuilder.class) @Property(name="webconsole.configurationFactory.nameHint", value="Builder name: {name}") public class VaultDistributionPackageBuilderFactory extends Object implements DistributionPackageBuilder
| Modifier and Type | Field and Description |
|---|---|
static String |
AUTOSAVE_THRESHOLD |
static String |
FILE_THRESHOLD |
static String |
STRICT_IMPORT_SETTINGS |
static String |
USE_BINARY_REFERENCES |
static String |
USE_OFF_HEAP_MEMORY |
| Constructor and Description |
|---|
VaultDistributionPackageBuilderFactory() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate(org.osgi.framework.BundleContext context,
Map<String,Object> config) |
@NotNull DistributionPackage |
createPackage(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
@NotNull org.apache.sling.distribution.DistributionRequest request)
creates a
DistributionPackage for a specific DistributionRequest |
void |
deactivate() |
@Nullable DistributionPackage |
getPackage(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
@NotNull String id)
get an already created (and saved into the repository)
DistributionPackage by its id |
String |
getType()
returns the type of a package.
|
boolean |
installPackage(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
@NotNull DistributionPackage distributionPackage)
Installs the given distributionPackage into the repository
|
@NotNull DistributionPackageInfo |
installPackage(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
@NotNull InputStream stream)
install a stream and returns the associated to a
DistributionPackageInfo this provider can read and install |
@NotNull DistributionPackage |
readPackage(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
@NotNull InputStream stream)
reads a stream and tries to convert it to a
DistributionPackage this provider can read and install |
@Property(label="Use Binary References",
description="If activated, it avoids sending binaries in the distribution package.",
boolValue=false)
public static final String USE_BINARY_REFERENCES
@Property(label="Autosave threshold",
description="The value after which autosave is triggered for intermediate changes.",
intValue=-1)
public static final String AUTOSAVE_THRESHOLD
@Property(label="File threshold (in bytes)",
description="Once the data reaches the configurable size value, buffering to memory switches to file buffering.",
intValue=1)
public static final String FILE_THRESHOLD
@Property(label="Flag to enable/disable the off-heap memory",
description="Flag to enable/disable the off-heap memory, false by default",
boolValue=false)
public static final String USE_OFF_HEAP_MEMORY
@Property(label="Install a content package in a strict mode",
description="Flag to mark an error response will be thrown, if a content package will incorrectly installed",
boolValue=true)
public static final String STRICT_IMPORT_SETTINGS
public VaultDistributionPackageBuilderFactory()
@Activate
public void activate(org.osgi.framework.BundleContext context,
Map<String,Object> config)
@Deactivate public void deactivate()
public String getType()
DistributionPackageBuildergetType in interface DistributionPackageBuilder@NotNull public @NotNull DistributionPackage createPackage(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull @NotNull org.apache.sling.distribution.DistributionRequest request) throws DistributionException
DistributionPackageBuilderDistributionPackage for a specific DistributionRequestcreatePackage in interface DistributionPackageBuilderresourceResolver - the resource resolver used to access the resources to be packagedrequest - the DistributionRequest to create the package forDistributionPackage or null if it could not be createdDistributionException - if any error occurs while creating the package, or if the resource resolver is not authorized to do that@NotNull public @NotNull DistributionPackage readPackage(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull @NotNull InputStream stream) throws DistributionException
DistributionPackageBuilderDistributionPackage this provider can read and installreadPackage in interface DistributionPackageBuilderresourceResolver - resource resolver used to store the eventually created packagestream - the InputStream of the package to readDistributionPackage if it can read it from the streamDistributionException - when the stream cannot be read as a DistributionPackage@Nullable public @Nullable DistributionPackage getPackage(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull @NotNull String id) throws DistributionException
DistributionPackageBuilderDistributionPackage by its idgetPackage in interface DistributionPackageBuilderresourceResolver - resource resolver used to access the package with the given idid - the unique identifier of an already created DistributionPackageDistributionPackage if one with such an id exists, null otherwiseDistributionException - when the stream the package with that id cannot be retrievedpublic boolean installPackage(@NotNull
@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
@NotNull
@NotNull DistributionPackage distributionPackage)
throws DistributionException
DistributionPackageBuilderinstallPackage in interface DistributionPackageBuilderresourceResolver - the resource resolver used to install the packaged resourcesdistributionPackage - the distribution package to installtrue if the package was installed successfullyDistributionException@NotNull public @NotNull DistributionPackageInfo installPackage(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull @NotNull InputStream stream) throws DistributionException
DistributionPackageBuilderDistributionPackageInfo this provider can read and installinstallPackage in interface DistributionPackageBuilderresourceResolver - resource resolver used to store the eventually created packagestream - the InputStream of the package to readDistributionPackage if it can read it from the streamDistributionException - when the stream cannot be read as a DistributionPackageCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.