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.impl;
20  
21  import java.util.List;
22  
23  import org.eclipse.aether.RepositorySystemSession;
24  import org.eclipse.aether.repository.RemoteRepository;
25  import org.eclipse.aether.repository.RepositoryPolicy;
26  
27  /**
28   * Helps dealing with remote repository definitions.
29   *
30   * @noimplement This interface is not intended to be implemented by clients.
31   * @noextend This interface is not intended to be extended by clients.
32   * @provisional This type is provisional and can be changed, moved or removed without prior notice.
33   */
34  public interface RemoteRepositoryManager {
35  
36      /**
37       * Aggregates repository definitions by merging duplicate repositories and optionally applies mirror, proxy and
38       * authentication settings from the supplied session.
39       *
40       * @param session The repository session during which the repositories will be accessed, must not be {@code null}.
41       * @param dominantRepositories The current list of remote repositories to merge the new definitions into, must not
42       *            be {@code null}.
43       * @param recessiveRepositories The remote repositories to merge into the existing list, must not be {@code null}.
44       * @param recessiveIsRaw {@code true} if the recessive repository definitions have not yet been subjected to mirror,
45       *            proxy and authentication settings, {@code false} otherwise.
46       * @return The aggregated list of remote repositories, never {@code null}.
47       * @see RepositorySystemSession#getMirrorSelector()
48       * @see RepositorySystemSession#getProxySelector()
49       * @see RepositorySystemSession#getAuthenticationSelector()
50       */
51      List<RemoteRepository> aggregateRepositories(
52              RepositorySystemSession session,
53              List<RemoteRepository> dominantRepositories,
54              List<RemoteRepository> recessiveRepositories,
55              boolean recessiveIsRaw);
56  
57      /**
58       * Gets the effective repository policy for the specified remote repository by merging the applicable
59       * snapshot/release policy of the repository with global settings from the supplied session.
60       *
61       * @param session The repository session during which the repository will be accessed, must not be {@code null}.
62       * @param repository The remote repository to determine the effective policy for, must not be {@code null}.
63       * @param releases {@code true} if the policy for release artifacts needs to be considered, {@code false} if not.
64       * @param snapshots {@code true} if the policy for snapshot artifacts needs to be considered, {@code false} if not.
65       * @return The effective repository policy, never {@code null}.
66       * @see RepositorySystemSession#getChecksumPolicy()
67       * @see RepositorySystemSession#getUpdatePolicy()
68       */
69      RepositoryPolicy getPolicy(
70              RepositorySystemSession session, RemoteRepository repository, boolean releases, boolean snapshots);
71  }