Class BasicRepositoryConnector

    • Field Detail

      • CONFIG_PROP_THREADS

        private static final java.lang.String CONFIG_PROP_THREADS
        See Also:
        Constant Field Values
      • CONFIG_PROP_SMART_CHECKSUMS

        private static final java.lang.String CONFIG_PROP_SMART_CHECKSUMS
        See Also:
        Constant Field Values
      • CONFIG_PROP_PARALLEL_PUT

        private static final java.lang.String CONFIG_PROP_PARALLEL_PUT
        See Also:
        Constant Field Values
      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • providedChecksumsSources

        private final java.util.Map<java.lang.String,​ProvidedChecksumsSource> providedChecksumsSources
      • maxThreads

        private final int maxThreads
      • smartChecksums

        private final boolean smartChecksums
      • parallelPut

        private final boolean parallelPut
      • persistedChecksums

        private final boolean persistedChecksums
      • executor

        private java.util.concurrent.Executor executor
      • closed

        private final java.util.concurrent.atomic.AtomicBoolean closed
    • Method Detail

      • getExecutor

        private java.util.concurrent.Executor getExecutor​(int tasks)
      • 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 a IllegalStateException or similar. Closing an already closed connector is harmless and has no effect.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface RepositoryConnector
      • failIfClosed

        private void failIfClosed()
      • get

        public void get​(java.util.Collection<? extends ArtifactDownload> artifactDownloads,
                        java.util.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 via ArtifactTransfer.getException() and MetadataTransfer.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 interface RepositoryConnector
        Parameters:
        artifactDownloads - The artifact downloads to perform, may be null or empty.
        metadataDownloads - The metadata downloads to perform, may be null or empty.
      • put

        public void put​(java.util.Collection<? extends ArtifactUpload> artifactUploads,
                        java.util.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 via ArtifactTransfer.getException() and MetadataTransfer.getException(), respectively. The connector may perform the transfers concurrently and in any order.
        Specified by:
        put in interface RepositoryConnector
        Parameters:
        artifactUploads - The artifact uploads to perform, may be null or empty.
        metadataUploads - The metadata uploads to perform, may be null or empty.
      • groupUploads

        private static java.util.List<java.util.List<MetadataUpload>> groupUploads​(java.util.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

        private static <T> java.util.Collection<T> safe​(java.util.Collection<T> items)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object