public abstract class AbstractDistributionPackageBuilder extends Object implements DistributionPackageBuilder
DistributionPackageBuilder
Modifier and Type | Method and Description |
---|---|
@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 |
protected abstract @Nullable DistributionPackage |
createPackageForAdd(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
@NotNull org.apache.sling.distribution.DistributionRequest request) |
@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 |
protected abstract @Nullable DistributionPackage |
getPackageInternal(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
@NotNull String 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 |
protected abstract boolean |
installPackageInternal(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
@NotNull InputStream stream) |
@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 |
protected abstract @Nullable DistributionPackage |
readPackageInternal(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
@NotNull InputStream stream) |
public String getType()
DistributionPackageBuilder
getType
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
DistributionPackageBuilder
DistributionPackage
for a specific DistributionRequest
createPackage
in interface DistributionPackageBuilder
resourceResolver
- 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
DistributionPackageBuilder
DistributionPackage
this provider can read and installreadPackage
in interface DistributionPackageBuilder
resourceResolver
- 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
public boolean installPackage(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull @NotNull DistributionPackage distributionPackage) throws DistributionException
DistributionPackageBuilder
installPackage
in interface DistributionPackageBuilder
resourceResolver
- 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
DistributionPackageBuilder
DistributionPackageInfo
this provider can read and installinstallPackage
in interface DistributionPackageBuilder
resourceResolver
- 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)
DistributionPackageBuilder
DistributionPackage
by its idgetPackage
in interface DistributionPackageBuilder
resourceResolver
- resource resolver used to access the package with the given idid
- the unique identifier of an already created DistributionPackage
DistributionPackage
if one with such an id exists, null
otherwise@Nullable protected abstract @Nullable DistributionPackage createPackageForAdd(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull @NotNull org.apache.sling.distribution.DistributionRequest request) throws DistributionException
DistributionException
@Nullable protected abstract @Nullable DistributionPackage readPackageInternal(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull @NotNull InputStream stream) throws DistributionException
DistributionException
protected abstract boolean installPackageInternal(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull @NotNull InputStream stream) throws DistributionException
DistributionException
@Nullable protected abstract @Nullable DistributionPackage getPackageInternal(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull @NotNull String id)
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.