@Singleton @Named(value="trusted2provided") public final class TrustedToProvidedChecksumsSourceAdapter extends java.lang.Object implements ProvidedChecksumsSource
TrustedChecksumsSource
to ProvidedChecksumsSource
used by connector. Hence, any
"trusted" source exist that is enabled, automatically becomes "provided" source as well.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
private java.util.Map<java.lang.String,TrustedChecksumsSource> |
trustedChecksumsSources |
Constructor and Description |
---|
TrustedToProvidedChecksumsSourceAdapter(java.util.Map<java.lang.String,TrustedChecksumsSource> trustedChecksumsSources) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.String> |
getProvidedArtifactChecksums(RepositorySystemSession session,
ArtifactDownload transfer,
java.util.List<ChecksumAlgorithmFactory> checksumAlgorithmFactories)
May return the provided checksums (for given artifact transfer) from source other than remote repository, or
null if it have no checksums available for given transfer. |
public static final java.lang.String NAME
private final java.util.Map<java.lang.String,TrustedChecksumsSource> trustedChecksumsSources
@Inject public TrustedToProvidedChecksumsSourceAdapter(java.util.Map<java.lang.String,TrustedChecksumsSource> trustedChecksumsSources)
public java.util.Map<java.lang.String,java.lang.String> getProvidedArtifactChecksums(RepositorySystemSession session, ArtifactDownload transfer, java.util.List<ChecksumAlgorithmFactory> checksumAlgorithmFactories)
ProvidedChecksumsSource
null
if it have no checksums available for given transfer. Provided checksums are "opt-in" for
transfer, in a way IF they are available upfront, they will be enforced according to checksum policy
in effect. Otherwise, provided checksum verification is completely left out.
For enabled provided checksum source is completely acceptable to return null
values, as that carries
the meaning "nothing to add here", as there are no checksums to be provided upfront transfer. Semantically, this
is equivalent to returning empty map, but signals the intent better.
getProvidedArtifactChecksums
in interface ProvidedChecksumsSource
transfer
- The transfer that is about to be executed.checksumAlgorithmFactories
- The checksum algorithms that are expected.null
.