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.repository.legacy.metadata;
20  
21  import java.util.List;
22  
23  import org.apache.maven.artifact.Artifact;
24  import org.apache.maven.artifact.repository.ArtifactRepository;
25  import org.apache.maven.artifact.repository.RepositoryRequest;
26  
27  /**
28   * Forms a request to retrieve artifact metadata.
29   *
30   * @author Benjamin Bentmann
31   */
32  public interface MetadataResolutionRequest extends RepositoryRequest {
33  
34      /**
35       * Indicates whether network access to remote repositories has been disabled.
36       *
37       * @return {@code true} if remote access has been disabled, {@code false} otherwise.
38       */
39      boolean isOffline();
40  
41      /**
42       * Enables/disables network access to remote repositories.
43       *
44       * @param offline {@code true} to disable remote access, {@code false} to allow network access.
45       * @return This request, never {@code null}.
46       */
47      MetadataResolutionRequest setOffline(boolean offline);
48  
49      /**
50       * Gets the artifact to resolve metadata for.
51       *
52       * @return The artifact to resolve metadata for or {@code null} if not set.
53       */
54      Artifact getArtifact();
55  
56      /**
57       * Sets the artifact for which to resolve metadata.
58       *
59       * @param artifact The artifact for which to resolve metadata.
60       * @return This request, never {@code null}.
61       */
62      MetadataResolutionRequest setArtifact(Artifact artifact);
63  
64      /**
65       * Gets the local repository to use for the resolution.
66       *
67       * @return The local repository to use for the resolution or {@code null} if not set.
68       */
69      ArtifactRepository getLocalRepository();
70  
71      /**
72       * Sets the local repository to use for the resolution.
73       *
74       * @param localRepository The local repository to use for the resolution.
75       * @return This request, never {@code null}.
76       */
77      MetadataResolutionRequest setLocalRepository(ArtifactRepository localRepository);
78  
79      /**
80       * Gets the remote repositories to use for the resolution.
81       *
82       * @return The remote repositories to use for the resolution, never {@code null}.
83       */
84      List<ArtifactRepository> getRemoteRepositories();
85  
86      /**
87       * Sets the remote repositories to use for the resolution.
88       *
89       * @param remoteRepositories The remote repositories to use for the resolution.
90       * @return This request, never {@code null}.
91       */
92      MetadataResolutionRequest setRemoteRepositories(List<ArtifactRepository> remoteRepositories);
93  
94      /**
95       * Determines whether the managed version information should be retrieved.
96       *
97       * @return {@code true} if the dependency management information should be retrieved, {@code false} otherwise.
98       */
99      boolean isResolveManagedVersions();
100 
101     /**
102      * Enables/disables resolution of the dependency management information.
103      *
104      * @param resolveManagedVersions {@code true} if the dependency management information should be retrieved, {@code
105      *            false} otherwise.
106      * @return This request, never {@code null}.
107      */
108     MetadataResolutionRequest setResolveManagedVersions(boolean resolveManagedVersions);
109 }