org.sonatype.aether.spi.connector
Interface RepositoryConnectorFactory

All Known Implementing Classes:
AsyncRepositoryConnectorFactory, FileRepositoryConnectorFactory, WagonRepositoryConnectorFactory

public interface RepositoryConnectorFactory

A factory to create repository connectors. A repository connector is responsible for uploads/downloads to/from a certain kind of remote repository. When the repository system needs a repository connector 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 connector returned by a factory will then be used for the transfer.

Author:
Benjamin Bentmann

Method Summary
 int getPriority()
          The priority of this factory.
 RepositoryConnector newInstance(RepositorySystemSession session, RemoteRepository repository)
          Tries to create a repository connector for the specified remote repository.
 

Method Detail

newInstance

RepositoryConnector newInstance(RepositorySystemSession session,
                                RemoteRepository repository)
                                throws NoRepositoryConnectorException
Tries to create a repository connector for the specified remote repository. Typically, a factory will inspect RemoteRepository.getProtocol() and RemoteRepository.getContentType() to determine whether it can handle a repository.

Parameters:
session - The repository system session from which to configure the connector, must not be null. In particular, a connector must notify any RepositorySystemSession.getTransferListener() set for the session and should obey the timeouts configured for the session.
repository - The remote repository to create a connector for, must not be null.
Returns:
The connector for the given repository, never null.
Throws:
NoRepositoryConnectorException - If the factory cannot create a connector for the specified remote repository.

getPriority

int getPriority()
The priority of this factory. Factories with higher priority are preferred over those with lower priority.

Returns:
The priority of this factory.


Copyright © 2010-2012. All Rights Reserved.