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