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