001package org.apache.maven.artifact.repository;
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
024/**
025 * Collects basic settings to access the repository system.
026 * 
027 * @author Benjamin Bentmann
028 */
029public interface RepositoryRequest
030{
031
032    /**
033     * Indicates whether network access to remote repositories has been disabled.
034     * 
035     * @return {@code true} if remote access has been disabled, {@code false} otherwise.
036     */
037    boolean isOffline();
038
039    /**
040     * Enables/disables network access to remote repositories.
041     * 
042     * @param offline {@code true} to disable remote access, {@code false} to allow network access.
043     * @return This request, never {@code null}.
044     */
045    RepositoryRequest setOffline( boolean offline );
046
047    /**
048     * Indicates whether remote repositories should be re-checked for updated artifacts/metadata regardless of their
049     * configured update policy.
050     * 
051     * @return {@code true} if remote repositories should be re-checked for updated artifacts/metadata, {@code false}
052     *         otherwise.
053     */
054    boolean isForceUpdate();
055
056    /**
057     * Enables/disabled forced checks for updated artifacts/metadata on remote repositories.
058     * 
059     * @param forceUpdate {@code true} to forcibly check the remote repositories for updated artifacts/metadata, {@code
060     *            false} to use the update policy configured on each repository.
061     * @return This request, never {@code null}.
062     */
063    RepositoryRequest setForceUpdate( boolean forceUpdate );
064
065    /**
066     * Gets the local repository to use.
067     * 
068     * @return The local repository to use or {@code null} if not set.
069     */
070    ArtifactRepository getLocalRepository();
071
072    /**
073     * Sets the local repository to use.
074     * 
075     * @param localRepository The local repository to use.
076     * @return This request, never {@code null}.
077     */
078    RepositoryRequest setLocalRepository( ArtifactRepository localRepository );
079
080    /**
081     * Gets the remote repositories to use.
082     * 
083     * @return The remote repositories to use, never {@code null}.
084     */
085    List<ArtifactRepository> getRemoteRepositories();
086
087    /**
088     * Sets the remote repositories to use.
089     * 
090     * @param remoteRepositories The remote repositories to use.
091     * @return This request, never {@code null}.
092     */
093    RepositoryRequest setRemoteRepositories( List<ArtifactRepository> remoteRepositories );
094
095}