View Javadoc
1   package org.eclipse.aether.impl;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   * 
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   * 
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.util.List;
23  
24  import org.eclipse.aether.RepositorySystemSession;
25  import org.eclipse.aether.repository.RemoteRepository;
26  import org.eclipse.aether.repository.RepositoryPolicy;
27  
28  /**
29   * Helps dealing with remote repository definitions.
30   * 
31   * @noimplement This interface is not intended to be implemented by clients.
32   * @noextend This interface is not intended to be extended by clients.
33   * @provisional This type is provisional and can be changed, moved or removed without prior notice.
34   */
35  public interface RemoteRepositoryManager
36  {
37  
38      /**
39       * Aggregates repository definitions by merging duplicate repositories and optionally applies mirror, proxy and
40       * authentication settings from the supplied session.
41       * 
42       * @param session The repository session during which the repositories will be accessed, must not be {@code null}.
43       * @param dominantRepositories The current list of remote repositories to merge the new definitions into, must not
44       *            be {@code null}.
45       * @param recessiveRepositories The remote repositories to merge into the existing list, must not be {@code null}.
46       * @param recessiveIsRaw {@code true} if the recessive repository definitions have not yet been subjected to mirror,
47       *            proxy and authentication settings, {@code false} otherwise.
48       * @return The aggregated list of remote repositories, never {@code null}.
49       * @see RepositorySystemSession#getMirrorSelector()
50       * @see RepositorySystemSession#getProxySelector()
51       * @see RepositorySystemSession#getAuthenticationSelector()
52       */
53      List<RemoteRepository> aggregateRepositories( RepositorySystemSession session,
54                                                    List<RemoteRepository> dominantRepositories,
55                                                    List<RemoteRepository> recessiveRepositories, 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( RepositorySystemSession session, RemoteRepository repository, boolean releases,
70                                  boolean snapshots );
71  
72  }