org.sonatype.aether.spi.connector
Interface RepositoryConnector

All Known Implementing Classes:
FileRepositoryConnector

public interface RepositoryConnector

A connector for a remote repository. The connector is responsible for downloading/uploading of artifacts and metadata from/to a remote repository. Besides performing the actual transfer and recording any exception encountered in the provided upload/download objects, a connector must also use Transfer.setState(org.sonatype.aether.spi.connector.Transfer.State) to update the state of a transfer during its processing. Furthermore, the connector must notify any TransferListener configured on its associated RepositorySystemSession. If applicable, a connector should obey connect/request timeouts and other relevant settings from the configuration properties of the repository system session. While a connector itself can use multiple threads internally to performs the transfers, clients must not call a connector concurrently, i.e. connectors are generally not thread-safe.

Author:
Benjamin Bentmann
See Also:
RepositorySystemSession.getConfigProperties()

Method Summary
 void close()
          Closes this connector and frees any network resources associated with it.
 void get(java.util.Collection<? extends ArtifactDownload> artifactDownloads, java.util.Collection<? extends MetadataDownload> metadataDownloads)
          Performs the specified downloads.
 void put(java.util.Collection<? extends ArtifactUpload> artifactUploads, java.util.Collection<? extends MetadataUpload> metadataUploads)
          Performs the specified uploads.
 

Method Detail

get

void get(java.util.Collection<? extends ArtifactDownload> artifactDownloads,
         java.util.Collection<? extends MetadataDownload> metadataDownloads)
Performs the specified downloads. Any error encountered during a transfer can later be queried via ArtifactTransfer.getException() and MetadataTransfer.getException(), respectively. The connector may performs the transfers concurrently and in any order.

Parameters:
artifactDownloads - The artifact downloads to perform, may be null or empty.
metadataDownloads - The metadata downloads to perform, may be null or empty.

put

void put(java.util.Collection<? extends ArtifactUpload> artifactUploads,
         java.util.Collection<? extends MetadataUpload> metadataUploads)
Performs the specified uploads. Any error encountered during a transfer can later be queried via ArtifactTransfer.getException() and MetadataTransfer.getException(), respectively. The connector may performs the transfers concurrently and in any order.

Parameters:
artifactUploads - The artifact uploads to perform, may be null or empty.
metadataUploads - The metadata uploads to perform, may be null or empty.

close

void close()
Closes this connector and frees any network resources associated with it. Once closed, a connector must not be used for further transfers, any attempt to do so would yield a IllegalStateException or similar. Closing an already closed connector is harmless and has no effect.



Copyright © 2010-2011 Sonatype, Inc.. All Rights Reserved.