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