001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.eclipse.aether.connector.basic;
020
021import org.eclipse.aether.ConfigurationProperties;
022import org.eclipse.aether.RepositorySystemSession;
023
024/**
025 * The configuration keys for {@link BasicRepositoryConnector}.
026 *
027 * @since 2.0.0
028 */
029public final class BasicRepositoryConnectorConfigurationKeys {
030    private BasicRepositoryConnectorConfigurationKeys() {}
031
032    /**
033     * The prefix for configuration properties.
034     */
035    public static final String CONFIG_PROPS_PREFIX =
036            ConfigurationProperties.PREFIX_CONNECTOR + BasicRepositoryConnectorFactory.NAME + ".";
037
038    /**
039     * Flag indicating whether checksums which are retrieved during checksum validation should be persisted in the
040     * local repository next to the file they provide the checksum for.
041     *
042     * @since 0.9.0.M4
043     * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
044     * @configurationType {@link java.lang.Boolean}
045     * @configurationDefaultValue {@link #DEFAULT_PERSISTED_CHECKSUMS}
046     * @configurationRepoIdSuffix No
047     */
048    public static final String CONFIG_PROP_PERSISTED_CHECKSUMS = CONFIG_PROPS_PREFIX + "persistedChecksums";
049
050    public static final boolean DEFAULT_PERSISTED_CHECKSUMS = true;
051
052    /**
053     * Flag indicating whether checksums which are retrieved during checksum validation should be persisted in the
054     * local repository next to the file they provide the checksum for.
055     *
056     * @since 0.9.0.M4
057     * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
058     * @configurationType {@link java.lang.Integer}
059     * @configurationDefaultValue {@link #DEFAULT_THREADS}
060     * @configurationRepoIdSuffix No
061     */
062    public static final String CONFIG_PROP_THREADS = CONFIG_PROPS_PREFIX + "threads";
063
064    public static final int DEFAULT_THREADS = 5;
065
066    /**
067     * Enables or disables parallel PUT processing (parallel deploys) on basic connector globally or per remote
068     * repository. When disabled, connector behaves exactly as in Maven 3.8.x did: GETs are parallel while PUTs
069     * are sequential.
070     *
071     * @since 1.9.5
072     * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
073     * @configurationType {@link java.lang.Boolean}
074     * @configurationDefaultValue {@link #DEFAULT_PARALLEL_PUT}
075     * @configurationRepoIdSuffix Yes
076     */
077    public static final String CONFIG_PROP_PARALLEL_PUT = CONFIG_PROPS_PREFIX + "parallelPut";
078
079    public static final boolean DEFAULT_PARALLEL_PUT = true;
080
081    /**
082     * Flag indicating that instead of comparing the external checksum fetched from the remote repo with the
083     * calculated one, it should try to extract the reference checksum from the actual artifact response headers
084     * This only works for HTTP transports.
085     *
086     * @since 0.9.0.M3
087     * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
088     * @configurationType {@link java.lang.Boolean}
089     * @configurationDefaultValue {@link #DEFAULT_SMART_CHECKSUMS}
090     * @configurationRepoIdSuffix No
091     */
092    public static final String CONFIG_PROP_SMART_CHECKSUMS = CONFIG_PROPS_PREFIX + "smartChecksums";
093
094    public static final boolean DEFAULT_SMART_CHECKSUMS = true;
095}