View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.eclipse.aether.connector.basic;
20  
21  import org.eclipse.aether.ConfigurationProperties;
22  import org.eclipse.aether.RepositorySystemSession;
23  
24  /**
25   * The configuration keys for {@link BasicRepositoryConnector}.
26   *
27   * @since 2.0.0
28   */
29  public final class BasicRepositoryConnectorConfigurationKeys {
30      private BasicRepositoryConnectorConfigurationKeys() {}
31  
32      /**
33       * The prefix for configuration properties.
34       */
35      public static final String CONFIG_PROPS_PREFIX =
36              ConfigurationProperties.PREFIX_CONNECTOR + BasicRepositoryConnectorFactory.NAME + ".";
37  
38      /**
39       * Flag indicating whether checksums which are retrieved during checksum validation should be persisted in the
40       * local repository next to the file they provide the checksum for.
41       *
42       * @since 0.9.0.M4
43       * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
44       * @configurationType {@link java.lang.Boolean}
45       * @configurationDefaultValue {@link #DEFAULT_PERSISTED_CHECKSUMS}
46       * @configurationRepoIdSuffix No
47       */
48      public static final String CONFIG_PROP_PERSISTED_CHECKSUMS = CONFIG_PROPS_PREFIX + "persistedChecksums";
49  
50      public static final boolean DEFAULT_PERSISTED_CHECKSUMS = true;
51  
52      /**
53       * Number of threads in basic connector for uploading/downloading. Observed only if some of the
54       * upstream or downstream threads are not set. (Deprecated)
55       *
56       * @since 0.9.0.M4
57       * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
58       * @configurationType {@link java.lang.Integer}
59       * @configurationDefaultValue {@link #DEFAULT_THREADS}
60       * @configurationRepoIdSuffix No
61       * @deprecated Use {@link #CONFIG_PROP_UPSTREAM_THREADS} and {@link #CONFIG_PROP_DOWNSTREAM_THREADS} instead.
62       */
63      @Deprecated
64      public static final String CONFIG_PROP_THREADS = CONFIG_PROPS_PREFIX + "threads";
65  
66      /**
67       * Number of threads in basic connector for uploading.
68       *
69       * @since 2.0.0
70       * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
71       * @configurationType {@link java.lang.Integer}
72       * @configurationDefaultValue {@link #DEFAULT_THREADS}
73       * @configurationRepoIdSuffix Yes
74       */
75      public static final String CONFIG_PROP_UPSTREAM_THREADS = CONFIG_PROPS_PREFIX + "upstreamThreads";
76  
77      /**
78       * Number of threads in basic connector for downloading.
79       *
80       * @since 2.0.0
81       * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
82       * @configurationType {@link java.lang.Integer}
83       * @configurationDefaultValue {@link #DEFAULT_THREADS}
84       * @configurationRepoIdSuffix Yes
85       */
86      public static final String CONFIG_PROP_DOWNSTREAM_THREADS = CONFIG_PROPS_PREFIX + "downstreamThreads";
87  
88      public static final int DEFAULT_THREADS = 5;
89  
90      /**
91       * Enables or disables parallel PUT processing (parallel deploys) on basic connector globally or per remote
92       * repository. When disabled, connector behaves exactly as in Maven 3.8.x did: GETs are parallel while PUTs
93       * are sequential.
94       *
95       * @since 1.9.5
96       * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
97       * @configurationType {@link java.lang.Boolean}
98       * @configurationDefaultValue {@link #DEFAULT_PARALLEL_PUT}
99       * @configurationRepoIdSuffix Yes
100      */
101     public static final String CONFIG_PROP_PARALLEL_PUT = CONFIG_PROPS_PREFIX + "parallelPut";
102 
103     public static final boolean DEFAULT_PARALLEL_PUT = true;
104 
105     /**
106      * Flag indicating that instead of comparing the external checksum fetched from the remote repo with the
107      * calculated one, it should try to extract the reference checksum from the actual artifact response headers
108      * This only works for HTTP transports.
109      *
110      * @since 0.9.0.M3
111      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
112      * @configurationType {@link java.lang.Boolean}
113      * @configurationDefaultValue {@link #DEFAULT_SMART_CHECKSUMS}
114      * @configurationRepoIdSuffix No
115      */
116     public static final String CONFIG_PROP_SMART_CHECKSUMS = CONFIG_PROPS_PREFIX + "smartChecksums";
117 
118     public static final boolean DEFAULT_SMART_CHECKSUMS = true;
119 }