Interface DistributionPackageBuilder
-
@ProviderType public interface DistributionPackageBuilder
A builder forDistributionPackage
s
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull DistributionPackage
createPackage(@NotNull ResourceResolver resourceResolver, @NotNull DistributionRequest request)
creates aDistributionPackage
for a specificDistributionRequest
@Nullable DistributionPackage
getPackage(@NotNull ResourceResolver resourceResolver, @NotNull java.lang.String id)
get an already created (and saved into the repository)DistributionPackage
by its idjava.lang.String
getType()
returns the type of a package.@NotNull DistributionPackageInfo
installPackage(@NotNull ResourceResolver resourceResolver, @NotNull java.io.InputStream stream)
install a stream and returns the associated to aDistributionPackageInfo
this provider can read and installboolean
installPackage(@NotNull ResourceResolver resourceResolver, @NotNull DistributionPackage distributionPackage)
Installs the given distributionPackage into the repository@NotNull DistributionPackage
readPackage(@NotNull ResourceResolver resourceResolver, @NotNull java.io.InputStream stream)
reads a stream and tries to convert it to aDistributionPackage
this provider can read and install
-
-
-
Method Detail
-
getType
java.lang.String getType()
returns the type of a package. Only packages of this type will be accepted by the package builder.- Returns:
- the package type.
-
createPackage
@NotNull @NotNull DistributionPackage createPackage(@NotNull @NotNull ResourceResolver resourceResolver, @NotNull @NotNull DistributionRequest request) throws DistributionException
creates aDistributionPackage
for a specificDistributionRequest
- Parameters:
resourceResolver
- the resource resolver used to access the resources to be packagedrequest
- theDistributionRequest
to create the package for- Returns:
- a
DistributionPackage
ornull
if it could not be created - Throws:
DistributionException
- if any error occurs while creating the package, or if the resource resolver is not authorized to do that
-
readPackage
@NotNull @NotNull DistributionPackage readPackage(@NotNull @NotNull ResourceResolver resourceResolver, @NotNull @NotNull java.io.InputStream stream) throws DistributionException
reads a stream and tries to convert it to aDistributionPackage
this provider can read and install- Parameters:
resourceResolver
- resource resolver used to store the eventually created packagestream
- theInputStream
of the package to read- Returns:
- a
DistributionPackage
if it can read it from the stream - Throws:
DistributionException
- when the stream cannot be read as aDistributionPackage
-
getPackage
@Nullable @Nullable DistributionPackage getPackage(@NotNull @NotNull ResourceResolver resourceResolver, @NotNull @NotNull java.lang.String id) throws DistributionException
get an already created (and saved into the repository)DistributionPackage
by its id- Parameters:
resourceResolver
- resource resolver used to access the package with the given idid
- the unique identifier of an already createdDistributionPackage
- Returns:
- a
DistributionPackage
if one with such an id exists,null
otherwise - Throws:
DistributionException
- when the stream the package with that id cannot be retrieved
-
installPackage
boolean installPackage(@NotNull @NotNull ResourceResolver resourceResolver, @NotNull @NotNull DistributionPackage distributionPackage) throws DistributionException
Installs the given distributionPackage into the repository- Parameters:
resourceResolver
- the resource resolver used to install the packaged resourcesdistributionPackage
- the distribution package to install- Returns:
true
if the package was installed successfully- Throws:
DistributionException
- when installation fails
-
installPackage
@NotNull @NotNull DistributionPackageInfo installPackage(@NotNull @NotNull ResourceResolver resourceResolver, @NotNull @NotNull java.io.InputStream stream) throws DistributionException
install a stream and returns the associated to aDistributionPackageInfo
this provider can read and install- Parameters:
resourceResolver
- resource resolver used to store the eventually created packagestream
- theInputStream
of the package to read- Returns:
- a
DistributionPackage
if it can read it from the stream - Throws:
DistributionException
- when the stream cannot be read as aDistributionPackage
-
-