001    package 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    
022    
023    import java.util.List;
024    
025    import org.apache.maven.artifact.Artifact;
026    import org.apache.maven.artifact.metadata.ArtifactMetadata;
027    import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
028    import org.apache.maven.repository.Proxy;
029    
030    public interface ArtifactRepository
031    {
032        String pathOf( Artifact artifact );
033    
034        String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata );
035    
036        String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository );
037    
038        String getUrl();
039    
040        void setUrl( String url );
041    
042        String getBasedir();
043    
044        String getProtocol();
045    
046        String getId();
047    
048        void setId( String id );
049    
050        ArtifactRepositoryPolicy getSnapshots();
051    
052        void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy policy );
053    
054        ArtifactRepositoryPolicy getReleases();
055    
056        void setReleaseUpdatePolicy( ArtifactRepositoryPolicy policy );
057    
058        ArtifactRepositoryLayout getLayout();
059    
060        void setLayout( ArtifactRepositoryLayout layout );
061    
062        String getKey();
063    
064        @Deprecated
065        boolean isUniqueVersion();
066    
067        @Deprecated
068        boolean isBlacklisted();
069    
070        @Deprecated
071        void setBlacklisted( boolean blackListed );
072    
073        //
074        // New interface methods for the repository system.
075        //
076        Artifact find( Artifact artifact );
077    
078        /**
079         * Finds the versions of the specified artifact that are available in this repository.
080         *
081         * @param artifact The artifact whose available versions should be determined, must not be {@code null}.
082         * @return The available versions of the artifact or an empty list if none, never {@code null}.
083         */
084        List<String> findVersions( Artifact artifact );
085    
086        /**
087         * Indicates whether this repository is backed by actual projects. For instance, the build reactor or IDE workspace
088         * are examples of such repositories.
089         *
090         * @return {@code true} if the repository is backed by actual projects, {@code false} otherwise.
091         */
092        boolean isProjectAware();
093    
094        void setAuthentication( Authentication authentication );
095        Authentication getAuthentication();
096    
097        void setProxy( Proxy proxy );
098        Proxy getProxy();
099    
100        List<ArtifactRepository> getMirroredRepositories();
101        void setMirroredRepositories( List<ArtifactRepository> mirroredRepositories );
102    
103    }