Class BasicRepositoryConnector
java.lang.Object
org.eclipse.aether.connector.basic.BasicRepositoryConnector
- All Implemented Interfaces:
Closeable
,AutoCloseable
,RepositoryConnector
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
(package private) class
(package private) class
(package private) class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ChecksumPolicyProvider
private final AtomicBoolean
private static final String
private static final String
private static final String
private Executor
private final FileProcessor
private final RepositoryLayout
private static final org.slf4j.Logger
private final int
private final boolean
private final boolean
private final Map
<String, ProvidedChecksumsSource> private final RemoteRepository
private final RepositorySystemSession
private final boolean
private final Transporter
-
Constructor Summary
ConstructorsConstructorDescriptionBasicRepositoryConnector
(RepositorySystemSession session, RemoteRepository repository, TransporterProvider transporterProvider, RepositoryLayoutProvider layoutProvider, ChecksumPolicyProvider checksumPolicyProvider, FileProcessor fileProcessor, Map<String, ProvidedChecksumsSource> providedChecksumsSources) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this connector and frees any network resources associated with it.private void
void
get
(Collection<? extends ArtifactDownload> artifactDownloads, Collection<? extends MetadataDownload> metadataDownloads) Performs the specified downloads.private Executor
getExecutor
(int tasks) private static List
<List<MetadataUpload>> groupUploads
(Collection<? extends MetadataUpload> metadataUploads) This method "groups" the Metadata to be uploaded by their level (version, artifact, group and root).private ChecksumPolicy
newChecksumPolicy
(String policy, TransferResource resource) private TransferEvent.Builder
newEventBuilder
(TransferResource resource, boolean upload, boolean peek) private TransferResource
newTransferResource
(URI path, File file, RequestTrace trace) void
put
(Collection<? extends ArtifactUpload> artifactUploads, Collection<? extends MetadataUpload> metadataUploads) Performs the specified uploads.private static <T> Collection
<T> safe
(Collection<T> items) toString()
-
Field Details
-
CONFIG_PROP_THREADS
- See Also:
-
CONFIG_PROP_SMART_CHECKSUMS
- See Also:
-
CONFIG_PROP_PARALLEL_PUT
- See Also:
-
LOGGER
private static final org.slf4j.Logger LOGGER -
providedChecksumsSources
-
fileProcessor
-
repository
-
session
-
transporter
-
layout
-
checksumPolicyProvider
-
maxThreads
private final int maxThreads -
smartChecksums
private final boolean smartChecksums -
parallelPut
private final boolean parallelPut -
persistedChecksums
private final boolean persistedChecksums -
executor
-
closed
-
-
Constructor Details
-
BasicRepositoryConnector
BasicRepositoryConnector(RepositorySystemSession session, RemoteRepository repository, TransporterProvider transporterProvider, RepositoryLayoutProvider layoutProvider, ChecksumPolicyProvider checksumPolicyProvider, FileProcessor fileProcessor, Map<String, ProvidedChecksumsSource> providedChecksumsSources) throws NoRepositoryConnectorException- Throws:
NoRepositoryConnectorException
-
-
Method Details
-
getExecutor
-
close
public void close()Description copied from interface:RepositoryConnector
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 aIllegalStateException
or similar. Closing an already closed connector is harmless and has no effect.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceRepositoryConnector
-
failIfClosed
private void failIfClosed() -
get
public void get(Collection<? extends ArtifactDownload> artifactDownloads, Collection<? extends MetadataDownload> metadataDownloads) Description copied from interface:RepositoryConnector
Performs the specified downloads. If a download fails, the connector stores the underlying exception in the download object such that callers can inspect the result viaArtifactTransfer.getException()
andMetadataTransfer.getException()
, respectively. If reasonable, a connector should continue to process the remaining downloads after an error to retrieve as many items as possible. The connector may perform the transfers concurrently and in any order.- Specified by:
get
in interfaceRepositoryConnector
- Parameters:
artifactDownloads
- The artifact downloads to perform, may benull
or empty.metadataDownloads
- The metadata downloads to perform, may benull
or empty.
-
put
public void put(Collection<? extends ArtifactUpload> artifactUploads, Collection<? extends MetadataUpload> metadataUploads) Description copied from interface:RepositoryConnector
Performs the specified uploads. If an upload fails, the connector stores the underlying exception in the upload object such that callers can inspect the result viaArtifactTransfer.getException()
andMetadataTransfer.getException()
, respectively. The connector may perform the transfers concurrently and in any order.- Specified by:
put
in interfaceRepositoryConnector
- Parameters:
artifactUploads
- The artifact uploads to perform, may benull
or empty.metadataUploads
- The metadata uploads to perform, may benull
or empty.
-
groupUploads
private static List<List<MetadataUpload>> groupUploads(Collection<? extends MetadataUpload> metadataUploads) This method "groups" the Metadata to be uploaded by their level (version, artifact, group and root). This is MUST as clients consume metadata in opposite order (root, group, artifact, version), and hence, we must deploy and ensure (in case of parallel deploy) that all V level metadata is deployed before we start deploying A level, etc. -
safe
-
newTransferResource
-
newEventBuilder
private TransferEvent.Builder newEventBuilder(TransferResource resource, boolean upload, boolean peek) -
newChecksumPolicy
-
toString
-