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