Interface TransporterFactory
- All Known Subinterfaces:
HttpTransporterFactory
- All Known Implementing Classes:
ApacheTransporterFactory
,ClasspathTransporterFactory
,FileTransporterFactory
,JdkTransporterFactory
,JettyTransporterFactory
,MinioTransporterFactory
,WagonTransporterFactory
public interface TransporterFactory
A factory to create transporters. A transporter is responsible for uploads/downloads to/from a remote repository
using a particular transport protocol. When the repository system needs a transporter for a given remote repository,
it iterates the registered factories in descending order of their priority and calls
newInstance(RepositorySystemSession, RemoteRepository)
on them. The first transporter returned by a factory
will then be used for the transfer.-
Method Summary
Modifier and TypeMethodDescriptionfloat
The priority of this factory.newInstance
(RepositorySystemSession session, RemoteRepository repository) Tries to create a transporter for the specified remote repository.
-
Method Details
-
newInstance
Transporter newInstance(RepositorySystemSession session, RemoteRepository repository) throws NoTransporterException Tries to create a transporter for the specified remote repository. Typically, a factory will inspectRemoteRepository.getProtocol()
to determine whether it can handle a repository.- Parameters:
session
- The repository system session from which to configure the transporter, must not benull
. In particular, a transporter should obey the timeouts configured for the session.repository
- The remote repository to create a transporter for, must not benull
.- Returns:
- The transporter for the given repository, never
null
. - Throws:
NoTransporterException
- If the factory cannot create a transporter for the specified remote repository.
-
getPriority
float getPriority()The priority of this factory. When multiple factories can handle a given repository, factories with higher priority are preferred over those with lower priority.- Returns:
- The priority of this factory.
-