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