001package org.apache.maven.repository.legacy.metadata; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022import java.util.List; 023 024import org.apache.maven.artifact.Artifact; 025import org.apache.maven.artifact.repository.ArtifactRepository; 026import org.apache.maven.artifact.repository.RepositoryRequest; 027 028/** 029 * Forms a request to retrieve artifact metadata. 030 * 031 * @author Benjamin Bentmann 032 */ 033public interface MetadataResolutionRequest 034 extends RepositoryRequest 035{ 036 037 /** 038 * Indicates whether network access to remote repositories has been disabled. 039 * 040 * @return {@code true} if remote access has been disabled, {@code false} otherwise. 041 */ 042 boolean isOffline(); 043 044 /** 045 * Enables/disables network access to remote repositories. 046 * 047 * @param offline {@code true} to disable remote access, {@code false} to allow network access. 048 * @return This request, never {@code null}. 049 */ 050 MetadataResolutionRequest setOffline( boolean offline ); 051 052 /** 053 * Gets the artifact to resolve metadata for. 054 * 055 * @return The artifact to resolve metadata for or {@code null} if not set. 056 */ 057 Artifact getArtifact(); 058 059 /** 060 * Sets the artifact for which to resolve metadata. 061 * 062 * @param artifact The artifact for which to resolve metadata. 063 * @return This request, never {@code null}. 064 */ 065 MetadataResolutionRequest setArtifact( Artifact artifact ); 066 067 /** 068 * Gets the local repository to use for the resolution. 069 * 070 * @return The local repository to use for the resolution or {@code null} if not set. 071 */ 072 ArtifactRepository getLocalRepository(); 073 074 /** 075 * Sets the local repository to use for the resolution. 076 * 077 * @param localRepository The local repository to use for the resolution. 078 * @return This request, never {@code null}. 079 */ 080 MetadataResolutionRequest setLocalRepository( ArtifactRepository localRepository ); 081 082 /** 083 * Gets the remote repositories to use for the resolution. 084 * 085 * @return The remote repositories to use for the resolution, never {@code null}. 086 */ 087 List<ArtifactRepository> getRemoteRepositories(); 088 089 /** 090 * Sets the remote repositories to use for the resolution. 091 * 092 * @param remoteRepositories The remote repositories to use for the resolution. 093 * @return This request, never {@code null}. 094 */ 095 MetadataResolutionRequest setRemoteRepositories( List<ArtifactRepository> remoteRepositories ); 096 097 /** 098 * Determines whether the managed version information should be retrieved. 099 * 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}