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.apache.maven.artifact.repository;
20  
21  import java.util.List;
22  
23  /**
24   * Collects basic settings to access the repository system.
25   *
26   * @author Benjamin Bentmann
27   */
28  public interface RepositoryRequest {
29  
30      /**
31       * Indicates whether network access to remote repositories has been disabled.
32       *
33       * @return {@code true} if remote access has been disabled, {@code false} otherwise.
34       */
35      boolean isOffline();
36  
37      /**
38       * Enables/disables network access to remote repositories.
39       *
40       * @param offline {@code true} to disable remote access, {@code false} to allow network access.
41       * @return This request, never {@code null}.
42       */
43      RepositoryRequest setOffline(boolean offline);
44  
45      /**
46       * Indicates whether remote repositories should be re-checked for updated artifacts/metadata regardless of their
47       * configured update policy.
48       *
49       * @return {@code true} if remote repositories should be re-checked for updated artifacts/metadata, {@code false}
50       *         otherwise.
51       */
52      boolean isForceUpdate();
53  
54      /**
55       * Enables/disabled forced checks for updated artifacts/metadata on remote repositories.
56       *
57       * @param forceUpdate {@code true} to forcibly check the remote repositories for updated artifacts/metadata, {@code
58       *            false} to use the update policy configured on each repository.
59       * @return This request, never {@code null}.
60       */
61      RepositoryRequest setForceUpdate(boolean forceUpdate);
62  
63      /**
64       * Gets the local repository to use.
65       *
66       * @return The local repository to use or {@code null} if not set.
67       */
68      ArtifactRepository getLocalRepository();
69  
70      /**
71       * Sets the local repository to use.
72       *
73       * @param localRepository The local repository to use.
74       * @return This request, never {@code null}.
75       */
76      RepositoryRequest setLocalRepository(ArtifactRepository localRepository);
77  
78      /**
79       * Gets the remote repositories to use.
80       *
81       * @return The remote repositories to use, never {@code null}.
82       */
83      List<ArtifactRepository> getRemoteRepositories();
84  
85      /**
86       * Sets the remote repositories to use.
87       *
88       * @param remoteRepositories The remote repositories to use.
89       * @return This request, never {@code null}.
90       */
91      RepositoryRequest setRemoteRepositories(List<ArtifactRepository> remoteRepositories);
92  }