Package org.apache.sling.distribution.packaging.impl.exporter

## Class RemoteDistributionPackageExporter

- java.lang.Object
- - org.apache.sling.distribution.packaging.impl.exporter.RemoteDistributionPackageExporter

All Implemented Interfaces:
  `org.apache.sling.distribution.packaging.impl.DistributionPackageExporter`

    public class RemoteDistributionPackageExporter
    extends Object
    implements org.apache.sling.distribution.packaging.impl.DistributionPackageExporter

Remote implementation of `DistributionPackageExporter`

### Constructor Summary

Constructors
`RemoteDistributionPackageExporter​(org.apache.sling.distribution.log.impl.DefaultDistributionLog log, DistributionPackageBuilder packageBuilder, org.apache.sling.distribution.transport.DistributionTransportSecretProvider secretProvider, String[] endpoints, int maxPullItems, org.apache.sling.distribution.transport.impl.HttpConfiguration httpConfiguration)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `exportPackages​(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull org.apache.sling.distribution.DistributionRequest distributionRequest, @NotNull org.apache.sling.distribution.packaging.impl.DistributionPackageProcessor packageProcessor)` Exports the `DistributionPackage`s built from the passed `DistributionRequest`.
`DistributionPackage` `getPackage​(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull String distributionPackageId)` Retrieves a `DistributionPackage` given its identifier, if it already exists.

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

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

### Constructor Detail

#### RemoteDistributionPackageExporter

    public RemoteDistributionPackageExporter​(org.apache.sling.distribution.log.impl.DefaultDistributionLog log,
                                             DistributionPackageBuilder packageBuilder,
                                             org.apache.sling.distribution.transport.DistributionTransportSecretProvider secretProvider,
                                             String[] endpoints,
                                             int maxPullItems,
                                             org.apache.sling.distribution.transport.impl.HttpConfiguration httpConfiguration)

### Method Detail

#### exportPackages

    public void exportPackages​(@NotNull
                               @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
                               @NotNull
                               @NotNull org.apache.sling.distribution.DistributionRequest distributionRequest,
                               @NotNull
                               @NotNull org.apache.sling.distribution.packaging.impl.DistributionPackageProcessor packageProcessor)
                        throws DistributionException

Description copied from interface: `org.apache.sling.distribution.packaging.impl.DistributionPackageExporter`
Exports the `DistributionPackage`s built from the passed `DistributionRequest`.

Specified by:
  `exportPackages` in interface `org.apache.sling.distribution.packaging.impl.DistributionPackageExporter`
Parameters:
  `resourceResolver` - the resource resolver used to export the packages, for example a 'local' exporter will use the resource resolver to read the content and assemble the binary in a certain location in the repository while a 'remote' exporter will use the resolver just to store the binary of the remotely fetched packages in the repository.
  `distributionRequest` - the request containing the needed information for content to be exported
  `packageProcessor` - a callback to process the exported package
Throws:
  `DistributionException`

#### getPackage

    public DistributionPackage getPackage​(@NotNull
                                          @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                          @NotNull
                                          @NotNull String distributionPackageId)
                                   throws DistributionException

Description copied from interface: `org.apache.sling.distribution.packaging.impl.DistributionPackageExporter`
Retrieves a `DistributionPackage` given its identifier, if it already exists. This will be used for example to get already created (and cached) packages that were not yet distributed to the target instance.

Specified by:
  `getPackage` in interface `org.apache.sling.distribution.packaging.impl.DistributionPackageExporter`
Parameters:
  `resourceResolver` - - the resource resolver use to obtain the package.
  `distributionPackageId` - - the `id of the package` to be retrieved
Returns:
  a `DistributionPackage` if available, `null` otherwise
Throws:
  `DistributionException`