Interface TransporterFactory
-
- All Known Implementing Classes:
ClasspathTransporterFactory
,FileTransporterFactory
,HttpTransporterFactory
,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 callsnewInstance(RepositorySystemSession, RemoteRepository)
on them. The first transporter returned by a factory will then be used for the transfer.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description float
getPriority()
The priority of this factory.Transporter
newInstance(RepositorySystemSession session, RemoteRepository repository)
Tries to create a transporter for the specified remote repository.
-
-
-
Method Detail
-
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.
-
-