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